Skip to content
Snippets Groups Projects
Commit dde474a4 authored by Matthias Puchner's avatar Matthias Puchner
Browse files

moved build type modification out of Compiler.cmake to head of CMake script

parent 116c6ee2
No related branches found
No related tags found
1 merge request!73CMake improvements
......@@ -22,13 +22,19 @@ project(BornAgain
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Show info about generator type
## Show info about generator type; set CMAKE_BUILD_TYPE if not given
if (CMAKE_CONFIGURATION_TYPES)
message(STATUS "Generator type: Multi-configuration generator")
else()
message(STATUS "Generator type: Single-configuration generator")
endif()
message(" CMAKE_CONFIGURATION_TYPES: ${CMAKE_CONFIGURATION_TYPES}")
# The following is not correct/does not have any effect for multi-configuration generators.
# But when correcting this, be aware that CMAKE_BUILD_TYPE is used in more scripts!
if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
message(" CMAKE_BUILD_TYPE type not given - forced to 'Release'")
endif()
message(" CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
include(CTest) # equivalent to "enable_testing() ???
......
......@@ -2,14 +2,6 @@
# Compiler.cmake
#---------------------------------------------------------------------------------------------------
#--- Set a default build type for single-configuration CMake generators if no build type is set ---
if(NOT CMAKE_BUILD_TYPE)
# set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING "" FORCE)
set(CMAKE_BUILD_TYPE Release CACHE STRING "" FORCE)
endif()
message(STATUS "CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}")
#--- Need to locate thead libraries and options to set properly some compilation flags ---
find_package(Threads)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment