summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/project
diff options
context:
space:
mode:
authorCraig Scott <craig.scott@crascit.com>2018-10-07 21:05:46 (GMT)
committerCraig Scott <craig.scott@crascit.com>2018-10-07 21:28:01 (GMT)
commitb27247c8df5c88193304149269ab0dbb0e8c35e4 (patch)
treeb1d65ce5a7f632c78ac6e7cf2a445d659d804e89 /Tests/RunCMake/project
parentfd02538974dd952a8639d371c2c0067d30d5469a (diff)
downloadCMake-b27247c8df5c88193304149269ab0dbb0e8c35e4.zip
CMake-b27247c8df5c88193304149269ab0dbb0e8c35e4.tar.gz
CMake-b27247c8df5c88193304149269ab0dbb0e8c35e4.tar.bz2
project(): Add tests verifying variables set by second project() call
Diffstat (limited to 'Tests/RunCMake/project')
-rw-r--r--Tests/RunCMake/project/ProjectTwice.cmake26
-rw-r--r--Tests/RunCMake/project/RunCMakeTest.cmake1
2 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/project/ProjectTwice.cmake b/Tests/RunCMake/project/ProjectTwice.cmake
new file mode 100644
index 0000000..d053834
--- /dev/null
+++ b/Tests/RunCMake/project/ProjectTwice.cmake
@@ -0,0 +1,26 @@
+cmake_policy(SET CMP0048 NEW)
+project(ProjectTwiceTestFirst
+ VERSION 1.2.3.4
+ DESCRIPTION "Test Project"
+ HOMEPAGE_URL "http://example.com"
+ LANGUAGES NONE
+)
+
+project(ProjectTwiceTestSecond LANGUAGES NONE)
+
+foreach(var
+ PROJECT_VERSION
+ PROJECT_VERSION_MAJOR
+ PROJECT_VERSION_MINOR
+ PROJECT_VERSION_PATCH
+ PROJECT_VERSION_TWEAK
+ PROJECT_DESCRIPTION
+ PROJECT_HOMEPAGE_URL
+)
+ if(${var})
+ message(SEND_ERROR "${var} set but should be empty")
+ endif()
+ if(CMAKE_${var})
+ message(SEND_ERROR "CMAKE_${var} set but should be empty")
+ endif()
+endforeach()
diff --git a/Tests/RunCMake/project/RunCMakeTest.cmake b/Tests/RunCMake/project/RunCMakeTest.cmake
index e9fb929..3a8ad4b 100644
--- a/Tests/RunCMake/project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/project/RunCMakeTest.cmake
@@ -15,6 +15,7 @@ run_cmake(ProjectDescriptionNoArg2)
run_cmake(ProjectHomepage)
run_cmake(ProjectHomepage2)
run_cmake(ProjectHomepageNoArg)
+run_cmake(ProjectTwice)
run_cmake(VersionAndLanguagesEmpty)
run_cmake(VersionEmpty)
run_cmake(VersionInvalid)