summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-07-25 12:14:53 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-07-25 12:15:02 (GMT)
commitae2b12a95c346d710459657c3cce967bd590f678 (patch)
tree3de1c84bc081b56611e575181372c2170d9aac53 /Tests
parent873f40ecec50fbe6c8e98a0764c02a423dbfa05b (diff)
parent6646771b0f4f6ec71a5717a68f74c987eb399b4e (diff)
downloadCMake-ae2b12a95c346d710459657c3cce967bd590f678.zip
CMake-ae2b12a95c346d710459657c3cce967bd590f678.tar.gz
CMake-ae2b12a95c346d710459657c3cce967bd590f678.tar.bz2
Merge topic 'project-injected-no-cmp0048'
6646771b0f project: Do not issue CMP0048 warnings on injected call 08eb157c03 Tests: Add case showing CMP0048 warning on injected project command Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2235
Diffstat (limited to 'Tests')
-rw-r--r--Tests/RunCMake/CMakeLists.txt1
-rw-r--r--Tests/RunCMake/project_injected/CMP0048-WARN.cmake0
-rw-r--r--Tests/RunCMake/project_injected/CMakeLists.txt3
-rw-r--r--Tests/RunCMake/project_injected/RunCMakeTest.cmake12
4 files changed, 16 insertions, 0 deletions
diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt
index 97c3178..c030cda 100644
--- a/Tests/RunCMake/CMakeLists.txt
+++ b/Tests/RunCMake/CMakeLists.txt
@@ -242,6 +242,7 @@ add_RunCMake_test(math)
add_RunCMake_test(message)
add_RunCMake_test(option)
add_RunCMake_test(project -DCMake_TEST_RESOURCES=${CMake_TEST_RESOURCES})
+add_RunCMake_test(project_injected)
add_RunCMake_test(return)
add_RunCMake_test(separate_arguments)
add_RunCMake_test(set_property)
diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN.cmake b/Tests/RunCMake/project_injected/CMP0048-WARN.cmake
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/Tests/RunCMake/project_injected/CMP0048-WARN.cmake
diff --git a/Tests/RunCMake/project_injected/CMakeLists.txt b/Tests/RunCMake/project_injected/CMakeLists.txt
new file mode 100644
index 0000000..1b4931b
--- /dev/null
+++ b/Tests/RunCMake/project_injected/CMakeLists.txt
@@ -0,0 +1,3 @@
+cmake_minimum_required(VERSION 2.8.12.2) # old enough to not set CMP0048
+# no project(${RunCMake_TEST} NONE)
+include(${RunCMake_TEST}.cmake)
diff --git a/Tests/RunCMake/project_injected/RunCMakeTest.cmake b/Tests/RunCMake/project_injected/RunCMakeTest.cmake
new file mode 100644
index 0000000..ba1a003
--- /dev/null
+++ b/Tests/RunCMake/project_injected/RunCMakeTest.cmake
@@ -0,0 +1,12 @@
+include(RunCMake)
+
+set(RunCMake_TEST_OPTIONS
+ # Simulate a previous CMake run that used `project(... VERSION ...)`
+ # in a non-injected call site.
+ -DCMAKE_PROJECT_VERSION:STATIC=1.2.3
+ -DCMAKE_PROJECT_VERSION_MAJOR:STATIC=1
+ -DCMAKE_PROJECT_VERSION_MINOR:STATIC=2
+ -DCMAKE_PROJECT_VERSION_PATCH:STATIC=3
+ )
+run_cmake(CMP0048-WARN)
+unset(RunCMake_TEST_OPTIONS)