Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Kitware
GitHub Repository: Kitware/CMake
Path: blob/master/Tests/CMakeCommands/add_compile_options/CMakeLists.txt
3157 views
1
cmake_minimum_required(VERSION 3.10)
2
3
if(POLICY CMP0129)
4
cmake_policy(SET CMP0129 NEW)
5
endif()
6
7
project(add_compile_options)
8
9
add_compile_options(-DTEST_OPTION)
10
11
add_executable(add_compile_options main.cpp)
12
13
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|LCC")
14
target_compile_definitions(add_compile_options
15
PRIVATE
16
"DO_GNU_TESTS"
17
)
18
endif()
19
20
add_compile_options(-rtti)
21
add_library(imp UNKNOWN IMPORTED)
22
get_target_property(_res imp COMPILE_OPTIONS)
23
if (_res)
24
message(SEND_ERROR "add_compile_options populated the COMPILE_OPTIONS target property")
25
endif()
26
27