diff options
Diffstat (limited to 'Tests/RunCMake')
70 files changed, 541 insertions, 41 deletions
diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt index aadc7d7..9d2c35b 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon-stderr.txt @@ -1,19 +1,35 @@ CMake Error at CMP0037-NEW-colon.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "lib:colon" is not valid for certain CMake features, such - as generator expressions, and may result in undefined behavior. + The target name "lib:colon" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-colon.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "exe:colon" is not valid for certain CMake features, such - as generator expressions, and may result in undefined behavior. + The target name "exe:colon" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at CMP0037-NEW-colon.cmake:6 \(add_custom_target\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "custom:colon" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake index 5c564f3..f4c070d 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-colon.cmake @@ -3,3 +3,4 @@ cmake_policy(SET CMP0037 NEW) add_library("lib:colon" empty.cpp) add_executable("exe:colon" empty.cpp) +add_custom_target("custom:colon") diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-result.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt new file mode 100644 index 0000000..13835af --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved-stderr.txt @@ -0,0 +1,33 @@ +CMake Error at CMP0037-NEW-reserved.cmake:4 \(add_library\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "all" is reserved or not valid for certain CMake features, + such as generator expressions, and may result in undefined behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at CMP0037-NEW-reserved.cmake:5 \(add_executable\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "clean" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at CMP0037-NEW-reserved.cmake:6 \(add_custom_target\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "help" is reserved or not valid for certain CMake features, + such as generator expressions, and may result in undefined behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake new file mode 100644 index 0000000..e9f6404 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-reserved.cmake @@ -0,0 +1,6 @@ + +cmake_policy(SET CMP0037 NEW) + +add_library(all empty.cpp) +add_executable(clean empty.cpp) +add_custom_target(help) diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt index 169db86..2525bcd 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space-stderr.txt @@ -1,19 +1,35 @@ CMake Error at CMP0037-NEW-space.cmake:4 \(add_library\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "lib with spaces" is not valid for certain CMake features, - such as generator expressions, and may result in undefined behavior. + The target name "lib with spaces" is reserved or not valid for certain + CMake features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) + CMake Error at CMP0037-NEW-space.cmake:5 \(add_executable\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "exe with spaces" is not valid for certain CMake features, - such as generator expressions, and may result in undefined behavior. + The target name "exe with spaces" is reserved or not valid for certain + CMake features, such as generator expressions, and may result in undefined + behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) ++ +CMake Error at CMP0037-NEW-space.cmake:6 \(add_custom_target\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "custom with spaces" is reserved or not valid for certain + CMake features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake b/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake index 9e2faaa..9227986 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake +++ b/Tests/RunCMake/CMP0037/CMP0037-NEW-space.cmake @@ -3,3 +3,4 @@ cmake_policy(SET CMP0037 NEW) add_library("lib with spaces" empty.cpp) add_executable("exe with spaces" empty.cpp) +add_custom_target("custom with spaces") diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-result.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved.cmake b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved.cmake new file mode 100644 index 0000000..870a286 --- /dev/null +++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-reserved.cmake @@ -0,0 +1,6 @@ + +cmake_policy(SET CMP0037 OLD) + +add_library(all empty.cpp) +add_executable(clean empty.cpp) +add_custom_target(help) diff --git a/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake b/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake index af98f12..46193a1 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake +++ b/Tests/RunCMake/CMP0037/CMP0037-OLD-space.cmake @@ -3,3 +3,4 @@ cmake_policy(SET CMP0037 OLD) add_library("lib with spaces" empty.cpp) add_executable("exe with spaces" empty.cpp) +add_custom_target("custom with spaces") diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt index c9366fa..d3b0e17 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon-stderr.txt @@ -1,21 +1,38 @@ CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:2 \(add_library\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "lib:colon" is not valid for certain CMake features, such - as generator expressions, and may result in undefined behavior. + The target name "lib:colon" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. + CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:3 \(add_executable\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "exe:colon" is not valid for certain CMake features, such - as generator expressions, and may result in undefined behavior. + The target name "exe:colon" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0037-WARN-colon.cmake:4 \(add_custom_target\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "custom:colon" is reserved or not valid for certain CMake + features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake index 17c815e..445e3b2 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake +++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-colon.cmake @@ -1,3 +1,4 @@ add_library("lib:colon" empty.cpp) add_executable("exe:colon" empty.cpp) +add_custom_target("custom:colon") diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt index b29aad5..e39477a 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt +++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-space-stderr.txt @@ -1,21 +1,37 @@ CMake Warning \(dev\) at CMP0037-WARN-space.cmake:2 \(add_library\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "lib with spaces" is not valid for certain CMake features, - such as generator expressions, and may result in undefined behavior. + The target name "lib with spaces" is reserved or not valid for certain + CMake features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. + CMake Warning \(dev\) at CMP0037-WARN-space.cmake:3 \(add_executable\): - Policy CMP0037 is not set: Target names should match a validity pattern. - Run "cmake --help-policy CMP0037" for policy details. Use the cmake_policy - command to set the policy and suppress this warning. + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. - The target name "exe with spaces" is not valid for certain CMake features, - such as generator expressions, and may result in undefined behavior. + The target name "exe with spaces" is reserved or not valid for certain + CMake features, such as generator expressions, and may result in undefined + behavior. Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) This warning is for project developers. Use -Wno-dev to suppress it. ++ +CMake Warning \(dev\) at CMP0037-WARN-space.cmake:4 \(add_custom_target\): + Policy CMP0037 is not set: Target names should not be reserved and should + match a validity pattern. Run "cmake --help-policy CMP0037" for policy + details. Use the cmake_policy command to set the policy and suppress this + warning. + + The target name "custom with spaces" is reserved or not valid for certain + CMake features, such as generator expressions, and may result in undefined + behavior. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake b/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake index 4a10828..e50a64d 100644 --- a/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake +++ b/Tests/RunCMake/CMP0037/CMP0037-WARN-space.cmake @@ -1,3 +1,4 @@ add_library("lib with spaces" empty.cpp) add_executable("exe with spaces" empty.cpp) +add_custom_target("custom with spaces") diff --git a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake index fbb1788..b7d8d7b 100644 --- a/Tests/RunCMake/CMP0037/RunCMakeTest.cmake +++ b/Tests/RunCMake/CMP0037/RunCMakeTest.cmake @@ -8,3 +8,6 @@ run_cmake(CMP0037-NEW-colon) if(NOT (WIN32 AND "${RunCMake_GENERATOR}" MATCHES "Make")) run_cmake(CMP0037-WARN-colon) endif() + +run_cmake(CMP0037-OLD-reserved) +run_cmake(CMP0037-NEW-reserved) diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake new file mode 100644 index 0000000..f9c8afd --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-existing-target.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0040 NEW) + +add_library(foobar empty.cpp) + +add_custom_command(TARGET foobar PRE_BUILD + COMMAND "${CMAKE_COMMAND} -E echo hello world" +) diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt new file mode 100644 index 0000000..03a0217 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target-stderr.txt @@ -0,0 +1,9 @@ +CMake Error at CMP0040-NEW-missing-target.cmake:3 \(add_custom_command\): + Policy CMP0040 is not set: The target in the TARGET signature of + add_custom_command\(\) must exist. Run "cmake --help-policy CMP0040" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. ++ + The target name "foobar" is unknown in this context. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake new file mode 100644 index 0000000..276863d --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-NEW-missing-target.cmake @@ -0,0 +1,5 @@ +cmake_policy(SET CMP0040 NEW) + +add_custom_command(TARGET foobar PRE_BUILD + COMMAND "${CMAKE_COMMAND} -E hello world" +) diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake new file mode 100644 index 0000000..d7ec50d --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-existing-target.cmake @@ -0,0 +1,7 @@ +cmake_policy(SET CMP0040 OLD) + +add_library(foobar empty.cpp) + +add_custom_command(TARGET foobar PRE_BUILD + COMMAND "${CMAKE_COMMAND} -E echo hello world" +) diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake new file mode 100644 index 0000000..ef7a0f7 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-OLD-missing-target.cmake @@ -0,0 +1,5 @@ +cmake_policy(SET CMP0040 OLD) + +add_custom_command(TARGET foobar PRE_BUILD + COMMAND "${CMAKE_COMMAND} -E echo hello world" +) diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt new file mode 100644 index 0000000..e791f0a --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\) at CMP0040-WARN-missing-target.cmake:2 \(add_custom_command\): + Policy CMP0040 is not set: The target in the TARGET signature of + add_custom_command\(\) must exist. Run "cmake --help-policy CMP0040" for + policy details. Use the cmake_policy command to set the policy and + suppress this warning. ++ + The target name "foobar" is unknown in this context. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake new file mode 100644 index 0000000..2c3e401 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMP0040-WARN-missing-target.cmake @@ -0,0 +1,4 @@ + +add_custom_command(TARGET foobar PRE_BUILD + COMMAND "${CMAKE_COMMAND} -E hello world" +) diff --git a/Tests/RunCMake/CMP0040/CMakeLists.txt b/Tests/RunCMake/CMP0040/CMakeLists.txt new file mode 100644 index 0000000..2f10cb0 --- /dev/null +++ b/Tests/RunCMake/CMP0040/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.12) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0040/RunCMakeTest.cmake b/Tests/RunCMake/CMP0040/RunCMakeTest.cmake new file mode 100644 index 0000000..13160e3 --- /dev/null +++ b/Tests/RunCMake/CMP0040/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(CMP0040-OLD-missing-target) +run_cmake(CMP0040-NEW-missing-target) +run_cmake(CMP0040-WARN-missing-target) + +run_cmake(CMP0040-OLD-existing-target) +run_cmake(CMP0040-NEW-existing-target) diff --git a/Tests/RunCMake/CMP0040/empty.cpp b/Tests/RunCMake/CMP0040/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0040/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt b/Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt new file mode 100644 index 0000000..2ec3aef --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-NEW-stderr.txt @@ -0,0 +1,20 @@ +CMake Error in CMakeLists.txt: + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains relative path: + + "include/\$<TARGET_PROPERTY:NAME>" + + +CMake Error in CMakeLists.txt: + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the source directory. + + +CMake Error in CMakeLists.txt: + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/CMP0041-NEW-build/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/CMP0041/CMP0041-NEW.cmake b/Tests/RunCMake/CMP0041/CMP0041-NEW.cmake new file mode 100644 index 0000000..605b79a --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-NEW.cmake @@ -0,0 +1,12 @@ + +cmake_policy(SET CMP0041 NEW) + +add_library(foo empty.cpp) +set_property(TARGET foo + PROPERTY INTERFACE_INCLUDE_DIRECTORIES + include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME> +) +install(TARGETS foo EXPORT FooExport DESTINATION lib) +install(EXPORT FooExport DESTINATION lib/cmake) diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake b/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake new file mode 100644 index 0000000..16cbced --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-OLD.cmake @@ -0,0 +1,12 @@ + +cmake_policy(SET CMP0041 OLD) + +add_library(foo empty.cpp) +set_property(TARGET foo + PROPERTY INTERFACE_INCLUDE_DIRECTORIES + include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME> +) +install(TARGETS foo EXPORT FooExport DESTINATION lib) +install(EXPORT FooExport DESTINATION lib/cmake) diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt b/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt new file mode 100644 index 0000000..a7d303e --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-WARN-stderr.txt @@ -0,0 +1,32 @@ +CMake Warning in CMakeLists.txt: + Policy CMP0041 is not set: Error on relative include with generator + expression. Run "cmake --help-policy CMP0041" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains relative path: + + "include/\$<TARGET_PROPERTY:NAME>" + + +CMake Warning in CMakeLists.txt: + Policy CMP0041 is not set: Error on relative include with generator + expression. Run "cmake --help-policy CMP0041" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the source directory. + + +CMake Warning in CMakeLists.txt: + Policy CMP0041 is not set: Error on relative include with generator + expression. Run "cmake --help-policy CMP0041" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/CMP0041-WARN-build/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake b/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake new file mode 100644 index 0000000..873cbc7 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-WARN.cmake @@ -0,0 +1,10 @@ + +add_library(foo empty.cpp) +set_property(TARGET foo + PROPERTY INTERFACE_INCLUDE_DIRECTORIES + include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME> +) +install(TARGETS foo EXPORT FooExport DESTINATION lib) +install(EXPORT FooExport DESTINATION lib/cmake) diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt new file mode 100644 index 0000000..9b0a214 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-stderr.txt @@ -0,0 +1,22 @@ +CMake Error in CMakeLists.txt: + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the source directory. + + +CMake Error in CMakeLists.txt: + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the source directory. + + +CMake Error in CMakeLists.txt: + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/CMP0041-tid-NEW-build/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake new file mode 100644 index 0000000..3005108 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-NEW.cmake @@ -0,0 +1,11 @@ + +cmake_policy(SET CMP0041 NEW) + +add_library(foo empty.cpp) +target_include_directories(foo INTERFACE + include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME> +) +install(TARGETS foo EXPORT FooExport DESTINATION lib) +install(EXPORT FooExport DESTINATION lib/cmake) diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake new file mode 100644 index 0000000..b5c4e7f --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-OLD.cmake @@ -0,0 +1,11 @@ + +cmake_policy(SET CMP0041 OLD) + +add_library(foo empty.cpp) +target_include_directories(foo INTERFACE + include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME> +) +install(TARGETS foo EXPORT FooExport DESTINATION lib) +install(EXPORT FooExport DESTINATION lib/cmake) diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt new file mode 100644 index 0000000..aae2c7a --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-stderr.txt @@ -0,0 +1,34 @@ +CMake Warning in CMakeLists.txt: + Policy CMP0041 is not set: Error on relative include with generator + expression. Run "cmake --help-policy CMP0041" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the source directory. + + +CMake Warning in CMakeLists.txt: + Policy CMP0041 is not set: Error on relative include with generator + expression. Run "cmake --help-policy CMP0041" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the source directory. + + +CMake Warning in CMakeLists.txt: + Policy CMP0041 is not set: Error on relative include with generator + expression. Run "cmake --help-policy CMP0041" for policy details. Use the + cmake_policy command to set the policy and suppress this warning. + + Target "foo" INTERFACE_INCLUDE_DIRECTORIES property contains path: + + ".*/Tests/RunCMake/CMP0041/CMP0041-tid-WARN-build/include/\$<TARGET_PROPERTY:NAME>" + + which is prefixed in the build directory. diff --git a/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake new file mode 100644 index 0000000..ee4c2a6 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMP0041-tid-WARN.cmake @@ -0,0 +1,9 @@ + +add_library(foo empty.cpp) +target_include_directories(foo INTERFACE + include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_SOURCE_DIR}/include/$<TARGET_PROPERTY:NAME> + ${CMAKE_CURRENT_BINARY_DIR}/include/$<TARGET_PROPERTY:NAME> +) +install(TARGETS foo EXPORT FooExport DESTINATION lib) +install(EXPORT FooExport DESTINATION lib/cmake) diff --git a/Tests/RunCMake/CMP0041/CMakeLists.txt b/Tests/RunCMake/CMP0041/CMakeLists.txt new file mode 100644 index 0000000..11ea636 --- /dev/null +++ b/Tests/RunCMake/CMP0041/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8) +project(${RunCMake_TEST} CXX) +include(${RunCMake_TEST}.cmake NO_POLICY_SCOPE) diff --git a/Tests/RunCMake/CMP0041/RunCMakeTest.cmake b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake new file mode 100644 index 0000000..a5e2114 --- /dev/null +++ b/Tests/RunCMake/CMP0041/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(CMP0041-OLD) +run_cmake(CMP0041-NEW) +run_cmake(CMP0041-WARN) +run_cmake(CMP0041-tid-OLD) +run_cmake(CMP0041-tid-NEW) +run_cmake(CMP0041-tid-WARN) diff --git a/Tests/RunCMake/CMP0041/empty.cpp b/Tests/RunCMake/CMP0041/empty.cpp new file mode 100644 index 0000000..bfbbdde --- /dev/null +++ b/Tests/RunCMake/CMP0041/empty.cpp @@ -0,0 +1,7 @@ +#ifdef _WIN32 +__declspec(dllexport) +#endif +int empty() +{ + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index bb1b909..593921f 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -59,6 +59,8 @@ add_RunCMake_test(CMP0028) add_RunCMake_test(CMP0037) add_RunCMake_test(CMP0038) add_RunCMake_test(CMP0039) +add_RunCMake_test(CMP0040) +add_RunCMake_test(CMP0041) add_RunCMake_test(CTest) if(UNIX AND "${CMAKE_TEST_GENERATOR}" MATCHES "Unix Makefiles") add_RunCMake_test(CompilerChange) @@ -97,6 +99,7 @@ add_RunCMake_test(Syntax) add_RunCMake_test(add_dependencies) add_RunCMake_test(build_command) +add_RunCMake_test(export) add_RunCMake_test(cmake_minimum_required) add_RunCMake_test(find_package) add_RunCMake_test(get_filename_component) diff --git a/Tests/RunCMake/export/CMakeLists.txt b/Tests/RunCMake/export/CMakeLists.txt new file mode 100644 index 0000000..be9d403 --- /dev/null +++ b/Tests/RunCMake/export/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 2.8.4) +project(${RunCMake_TEST}) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/export/RunCMakeTest.cmake b/Tests/RunCMake/export/RunCMakeTest.cmake new file mode 100644 index 0000000..b8d3f27 --- /dev/null +++ b/Tests/RunCMake/export/RunCMakeTest.cmake @@ -0,0 +1,3 @@ +include(RunCMake) + +run_cmake(TargetNotFound) diff --git a/Tests/RunCMake/export/TargetNotFound-result.txt b/Tests/RunCMake/export/TargetNotFound-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/export/TargetNotFound-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/export/TargetNotFound-stderr.txt b/Tests/RunCMake/export/TargetNotFound-stderr.txt new file mode 100644 index 0000000..944a68e --- /dev/null +++ b/Tests/RunCMake/export/TargetNotFound-stderr.txt @@ -0,0 +1,4 @@ +CMake Error at TargetNotFound.cmake:1 \(export\): + export given target "nonexistenttarget" which is not built by this project. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/export/TargetNotFound.cmake b/Tests/RunCMake/export/TargetNotFound.cmake new file mode 100644 index 0000000..a7c398d --- /dev/null +++ b/Tests/RunCMake/export/TargetNotFound.cmake @@ -0,0 +1 @@ +export(TARGETS nonexistenttarget FILE somefile.cmake) diff --git a/Tests/RunCMake/include_directories/CMakeLists.txt b/Tests/RunCMake/include_directories/CMakeLists.txt index 12cd3c7..f452db1 100644 --- a/Tests/RunCMake/include_directories/CMakeLists.txt +++ b/Tests/RunCMake/include_directories/CMakeLists.txt @@ -1,3 +1,3 @@ cmake_minimum_required(VERSION 2.8.4) -project(${RunCMake_TEST} NONE) +project(${RunCMake_TEST} CXX) include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/include_directories/RunCMakeTest.cmake b/Tests/RunCMake/include_directories/RunCMakeTest.cmake index f66823e..c00b924 100644 --- a/Tests/RunCMake/include_directories/RunCMakeTest.cmake +++ b/Tests/RunCMake/include_directories/RunCMakeTest.cmake @@ -11,3 +11,4 @@ run_cmake(RelativePathInGenex) run_cmake(CMP0021) run_cmake(install_config) run_cmake(incomplete-genex) +run_cmake(export-NOWARN) diff --git a/Tests/RunCMake/include_directories/export-NOWARN-result.txt b/Tests/RunCMake/include_directories/export-NOWARN-result.txt new file mode 100644 index 0000000..573541a --- /dev/null +++ b/Tests/RunCMake/include_directories/export-NOWARN-result.txt @@ -0,0 +1 @@ +0 diff --git a/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt b/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt new file mode 100644 index 0000000..10f3293 --- /dev/null +++ b/Tests/RunCMake/include_directories/export-NOWARN-stderr.txt @@ -0,0 +1 @@ +^$ diff --git a/Tests/RunCMake/include_directories/export-NOWARN.cmake b/Tests/RunCMake/include_directories/export-NOWARN.cmake new file mode 100644 index 0000000..307ce5a --- /dev/null +++ b/Tests/RunCMake/include_directories/export-NOWARN.cmake @@ -0,0 +1,62 @@ + +add_library(foo empty.cpp) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<0:>/include/subdir) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_PREFIX>/include/subdir) + +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<INSTALL_PREFIX>/include/subdir>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/subdir>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:include/$<0:>>) +set_property(TARGET foo APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES $<INSTALL_INTERFACE:$<0:>/include>) + +# target_include_directories(foo INTERFACE include/subdir) # Does and should warn. INSTALL_INTERFACE must not list src dir paths. +target_include_directories(foo INTERFACE $<0:>/include/subdir) # Does not and should not should warn, because it starts with a genex. +target_include_directories(foo INTERFACE $<INSTALL_PREFIX>/include/subdir) + +target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/subdir>) +target_include_directories(foo INTERFACE $<INSTALL_INTERFACE:include/$<0:>>) + +install(TARGETS foo EXPORT FooTargets DESTINATION lib) +install(EXPORT FooTargets DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets2 + DESTINATION lib + INCLUDES DESTINATION include # No warning. Implicit install prefix. +) +install(EXPORT FooTargets2 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets3 + DESTINATION lib + INCLUDES DESTINATION $<INSTALL_PREFIX>include +) +install(EXPORT FooTargets3 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets4 + DESTINATION lib + INCLUDES DESTINATION $<INSTALL_INTERFACE:include> +) +install(EXPORT FooTargets4 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets5 + DESTINATION lib + # The $<0:> is evaluated at export time, leaving 'include' behind, which should be treated as above. + INCLUDES DESTINATION $<INSTALL_INTERFACE:$<0:>include> +) +install(EXPORT FooTargets5 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets6 + DESTINATION lib + INCLUDES DESTINATION $<INSTALL_INTERFACE:include$<0:>> +) +install(EXPORT FooTargets6 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets7 + DESTINATION lib + INCLUDES DESTINATION include$<0:> +) +install(EXPORT FooTargets7 DESTINATION lib/cmake) + +install(TARGETS foo EXPORT FooTargets8 + DESTINATION lib + INCLUDES DESTINATION $<0:>include +) +install(EXPORT FooTargets8 DESTINATION lib/cmake) diff --git a/Tests/RunCMake/interface_library/RunCMakeTest.cmake b/Tests/RunCMake/interface_library/RunCMakeTest.cmake index 7375888..e257fb3 100644 --- a/Tests/RunCMake/interface_library/RunCMakeTest.cmake +++ b/Tests/RunCMake/interface_library/RunCMakeTest.cmake @@ -3,3 +3,4 @@ include(RunCMake) run_cmake(invalid_name) run_cmake(target_commands) run_cmake(no_shared_libs) +run_cmake(whitelist) diff --git a/Tests/RunCMake/interface_library/whitelist-result.txt b/Tests/RunCMake/interface_library/whitelist-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/interface_library/whitelist-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/interface_library/whitelist-stderr.txt b/Tests/RunCMake/interface_library/whitelist-stderr.txt new file mode 100644 index 0000000..577c0cc --- /dev/null +++ b/Tests/RunCMake/interface_library/whitelist-stderr.txt @@ -0,0 +1,19 @@ +CMake Error at whitelist.cmake:4 \(set_property\): + INTERFACE_LIBRARY targets may only have whitelisted properties. The + property "OUTPUT_NAME" is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at whitelist.cmake:5 \(set_property\): + INTERFACE_LIBRARY targets may only have whitelisted properties. The + property "OUTPUT_NAME" is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) + + +CMake Error at whitelist.cmake:6 \(get_target_property\): + INTERFACE_LIBRARY targets may only have whitelisted properties. The + property "OUTPUT_NAME" is not allowed. +Call Stack \(most recent call first\): + CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/interface_library/whitelist.cmake b/Tests/RunCMake/interface_library/whitelist.cmake new file mode 100644 index 0000000..98ef05c --- /dev/null +++ b/Tests/RunCMake/interface_library/whitelist.cmake @@ -0,0 +1,6 @@ + +add_library(iface INTERFACE) + +set_property(TARGET iface PROPERTY OUTPUT_NAME output) +set_property(TARGET iface APPEND PROPERTY OUTPUT_NAME append) +get_target_property(outname iface OUTPUT_NAME) |