Commit b56f2db8 authored by Kyle Edwards's avatar Kyle Edwards

Testing: Add test for CMP0082

parent fc8955e8
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- sub
-- top$
^-- Install configuration: "[^\n]*"
-- sub
-- top$
add_subdirectory(CMP0082)
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
install(CODE "message(STATUS \"top\")")
add_subdirectory(sub)
install(CODE "message(STATUS \"top\")")
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- top
-- sub$
^-- Install configuration: "[^\n]*"
-- top
-- sub$
add_subdirectory(CMP0082)
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
install(CODE "message(STATUS \"top\")")
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- top
-- sub$
^-- Install configuration: "[^\n]*"
-- top
-- sub$
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\.
add_subdirectory(CMP0082-Nested)
install(CODE "message(STATUS \"top\")")
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- top
-- sub$
^-- Install configuration: "[^\n]*"
-- top
-- sub$
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\.
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- sub$
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- top$
add_subdirectory(CMP0082-None)
install(CODE "message(STATUS \"top\")")
^-- Install configuration: "[^\n]*"
-- Install component: "Unspecified"
-- top
-- sub$
^-- Install configuration: "[^\n]*"
-- top
-- sub$
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\.
add_subdirectory(CMP0082)
add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL)
install(CODE "message(STATUS \"top\")")
install(CODE "message(STATUS \"sub\")")
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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment