On 9/16/2015 2:06 PM, Greg Marr wrote:
This part here is inaccurate, at least with the current CMake and Visual Studio: "To set the flag you will have to edit the CMake cache with the cmake-gui and add it to the CMAKE_CXX_FLAGS and the CMAKE_C_FLAGS."This is all we do in the CMake file that we include in all our projects: add_compile_options(/MP$ENV{NUMBER_OF_PROCESSORS}) If you don't have a NUMBER_OF_PROCESSORS environment variable, you just get /MP. The oversubscription part is still true, but I've never seen randomly bad object files.
I was writing it from the point of view of NOT having to edit the project. Seems like more of a per build decision to me. As there could be issues, the most reliable way to build is to not use /MP which is why CMake does not just do this by default. So, I would not want to recommend that projects make it a default. But, you can change the flags either by editing the CMakeLists.txt files or by editing the CMakeCache.txt file to change the flags in the build.
-Bill -- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake
