summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-10-08 15:26:16 (GMT)
committerKitware Robot <kwrobot@kitware.com>2018-10-08 15:26:21 (GMT)
commitc3e27c25625142aa1f1de36c454f00ee44df8dbd (patch)
tree324589a94e981dd7a0dd0ff0c49466375e695f9d /Tests
parentc76e024a3dee8933ff5b213149c295e2925b4860 (diff)
parentf8a086a86bd3f9301f04e5ad64b75fe960eee99a (diff)
downloadCMake-c3e27c25625142aa1f1de36c454f00ee44df8dbd.zip
CMake-c3e27c25625142aa1f1de36c454f00ee44df8dbd.tar.gz
CMake-c3e27c25625142aa1f1de36c454f00ee44df8dbd.tar.bz2
Merge topic 'project-always-set-desc-url'
f8a086a86b project(): Ensure DESCRIPTION and HOMEPAGE_URL variables are set b27247c8df project(): Add tests verifying variables set by second project() call Acked-by: Kitware Robot <kwrobot@kitware.com> Merge-request: !2457
Diffstat (limited to 'Tests')
-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)