mirror of
https://github.com/Kitware/CMake.git
synced 2026-01-09 07:11:05 -06:00
Tests: Add case showing CMP0048 warning on injected project command
Issue: #18202
This commit is contained in:
@@ -240,6 +240,7 @@ add_RunCMake_test(include_guard)
|
||||
add_RunCMake_test(list)
|
||||
add_RunCMake_test(message)
|
||||
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)
|
||||
|
||||
12
Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt
Normal file
12
Tests/RunCMake/project_injected/CMP0048-WARN-stderr.txt
Normal file
@@ -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.$
|
||||
0
Tests/RunCMake/project_injected/CMP0048-WARN.cmake
Normal file
0
Tests/RunCMake/project_injected/CMP0048-WARN.cmake
Normal file
3
Tests/RunCMake/project_injected/CMakeLists.txt
Normal file
3
Tests/RunCMake/project_injected/CMakeLists.txt
Normal file
@@ -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)
|
||||
12
Tests/RunCMake/project_injected/RunCMakeTest.cmake
Normal file
12
Tests/RunCMake/project_injected/RunCMakeTest.cmake
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user