diff options
author | David Cole <david.cole@kitware.com> | 2012-03-02 16:49:35 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2012-03-02 16:49:35 (GMT) |
commit | 1073d50508aa384984b9ea6200863855237ad4a1 (patch) | |
tree | b41d7b7c158bd939b75d6137bb9fb50daa2004c6 /Tests | |
parent | 20446079eebe5cf734f673071efd0d1b56a02a61 (diff) | |
parent | 2557a080543a37f92e1908420842db8c90685304 (diff) | |
download | CMake-1073d50508aa384984b9ea6200863855237ad4a1.zip CMake-1073d50508aa384984b9ea6200863855237ad4a1.tar.gz CMake-1073d50508aa384984b9ea6200863855237ad4a1.tar.bz2 |
Merge topic 'inject_code_via_variable'
2557a08 Fix typo in error message, and remove redundent test.
9090572 Add ability to include a file in a project via a cache variable.
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/CMakeOnly/CMakeLists.txt | 6 | ||||
-rw-r--r-- | Tests/CMakeOnly/ProjectInclude/CMakeLists.txt | 4 | ||||
-rw-r--r-- | Tests/CMakeOnly/ProjectInclude/include.cmake | 1 | ||||
-rw-r--r-- | Tests/CMakeOnly/Test.cmake.in | 3 |
4 files changed, 13 insertions, 1 deletions
diff --git a/Tests/CMakeOnly/CMakeLists.txt b/Tests/CMakeOnly/CMakeLists.txt index 4407efb..a1551ca 100644 --- a/Tests/CMakeOnly/CMakeLists.txt +++ b/Tests/CMakeOnly/CMakeLists.txt @@ -22,3 +22,9 @@ add_CMakeOnly_test(CheckLanguage) add_CMakeOnly_test(AllFindModules) add_CMakeOnly_test(TargetScope) + +add_test(CMakeOnly.ProjectInclude ${CMAKE_CMAKE_COMMAND} + -DTEST=ProjectInclude + -DCMAKE_ARGS=-DCMAKE_PROJECT_ProjectInclude_INCLUDE=${CMAKE_CURRENT_SOURCE_DIR}/ProjectInclude/include.cmake + -P ${CMAKE_CURRENT_BINARY_DIR}/Test.cmake + ) diff --git a/Tests/CMakeOnly/ProjectInclude/CMakeLists.txt b/Tests/CMakeOnly/ProjectInclude/CMakeLists.txt new file mode 100644 index 0000000..a9abb4a --- /dev/null +++ b/Tests/CMakeOnly/ProjectInclude/CMakeLists.txt @@ -0,0 +1,4 @@ +project(ProjectInclude) +if(NOT AUTO_INCLUDE) + message(FATAL_ERROR "include file not found") +endif() diff --git a/Tests/CMakeOnly/ProjectInclude/include.cmake b/Tests/CMakeOnly/ProjectInclude/include.cmake new file mode 100644 index 0000000..527ebe7 --- /dev/null +++ b/Tests/CMakeOnly/ProjectInclude/include.cmake @@ -0,0 +1 @@ +set(AUTO_INCLUDE TRUE) diff --git a/Tests/CMakeOnly/Test.cmake.in b/Tests/CMakeOnly/Test.cmake.in index aa2d093..42af068 100644 --- a/Tests/CMakeOnly/Test.cmake.in +++ b/Tests/CMakeOnly/Test.cmake.in @@ -3,7 +3,8 @@ set(binary_dir "@CMAKE_CURRENT_BINARY_DIR@/${TEST}-build") file(REMOVE_RECURSE "${binary_dir}") file(MAKE_DIRECTORY "${binary_dir}") execute_process( - COMMAND ${CMAKE_COMMAND} "${source_dir}" -G "@CMAKE_TEST_GENERATOR@" + COMMAND ${CMAKE_COMMAND} ${CMAKE_ARGS} + "${source_dir}" -G "@CMAKE_TEST_GENERATOR@" WORKING_DIRECTORY "${binary_dir}" RESULT_VARIABLE result ) |