mirror of
https://github.com/Kitware/CMake.git
synced 2025-12-31 02:39:48 -06:00
Testing: Add test for CMP0082
This commit is contained in:
@@ -0,0 +1 @@
|
||||
install(CODE "message(STATUS \"exclude\")")
|
||||
@@ -0,0 +1,4 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- sub
|
||||
-- top$
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- sub
|
||||
-- top$
|
||||
3
Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake
Normal file
3
Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(CMP0082)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(sub)
|
||||
@@ -0,0 +1 @@
|
||||
install(CODE "message(STATUS \"sub\")")
|
||||
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(sub)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
@@ -0,0 +1 @@
|
||||
install(CODE "message(STATUS \"sub\")")
|
||||
@@ -0,0 +1,4 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- top
|
||||
-- sub$
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- top
|
||||
-- sub$
|
||||
3
Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake
Normal file
3
Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(CMP0082)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
@@ -0,0 +1,4 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- top
|
||||
-- sub$
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- top
|
||||
-- sub$
|
||||
@@ -0,0 +1,7 @@
|
||||
CMake Warning \(dev\) in CMakeLists\.txt:
|
||||
Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are
|
||||
interleaved with those in caller\. Run "cmake --help-policy CMP0082" for
|
||||
policy details\. Use the cmake_policy command to set the policy and
|
||||
suppress this warning\.
|
||||
|
||||
This warning is for project developers\. Use -Wno-dev to suppress it\.
|
||||
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(CMP0082-Nested)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
@@ -0,0 +1,4 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- top
|
||||
-- sub$
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- top
|
||||
-- sub$
|
||||
@@ -0,0 +1,7 @@
|
||||
CMake Warning \(dev\) in CMP0082-NestedSub/CMakeLists\.txt:
|
||||
Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are
|
||||
interleaved with those in caller\. Run "cmake --help-policy CMP0082" for
|
||||
policy details\. Use the cmake_policy command to set the policy and
|
||||
suppress this warning\.
|
||||
|
||||
This warning is for project developers\. Use -Wno-dev to suppress it\.
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(CMP0082-NestedSub)
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- sub$
|
||||
@@ -0,0 +1,2 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- sub$
|
||||
@@ -0,0 +1 @@
|
||||
add_subdirectory(CMP0082)
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- top$
|
||||
@@ -0,0 +1,2 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- top$
|
||||
2
Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake
Normal file
2
Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake
Normal file
@@ -0,0 +1,2 @@
|
||||
add_subdirectory(CMP0082-None)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
@@ -0,0 +1,4 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- Install component: "Unspecified"
|
||||
-- top
|
||||
-- sub$
|
||||
@@ -0,0 +1,3 @@
|
||||
^-- Install configuration: "[^\n]*"
|
||||
-- top
|
||||
-- sub$
|
||||
7
Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt
Normal file
7
Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt
Normal file
@@ -0,0 +1,7 @@
|
||||
CMake Warning \(dev\) in CMakeLists\.txt:
|
||||
Policy CMP0082 is not set: Install rules from add_subdirectory\(\) are
|
||||
interleaved with those in caller\. Run "cmake --help-policy CMP0082" for
|
||||
policy details\. Use the cmake_policy command to set the policy and
|
||||
suppress this warning\.
|
||||
|
||||
This warning is for project developers\. Use -Wno-dev to suppress it\.
|
||||
3
Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake
Normal file
3
Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake
Normal file
@@ -0,0 +1,3 @@
|
||||
add_subdirectory(CMP0082)
|
||||
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
|
||||
install(CODE "message(STATUS \"top\")")
|
||||
1
Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt
Normal file
1
Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt
Normal file
@@ -0,0 +1 @@
|
||||
install(CODE "message(STATUS \"sub\")")
|
||||
@@ -1,3 +1,10 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
|
||||
# Have to set policy here due to policy scope
|
||||
if(DEFINED CMP0082_VALUE)
|
||||
cmake_policy(SET CMP0082 "${CMP0082_VALUE}")
|
||||
endif()
|
||||
set(CMAKE_POLICY_WARNING_CMP0082 ON)
|
||||
|
||||
project(${RunCMake_TEST} NONE)
|
||||
include(${RunCMake_TEST}.cmake)
|
||||
|
||||
@@ -2,4 +2,4 @@
|
||||
add_subdirectory given source "DoesNotExist" which is not an existing
|
||||
directory.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
||||
CMakeLists\.txt:[0-9]+ \(include\)$
|
||||
|
||||
@@ -5,4 +5,4 @@
|
||||
|
||||
does not contain a CMakeLists.txt file.
|
||||
Call Stack \(most recent call first\):
|
||||
CMakeLists.txt:3 \(include\)$
|
||||
CMakeLists\.txt:[0-9]+ \(include\)$
|
||||
|
||||
@@ -4,6 +4,28 @@ run_cmake(DoesNotExist)
|
||||
run_cmake(Missing)
|
||||
run_cmake(Function)
|
||||
|
||||
macro(run_cmake_install case)
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/${case}-build)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
set(RunCMake_TEST_OPTIONS ${ARGN})
|
||||
|
||||
run_cmake(${case})
|
||||
run_cmake_command(${case}-install ${CMAKE_COMMAND} -P cmake_install.cmake)
|
||||
run_cmake_command(${case}-install-component ${CMAKE_COMMAND} -DCOMPONENT=Unspecified -P cmake_install.cmake)
|
||||
|
||||
unset(RunCMake_TEST_BINARY_DIR)
|
||||
unset(RunCMake_TEST_NO_CLEAN)
|
||||
unset(RunCMake_TEST_OPTIONS)
|
||||
endmacro()
|
||||
|
||||
run_cmake_install(CMP0082-WARN)
|
||||
run_cmake_install(CMP0082-WARN-Nested)
|
||||
run_cmake_install(CMP0082-WARN-NestedSub)
|
||||
run_cmake_install(CMP0082-WARN-None)
|
||||
run_cmake_install(CMP0082-WARN-NoTopInstall)
|
||||
run_cmake_install(CMP0082-OLD -DCMP0082_VALUE=OLD)
|
||||
run_cmake_install(CMP0082-NEW -DCMP0082_VALUE=NEW)
|
||||
|
||||
set(RunCMake_TEST_BINARY_DIR ${RunCMake_BINARY_DIR}/ExcludeFromAll-build)
|
||||
set(RunCMake_TEST_NO_CLEAN 1)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user