Apply the changes from !530 (closed) Move changes in CMakeList.txt by hand due to very many conflicts