Le 21/06/2019 à 15:42, David Aldrich a écrit :
Do never test CMAKE_BUILD_TYPE in CMakeLists.txt files, it is ignored in multiple generators (e.g. Visual Studio).Does that mean I shouldn't have this in CMakeLists.txt? : # Specify a Release build by default if(NOT CMAKE_BUILD_TYPE) set(CMAKE_BUILD_TYPE "Release") message(STATUS "Build type not specified: Use Release by default") endif(NOT CMAKE_BUILD_TYPE)
It may be handy if you're sure that the project will only use single generators tools (e.g. make, ninja) otherwise yes it's strongly advised to not touch/inspect CMAKE_BUILD_TYPE if your project can be build with any kind of generators.
Regards -- David -- 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: https://cmake.org/mailman/listinfo/cmake
