26 lines
563 B
CMake
Raw Normal View History

2023-07-02 19:51:09 +02:00
cmake_minimum_required(VERSION 3.5)
2013-11-03 12:27:13 +02:00
2022-03-29 21:10:50 +02:00
if(POLICY CMP0129)
cmake_policy(SET CMP0129 NEW)
endif()
2013-11-03 12:27:13 +02:00
project(add_compile_options)
add_compile_options(-DTEST_OPTION)
add_executable(add_compile_options main.cpp)
2022-03-29 21:10:50 +02:00
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC")
2013-11-03 12:27:13 +02:00
target_compile_definitions(add_compile_options
PRIVATE
"DO_GNU_TESTS"
)
endif()
2014-08-03 19:52:23 +02:00
add_compile_options(-rtti)
add_library(imp UNKNOWN IMPORTED)
get_target_property(_res imp COMPILE_OPTIONS)
if (_res)
message(SEND_ERROR "add_compile_options populated the COMPILE_OPTIONS target property")
endif()