2023-07-02 19:51:09 +02:00
|
|
|
cmake_minimum_required(VERSION 3.5)
|
2013-03-16 19:13:01 +02:00
|
|
|
project(CompileDefinitions)
|
|
|
|
|
2013-04-21 10:33:41 +03:00
|
|
|
# Use compile flags to tell executables which config is built
|
|
|
|
# without depending on the compile definitions functionality.
|
|
|
|
foreach(c DEBUG RELEASE RELWITHDEBINFO MINSIZEREL)
|
|
|
|
set(CMAKE_C_FLAGS_${c} "${CMAKE_C_FLAGS_${c}} -DTEST_CONFIG_${c}")
|
|
|
|
set(CMAKE_CXX_FLAGS_${c} "${CMAKE_CXX_FLAGS_${c}} -DTEST_CONFIG_${c}")
|
|
|
|
endforeach()
|
|
|
|
|
|
|
|
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
|
|
|
|
"BUILD_CONFIG_NAME=\"$<CONFIGURATION>\""
|
|
|
|
)
|
|
|
|
|
2015-04-27 22:25:09 +02:00
|
|
|
add_subdirectory(add_def_cmd)
|
2013-03-16 19:13:01 +02:00
|
|
|
add_subdirectory(target_prop)
|
2015-04-27 22:25:09 +02:00
|
|
|
add_subdirectory(add_def_cmd_tprop)
|
2013-03-16 19:13:01 +02:00
|
|
|
|
2013-04-21 10:33:41 +03:00
|
|
|
add_executable(CompileDefinitions runtest.c)
|