Re: [cmake-developers] Default compile options
We do specify the CMAKE_BUILD_TYPE when generating the makefiles. But it still doesn't work. I forgot to mention the generator name is NMake Makefiles. Perhaps it's a bug? -Original Message- From: Brad King [mailto:brad.k...@kitware.com] Sent: Tuesday, August 25, 2015 8:53 AM To: Robert Goulet robert.gou...@autodesk.com Cc: cmake-developers@cmake.org Subject: Re: [cmake-developers] Default compile options On 08/24/2015 05:17 PM, Robert Goulet wrote: set(CMAKE_C_FLAGS_DEBUG -D_DEBUG) in a Makefile those flags are not even passed to the compiler. In the Makefile and Ninja generators the per-config flags are used only for the configuration named in CMAKE_BUILD_TYPE. -Brad -- 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-developers
Re: [cmake-developers] Default compile options
On 08/25/2015 09:27 AM, Robert Goulet wrote: We do specify the CMAKE_BUILD_TYPE when generating the makefiles. But it still doesn't work. I forgot to mention the generator name is NMake Makefiles. Perhaps it's a bug? Please provide a minimal/complete CMakeLists.txt file demonstrating the problem. -Brad -- 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-developers
[cmake-developers] Default compile options
In our root CMakeLists.txt file we do this: set(CMAKE_C_FLAGS) set(CMAKE_CXX_FLAGS) set(CMAKE_C_FLAGS_DEBUG -D_DEBUG) set(CMAKE_CXX_FLAGS_DEBUG -D_DEBUG) set(CMAKE_C_FLAGS_RELEASE -DNDEBUG) set(CMAKE_CXX_FLAGS_RELEASE -DNDEBUG) This is to reset the build flags for all platforms, but it doesn't seems to work very well. For instance, if we generate a Visual Studio project, it seems to work just fine, but in a Makefile those flags are not even passed to the compiler. Is this a bug or perhaps we are not doing it right? Why would it work for VS but not makefiles? Any suggestions? Thanks! -- 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-developers