diff options
author | Brad King <brad.king@kitware.com> | 2018-07-24 17:05:22 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-07-24 17:14:09 (GMT) |
commit | 08eb157c032487b2793e625c554caae33267116d (patch) | |
tree | 3cc78ca08a9206a2de89785b47c68e37fde0b404 /Tests/RunCMake/project_injected | |
parent | f84c15ef2fa30dd074fcccafccec6b9b69266619 (diff) | |
download | CMake-08eb157c032487b2793e625c554caae33267116d.zip CMake-08eb157c032487b2793e625c554caae33267116d.tar.gz CMake-08eb157c032487b2793e625c554caae33267116d.tar.bz2 |
Tests: Add case showing CMP0048 warning on injected project command
Issue: #18202
Diffstat (limited to 'Tests/RunCMake/project_injected')
4 files changed, 27 insertions, 0 deletions
diff --git a/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt b/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt new file mode 100644 index 0000000..aafa733 --- /dev/null +++ b/Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt @@ -0,0 +1,12 @@ +^CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0048 is not set: project\(\) command manages VERSION variables. + Run "cmake --help-policy CMP0048" for policy details. Use the cmake_policy + command to set the policy and suppress this warning. + + The following variable\(s\) would be set to empty: + + CMAKE_PROJECT_VERSION + CMAKE_PROJECT_VERSION_MAJOR + CMAKE_PROJECT_VERSION_MINOR + CMAKE_PROJECT_VERSION_PATCH +This warning is for project developers. Use -Wno-dev to suppress it.$ 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) |