diff options
author | Brad King <brad.king@kitware.com> | 2019-04-04 15:31:48 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2019-04-04 15:32:41 (GMT) |
commit | 0dfb056cd3fa655ddf3cabb6b3ce0309b3037ca1 (patch) | |
tree | fd8400e0a09cae8292235c0479392cbfb82168b2 /Tests | |
parent | 7795b3f2bfe3dbab35a494ceee37745eaff110f4 (diff) | |
parent | 076118694995c19de7637156322818f3994de76a (diff) | |
download | CMake-0dfb056cd3fa655ddf3cabb6b3ce0309b3037ca1.zip CMake-0dfb056cd3fa655ddf3cabb6b3ce0309b3037ca1.tar.gz CMake-0dfb056cd3fa655ddf3cabb6b3ce0309b3037ca1.tar.bz2 |
Merge topic 'pr.projectbefore'
0761186949 project: Add variable CMAKE_PROJECT_INCLUDE_BEFORE
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !3175
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeOnly/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt | 5 | ||||
-rw-r--r-- | Tests/CMakeOnly/ProjectIncludeBefore/include.cmake | 9 |
3 files changed, 20 insertions, 0 deletions
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 57f0cf8..1aeab8b 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -62,6 +62,12 @@ add_test(CMakeOnly.ProjectIncludeAny ${CMAKE_CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake ) +add_test(CMakeOnly.ProjectIncludeBefore ${CMAKE_CMAKE_COMMAND} + -DTEST=ProjectIncludeBefore + -DCMAKE_ARGS=-DCMAKE_PROJECT_INCLUDE_BEFORE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectIncludeBefore/include.cmake + -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake + ) + include(CMakeParseArguments) function(add_major_test module) diff --git a/Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt b/Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt new file mode 100644 index 0000000..5cd9cba --- /dev/null +++ b/Tests/CMakeOnly/ProjectIncludeBefore/CMakeLists.txt @@ -0,0 +1,5 @@ +set(FOO TRUE) +project(ProjectInclude LANGUAGES NONE) +if(NOT AUTO_INCLUDE) + message(FATAL_ERROR "include file not found") +endif() diff --git a/Tests/CMakeOnly/ProjectIncludeBefore/include.cmake b/Tests/CMakeOnly/ProjectIncludeBefore/include.cmake new file mode 100644 index 0000000..0a4799d --- /dev/null +++ b/Tests/CMakeOnly/ProjectIncludeBefore/include.cmake @@ -0,0 +1,9 @@ +if(NOT FOO) + message(FATAL_ERROR "FOO is not set") +endif() + +if(NOT "${PROJECT_NAME}" STREQUAL "") + message(FATAL_ERROR "PROJECT_NAME should be empty") +endif() + +set(AUTO_INCLUDE TRUE) |