diff options
author | Kyle Edwards <kyle.edwards@kitware.com> | 2018-10-03 15:49:18 (GMT) |
---|---|---|
committer | Kyle Edwards <kyle.edwards@kitware.com> | 2018-10-10 14:26:40 (GMT) |
commit | b56f2db87aebd34bfaf24439d56632aa3f3019f8 (patch) | |
tree | a0d473b712c59d6e4a9beb9f84bdea764db4e4b6 /Tests/RunCMake/add_subdirectory | |
parent | fc8955e8891c645cd369a3cc8b607a14a8ed5bd7 (diff) | |
download | CMake-b56f2db87aebd34bfaf24439d56632aa3f3019f8.zip CMake-b56f2db87aebd34bfaf24439d56632aa3f3019f8.tar.gz CMake-b56f2db87aebd34bfaf24439d56632aa3f3019f8.tar.bz2 |
Testing: Add test for CMP0082
Diffstat (limited to 'Tests/RunCMake/add_subdirectory')
35 files changed, 119 insertions, 2 deletions
diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt new file mode 100644 index 0000000..1bd7f49 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-ExcludeFromAll/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"exclude\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt new file mode 100644 index 0000000..7d76ed9 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- sub +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt new file mode 100644 index 0000000..35b0bb5 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- sub +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake new file mode 100644 index 0000000..56c1b81 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NEW.cmake @@ -0,0 +1,3 @@ +add_subdirectory(CMP0082) +add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt new file mode 100644 index 0000000..8f26c24 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/CMakeLists.txt @@ -0,0 +1 @@ +add_subdirectory(sub) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt new file mode 100644 index 0000000..91a8936 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-Nested/sub/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"sub\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt new file mode 100644 index 0000000..52a0665 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(sub) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt new file mode 100644 index 0000000..91a8936 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-NestedSub/sub/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"sub\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-None/CMakeLists.txt diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt new file mode 100644 index 0000000..4b39789 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt new file mode 100644 index 0000000..8f3a5f7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake new file mode 100644 index 0000000..56c1b81 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-OLD.cmake @@ -0,0 +1,3 @@ +add_subdirectory(CMP0082) +add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt new file mode 100644 index 0000000..4b39789 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt new file mode 100644 index 0000000..8f3a5f7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt new file mode 100644 index 0000000..3624c43 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested-stderr.txt @@ -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\. diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake new file mode 100644 index 0000000..df5688a --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-Nested.cmake @@ -0,0 +1,2 @@ +add_subdirectory(CMP0082-Nested) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt new file mode 100644 index 0000000..4b39789 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt new file mode 100644 index 0000000..8f3a5f7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt new file mode 100644 index 0000000..9362905 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub-stderr.txt @@ -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\. diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake new file mode 100644 index 0000000..88a0856 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NestedSub.cmake @@ -0,0 +1 @@ +add_subdirectory(CMP0082-NestedSub) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt new file mode 100644 index 0000000..f7a331d --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-component-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt new file mode 100644 index 0000000..6f22ae2 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall-install-stdout.txt @@ -0,0 +1,2 @@ +^-- Install configuration: "[^\n]*" +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake new file mode 100644 index 0000000..70bc9ed --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-NoTopInstall.cmake @@ -0,0 +1 @@ +add_subdirectory(CMP0082) diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt new file mode 100644 index 0000000..157ab37 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-component-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt new file mode 100644 index 0000000..9e15872 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None-install-stdout.txt @@ -0,0 +1,2 @@ +^-- Install configuration: "[^\n]*" +-- top$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake new file mode 100644 index 0000000..670f89b --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-None.cmake @@ -0,0 +1,2 @@ +add_subdirectory(CMP0082-None) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt new file mode 100644 index 0000000..4b39789 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-component-stdout.txt @@ -0,0 +1,4 @@ +^-- Install configuration: "[^\n]*" +-- Install component: "Unspecified" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt new file mode 100644 index 0000000..8f3a5f7 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-install-stdout.txt @@ -0,0 +1,3 @@ +^-- Install configuration: "[^\n]*" +-- top +-- sub$ diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt new file mode 100644 index 0000000..3624c43 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN-stderr.txt @@ -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\. diff --git a/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake new file mode 100644 index 0000000..56c1b81 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082-WARN.cmake @@ -0,0 +1,3 @@ +add_subdirectory(CMP0082) +add_subdirectory(CMP0082-ExcludeFromAll EXCLUDE_FROM_ALL) +install(CODE "message(STATUS \"top\")") diff --git a/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt new file mode 100644 index 0000000..91a8936 --- /dev/null +++ b/Tests/RunCMake/add_subdirectory/CMP0082/CMakeLists.txt @@ -0,0 +1 @@ +install(CODE "message(STATUS \"sub\")") diff --git a/Tests/RunCMake/add_subdirectory/CMakeLists.txt b/Tests/RunCMake/add_subdirectory/CMakeLists.txt index 18dfd26..47d249c 100644 --- a/Tests/RunCMake/add_subdirectory/CMakeLists.txt +++ b/Tests/RunCMake/add_subdirectory/CMakeLists.txt @@ -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) diff --git a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt index 369a956..0130581 100644 --- a/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt +++ b/Tests/RunCMake/add_subdirectory/DoesNotExist-stderr.txt @@ -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\)$ diff --git a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt index aba0675..dd83140 100644 --- a/Tests/RunCMake/add_subdirectory/Missing-stderr.txt +++ b/Tests/RunCMake/add_subdirectory/Missing-stderr.txt @@ -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\)$ diff --git a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake index 88b9283..343e65b 100644 --- a/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake +++ b/Tests/RunCMake/add_subdirectory/RunCMakeTest.cmake @@ -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) |