diff options
author | Brad King <brad.king@kitware.com> | 2013-06-05 13:39:05 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-06-05 13:39:05 (GMT) |
commit | 93317839b0aa7b47e37aad96ef3e0d4cfea236ba (patch) | |
tree | f01fec3a9f24ff5e7460ae25c8e4ac078371c2e0 /Tests | |
parent | ff8917fdd2e8739a46c84ab03911258c23779744 (diff) | |
parent | a984f3257e95f29a72da6566859d4c6a8a5d749b (diff) | |
download | CMake-93317839b0aa7b47e37aad96ef3e0d4cfea236ba.zip CMake-93317839b0aa7b47e37aad96ef3e0d4cfea236ba.tar.gz CMake-93317839b0aa7b47e37aad96ef3e0d4cfea236ba.tar.bz2 |
Merge topic 'add_compile_options-command'
a984f32 Introduce add_compile_options command.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeCommands/add_compile_options/CMakeLists.txt | 14 | ||||
-rw-r--r-- | Tests/CMakeCommands/add_compile_options/main.cpp | 11 |
2 files changed, 25 insertions, 0 deletions
diff --git a/Tests/CMakeCommands/add_compile_options/CMakeLists.txt b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt new file mode 100644 index 0000000..1652cf6 --- /dev/null +++ b/Tests/CMakeCommands/add_compile_options/CMakeLists.txt @@ -0,0 +1,14 @@ +cmake_minimum_required(VERSION 2.8) + +project(add_compile_options) + +add_compile_options(-DTEST_OPTION) + +add_executable(add_compile_options main.cpp) + +if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") + target_compile_definitions(add_compile_options + PRIVATE + "DO_GNU_TESTS" + ) +endif() diff --git a/Tests/CMakeCommands/add_compile_options/main.cpp b/Tests/CMakeCommands/add_compile_options/main.cpp new file mode 100644 index 0000000..2bb20ac --- /dev/null +++ b/Tests/CMakeCommands/add_compile_options/main.cpp @@ -0,0 +1,11 @@ + +#ifdef DO_GNU_TESTS +# ifndef TEST_OPTION +# error Expected TEST_OPTION +# endif +#endif + +int main(void) +{ + return 0; +} |