IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 82cfeb59 authored by ralfulrich's avatar ralfulrich
Browse files

cmake more robust

parent f248f461
No related branches found
No related tags found
1 merge request!328Resolve "WITH_HISTORY not working"
Pipeline #3596 passed
...@@ -8,6 +8,24 @@ set (CORSIKA8_VERSION @c8_version@) ...@@ -8,6 +8,24 @@ set (CORSIKA8_VERSION @c8_version@)
option (WITH_HISTORY "Flag to switch on/off HISTORY" ON) option (WITH_HISTORY "Flag to switch on/off HISTORY" ON)
#+++++++++++++++++++++++++++++
# Build types settings
#
# setup coverage build type
set (CMAKE_CXX_FLAGS_COVERAGE "-g --coverage")
set (CMAKE_EXE_LINKER_FLAGS_COVERAGE "--coverage")
set (CMAKE_SHARED_LINKER_FLAGS_COVERAGE "--coverage")
# set a flag to inform code that we are in debug mode
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
set (ALLOWED_BUILD_TYPES Debug Release MinSizeRel RelWithDebInfo Coverage)
set_property (CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS ${ALLOWED_BUILD_TYPES})
set (DEFAULT_BUILD_TYPE "Release")
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
set (CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE
STRING "Choose the type of build." FORCE)
endif (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
#++++++++++++++++++++++++++++ #++++++++++++++++++++++++++++
# General config and flags # General config and flags
# #
...@@ -49,7 +67,11 @@ check_required_components (corsika) ...@@ -49,7 +67,11 @@ check_required_components (corsika)
# add further definitions / options # add further definitions / options
# #
if (WITH_HISTORY) if (WITH_HISTORY)
target_compile_definitions (CORSIKA8::CORSIKA8 INTERFACE "WITH_HISTORY") set_property (
TARGET CORSIKA8::CORSIKA8
APPEND PROPERTY
INTERFACE_COMPILE_DEFINITIONS "WITH_HISTORY"
)
endif (WITH_HISTORY) endif (WITH_HISTORY)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment