Fixing problem in CMakeLists.txt requiring multiple cmake commands to properly configure