diff options
Diffstat (limited to 'Tests')
47 files changed, 174 insertions, 91 deletions
diff --git a/Tests/CMakeLists.txt b/Tests/CMakeLists.txt index fff04ce7aa..dc65a2eed7 100644 --- a/Tests/CMakeLists.txt +++ b/Tests/CMakeLists.txt @@ -1365,6 +1365,8 @@ ${CMake_BINARY_DIR}/bin/cmake -DDIR=dev -P ${CMake_SOURCE_DIR}/Utilities/Release add_subdirectory(FindOpenSSL) endif() + add_subdirectory(FindThreads) + # Matlab module if(CMake_TEST_FindMatlab) ADD_TEST_MACRO(FindMatlab.basic_checks ${CMAKE_CTEST_COMMAND} -C $<CONFIGURATION>) diff --git a/Tests/CTestCoverageCollectGCOV/test.cmake.in b/Tests/CTestCoverageCollectGCOV/test.cmake.in index 29f7e7f1a0..b2e6d6dfec 100644 --- a/Tests/CTestCoverageCollectGCOV/test.cmake.in +++ b/Tests/CTestCoverageCollectGCOV/test.cmake.in @@ -12,9 +12,9 @@ ctest_build() ctest_test() list(APPEND CTEST_CUSTOM_COVERAGE_EXCLUDE - "/foo/something" - "/3rdparty/" - "/bar/somethingelse" + "/foo/something" + "/3rdparty/" + "/bar/somethingelse" ) include(CTestCoverageCollectGCOV) diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 2b9e8442cb..a3f1f81c86 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -29,14 +29,14 @@ add_custom_command(TARGET testLib1 POST_BUILD $<TARGET_FILE:testLib1>.genex ) install(FILES $<TARGET_FILE:testLib1>.genex - DESTINATION lib + DESTINATION $<1:lib>$<0:/wrong> ) set_property(TARGET testLib1 PROPERTY MY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/testLib1file1.txt ${CMAKE_CURRENT_SOURCE_DIR}/testLib1file2.txt ) install(FILES $<TARGET_PROPERTY:testLib1,MY_FILES> - DESTINATION doc + DESTINATION $<1:doc>$<0:/wrong> ) # Test library with empty link interface. Link it to an implementation @@ -551,5 +551,5 @@ install( ARCHIVE DESTINATION lib INCLUDES DESTINATION include/abs ) -install(DIRECTORY include/abs DESTINATION include) +install(DIRECTORY include/abs DESTINATION $<1:include>$<0:/wrong>) install(EXPORT expAbs NAMESPACE expAbs_ DESTINATION ${CMAKE_INSTALL_PREFIX}/lib/expAbs) diff --git a/Tests/FindThreads/C-only/CMakeLists.txt b/Tests/FindThreads/C-only/CMakeLists.txt new file mode 100644 index 0000000000..ab4ca0dddf --- /dev/null +++ b/Tests/FindThreads/C-only/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +project(FindThreads_C-only C) + +set(CMAKE_THREAD_PREFER_PTHREAD On) +find_package(Threads REQUIRED) + +if (NOT WIN32) + add_executable(thr ${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c) + target_link_libraries(thr Threads::Threads) +endif () diff --git a/Tests/FindThreads/CMakeLists.txt b/Tests/FindThreads/CMakeLists.txt new file mode 100644 index 0000000000..aa9499bd80 --- /dev/null +++ b/Tests/FindThreads/CMakeLists.txt @@ -0,0 +1,11 @@ +foreach (_lang IN ITEMS C CXX) + add_test(NAME FindThreads.${_lang}-only COMMAND ${CMAKE_CTEST_COMMAND} + --build-and-test + "${CMake_SOURCE_DIR}/Tests/FindThreads/${_lang}-only" + "${CMake_BINARY_DIR}/Tests/FindThreads/${_lang}-only" + ${build_generator_args} + --build-project FindThreads_${_lang}-only + --build-options ${build_options} + --test-command ${CMAKE_CTEST_COMMAND} -V + ) +endforeach () diff --git a/Tests/FindThreads/CXX-only/CMakeLists.txt b/Tests/FindThreads/CXX-only/CMakeLists.txt new file mode 100644 index 0000000000..999312322c --- /dev/null +++ b/Tests/FindThreads/CXX-only/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required(VERSION 3.3 FATAL_ERROR) +project(FindThreads_CXX-only CXX) + +set(CMAKE_THREAD_PREFER_PTHREAD On) +find_package(Threads REQUIRED) + +configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../../../Modules/CheckForPthreads.c + ${CMAKE_CURRENT_BINARY_DIR}/CheckForPthreads.cxx) + +if (NOT WIN32) + add_executable(thr ${CMAKE_CURRENT_BINARY_DIR}/CheckForPthreads.cxx) + target_link_libraries(thr Threads::Threads) +endif () diff --git a/Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt b/Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt new file mode 100644 index 0000000000..71f1ab7722 --- /dev/null +++ b/Tests/RunCMake/CMP0064/CMP0064-WARN-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\) at CMP0064-WARN.cmake:3 \(if\): + Policy CMP0064 is not set: Support new TEST if\(\) operator. Run "cmake + --help-policy CMP0064" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. + + TEST will be interpreted as an operator when the policy is set to NEW. + Since the policy is not set the OLD behavior will be used. +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/CMP0064/CMP0064-WARN.cmake b/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake index bffd3f3620..8f26ec62b5 100644 --- a/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake +++ b/Tests/RunCMake/CMP0064/CMP0064-WARN.cmake @@ -1,4 +1,4 @@ -cmake_policy(SET CMP0064 OLD) + if(TEST) message(FATAL_ERROR "TEST was not recognized to be undefined") diff --git a/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake b/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake new file mode 100644 index 0000000000..9339e4667a --- /dev/null +++ b/Tests/RunCMake/CMP0065/BuildTargetInSubProject.cmake @@ -0,0 +1,15 @@ +function(BuildTargetInSubProject P T E) + try_compile(RESULTVAR + ${CMAKE_CURRENT_BINARY_DIR}/subproject + ${CMAKE_CURRENT_SOURCE_DIR}/subproject + ${P} ${T} OUTPUT_VARIABLE O) + if(E AND RESULTVAR) + message(STATUS "${P} target ${T} succeeded as expected") + elseif(E AND NOT RESULTVAR) + message(FATAL_ERROR "${P} target ${T} failed but should have succeeded. Output:${O}") + elseif(NOT E AND NOT RESULTVAR) + message(STATUS "${P} target ${T} failed as expected") + elseif(NOT E AND RESULTVAR) + message(FATAL_ERROR "${P} target ${T} succeeded but should have failed. Output:${O}") + endif() +endfunction() diff --git a/Tests/RunCMake/CMP0065/CMakeLists.txt b/Tests/RunCMake/CMP0065/CMakeLists.txt new file mode 100644 index 0000000000..74b3ff8de3 --- /dev/null +++ b/Tests/RunCMake/CMP0065/CMakeLists.txt @@ -0,0 +1,3 @@ +cmake_minimum_required(VERSION 3.3) +project(${RunCMake_TEST} NONE) +include(${RunCMake_TEST}.cmake) diff --git a/Tests/RunCMake/CMP0065/NEWBad.cmake b/Tests/RunCMake/CMP0065/NEWBad.cmake new file mode 100644 index 0000000000..79d9adb73f --- /dev/null +++ b/Tests/RunCMake/CMP0065/NEWBad.cmake @@ -0,0 +1,4 @@ +enable_language(C) +include(BuildTargetInSubProject.cmake) + +BuildTargetInSubProject(TestPolicyCMP0065 FooNEWBad FALSE) diff --git a/Tests/RunCMake/CMP0065/NEWGood.cmake b/Tests/RunCMake/CMP0065/NEWGood.cmake new file mode 100644 index 0000000000..a5b5d04423 --- /dev/null +++ b/Tests/RunCMake/CMP0065/NEWGood.cmake @@ -0,0 +1,4 @@ +enable_language(C) +include(BuildTargetInSubProject.cmake) + +BuildTargetInSubProject(TestPolicyCMP0065 FooNEWGood TRUE) diff --git a/Tests/RunCMake/CMP0065/OLDBad1.cmake b/Tests/RunCMake/CMP0065/OLDBad1.cmake new file mode 100644 index 0000000000..6d780b4a2f --- /dev/null +++ b/Tests/RunCMake/CMP0065/OLDBad1.cmake @@ -0,0 +1,4 @@ +enable_language(C) +include(BuildTargetInSubProject.cmake) + +BuildTargetInSubProject(TestPolicyCMP0065 FooOLDBad1 FALSE) diff --git a/Tests/RunCMake/CMP0065/OLDBad2.cmake b/Tests/RunCMake/CMP0065/OLDBad2.cmake new file mode 100644 index 0000000000..7196473e18 --- /dev/null +++ b/Tests/RunCMake/CMP0065/OLDBad2.cmake @@ -0,0 +1,4 @@ +enable_language(C) +include(BuildTargetInSubProject.cmake) + +BuildTargetInSubProject(TestPolicyCMP0065 FooOLDBad2 FALSE) diff --git a/Tests/RunCMake/CMP0065/RunCMakeTest.cmake b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake new file mode 100644 index 0000000000..254a4ec022 --- /dev/null +++ b/Tests/RunCMake/CMP0065/RunCMakeTest.cmake @@ -0,0 +1,8 @@ +include(RunCMake) + +run_cmake(OLDBad1) +run_cmake(OLDBad2) +run_cmake(NEWBad) +run_cmake(NEWGood) +run_cmake(WARN-OFF) +run_cmake(WARN-ON) diff --git a/Tests/RunCMake/CMP0065/WARN-OFF.cmake b/Tests/RunCMake/CMP0065/WARN-OFF.cmake new file mode 100644 index 0000000000..dbc9562373 --- /dev/null +++ b/Tests/RunCMake/CMP0065/WARN-OFF.cmake @@ -0,0 +1,3 @@ + +enable_language(C) +add_executable(main subproject/main.c) diff --git a/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt b/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt new file mode 100644 index 0000000000..dda4fe5dea --- /dev/null +++ b/Tests/RunCMake/CMP0065/WARN-ON-stderr.txt @@ -0,0 +1,10 @@ +CMake Warning \(dev\) in CMakeLists.txt: + Policy CMP0065 is not set: Do not add flags to export symbols from + executables without the ENABLE_EXPORTS target property. Run "cmake + --help-policy CMP0065" for policy details. Use the cmake_policy command to + set the policy and suppress this warning. + + For compatibility with older versions of CMake, additional flags may be + added to export symbols on all executables regardless of thier + ENABLE_EXPORTS property. +This warning is for project developers. Use -Wno-dev to suppress it. diff --git a/Tests/RunCMake/CMP0065/WARN-ON.cmake b/Tests/RunCMake/CMP0065/WARN-ON.cmake new file mode 100644 index 0000000000..6ed4a41440 --- /dev/null +++ b/Tests/RunCMake/CMP0065/WARN-ON.cmake @@ -0,0 +1,3 @@ +set(CMAKE_POLICY_WARNING_CMP0065 1) +enable_language(C) +add_executable(main subproject/main.c) diff --git a/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt new file mode 100644 index 0000000000..bed59601ce --- /dev/null +++ b/Tests/RunCMake/CMP0065/subproject/CMakeLists.txt @@ -0,0 +1,22 @@ +cmake_minimum_required(VERSION 3.3) + +project(TestPolicyCMP0065 C) +set(CMAKE_SHARED_LIBRARY_LINK_C_FLAGS BADFLAGS) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 OLD) +add_executable(FooOLDBad1 main.c) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 OLD) +add_executable(FooOLDBad2 main.c) +set_target_properties(FooOLDBad2 PROPERTIES ENABLE_EXPORTS ON) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 NEW) +add_executable(FooNEWGood main.c) + +#---------------------------------------------------------------------- +cmake_policy(SET CMP0065 NEW) +add_executable(FooNEWBad main.c) +set_target_properties(FooNEWBad PROPERTIES ENABLE_EXPORTS ON) diff --git a/Tests/RunCMake/CMP0065/subproject/main.c b/Tests/RunCMake/CMP0065/subproject/main.c new file mode 100644 index 0000000000..98725db500 --- /dev/null +++ b/Tests/RunCMake/CMP0065/subproject/main.c @@ -0,0 +1,7 @@ +#include <stdio.h> + +int main(int argc, char **argv) +{ + printf("Hello World\n"); + return 0; +} diff --git a/Tests/RunCMake/CMakeLists.txt b/Tests/RunCMake/CMakeLists.txt index a8f93863e4..f11d20c6c6 100644 --- a/Tests/RunCMake/CMakeLists.txt +++ b/Tests/RunCMake/CMakeLists.txt @@ -104,6 +104,13 @@ add_RunCMake_test(CMP0057) add_RunCMake_test(CMP0059) add_RunCMake_test(CMP0060) add_RunCMake_test(CMP0064) + +# The test for Policy 65 requires the use of the +# CMAKE_SHARED_LIBRARY_LINK_CXX_FLAGS variable, which both the VS and Xcode +# generators ignore. The policy will have no effect on those generators. +if(NOT CMAKE_GENERATOR MATCHES "Visual Studio|Xcode") + add_RunCMake_test(CMP0065) +endif() if(CMAKE_GENERATOR MATCHES "Make") add_RunCMake_test(Make) endif() diff --git a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake index 0da737da40..cef6368526 100644 --- a/Tests/RunCMake/CommandLine/RunCMakeTest.cmake +++ b/Tests/RunCMake/CommandLine/RunCMakeTest.cmake @@ -132,52 +132,6 @@ set(RunCMake_TEST_OPTIONS -Wno-dev -Wdev) run_cmake(Wdev) unset(RunCMake_TEST_OPTIONS) -set(RunCMake_TEST_OPTIONS -Werror=dev) -run_cmake(Werror_dev) -unset(RunCMake_TEST_OPTIONS) - -set(RunCMake_TEST_OPTIONS -Wno-error=dev) -run_cmake(Wno-error_deprecated) -unset(RunCMake_TEST_OPTIONS) - -# -Wdev should not override deprecated options if specified -set(RunCMake_TEST_OPTIONS -Wdev -Wno-deprecated) -run_cmake(Wno-deprecated) -unset(RunCMake_TEST_OPTIONS) -set(RunCMake_TEST_OPTIONS -Wno-deprecated -Wdev) -run_cmake(Wno-deprecated) -unset(RunCMake_TEST_OPTIONS) - -# -Wdev should enable deprecated warnings as well -set(RunCMake_TEST_OPTIONS -Wdev) -run_cmake(Wdeprecated) -unset(RunCMake_TEST_OPTIONS) - -# -Werror=dev should enable deprecated errors as well -set(RunCMake_TEST_OPTIONS -Werror=dev) -run_cmake(Werror_deprecated) -unset(RunCMake_TEST_OPTIONS) - -set(RunCMake_TEST_OPTIONS -Wdeprecated) -run_cmake(Wdeprecated) -unset(RunCMake_TEST_OPTIONS) - -set(RunCMake_TEST_OPTIONS -Wno-deprecated) -run_cmake(Wno-deprecated) -unset(RunCMake_TEST_OPTIONS) - -set(RunCMake_TEST_OPTIONS -Werror=deprecated) -run_cmake(Werror_deprecated) -unset(RunCMake_TEST_OPTIONS) - -set(RunCMake_TEST_OPTIONS -Wno-error=deprecated) -run_cmake(Wno-error_deprecated) -unset(RunCMake_TEST_OPTIONS) - -run_cmake_command(W_bad-arg1 ${CMAKE_COMMAND} -W) -run_cmake_command(W_bad-arg2 ${CMAKE_COMMAND} -Wno-) -run_cmake_command(W_bad-arg3 ${CMAKE_COMMAND} -Werror=) - set(RunCMake_TEST_OPTIONS --debug-output) run_cmake(debug-output) unset(RunCMake_TEST_OPTIONS) diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt deleted file mode 100644 index e912728b9a..0000000000 --- a/Tests/RunCMake/CommandLine/W_bad-arg1-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error: -W must be followed with \[no-\]\[error=\]<name>. -CMake Error: Problem processing arguments. Aborting. diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt deleted file mode 100644 index cc643df95a..0000000000 --- a/Tests/RunCMake/CommandLine/W_bad-arg2-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error: No warning name provided. -CMake Error: Problem processing arguments. Aborting. diff --git a/Tests/RunCMake/CommandLine/W_bad-arg3-result.txt b/Tests/RunCMake/CommandLine/W_bad-arg3-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CommandLine/W_bad-arg3-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt b/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt deleted file mode 100644 index cc643df95a..0000000000 --- a/Tests/RunCMake/CommandLine/W_bad-arg3-stderr.txt +++ /dev/null @@ -1,2 +0,0 @@ -CMake Error: No warning name provided. -CMake Error: Problem processing arguments. Aborting. diff --git a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt b/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt deleted file mode 100644 index e9be1dcb30..0000000000 --- a/Tests/RunCMake/CommandLine/Wdeprecated-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Deprecation Warning at Wdeprecated.cmake:1 \(message\): - Some deprecated warning -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CommandLine/Wdeprecated.cmake b/Tests/RunCMake/CommandLine/Wdeprecated.cmake deleted file mode 100644 index 3142b42dca..0000000000 --- a/Tests/RunCMake/CommandLine/Wdeprecated.cmake +++ /dev/null @@ -1 +0,0 @@ -message(DEPRECATION "Some deprecated warning") diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated-result.txt b/Tests/RunCMake/CommandLine/Werror_deprecated-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CommandLine/Werror_deprecated-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt b/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt deleted file mode 100644 index 6acdc73621..0000000000 --- a/Tests/RunCMake/CommandLine/Werror_deprecated-stderr.txt +++ /dev/null @@ -1,4 +0,0 @@ -^CMake Deprecation Error at Werror_deprecated.cmake:1 \(message\): - Some deprecated warning -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CommandLine/Werror_deprecated.cmake b/Tests/RunCMake/CommandLine/Werror_deprecated.cmake deleted file mode 100644 index 3142b42dca..0000000000 --- a/Tests/RunCMake/CommandLine/Werror_deprecated.cmake +++ /dev/null @@ -1 +0,0 @@ -message(DEPRECATION "Some deprecated warning") diff --git a/Tests/RunCMake/CommandLine/Werror_dev-result.txt b/Tests/RunCMake/CommandLine/Werror_dev-result.txt deleted file mode 100644 index d00491fd7e..0000000000 --- a/Tests/RunCMake/CommandLine/Werror_dev-result.txt +++ /dev/null @@ -1 +0,0 @@ -1 diff --git a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt b/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt deleted file mode 100644 index c6b4e745ce..0000000000 --- a/Tests/RunCMake/CommandLine/Werror_dev-stderr.txt +++ /dev/null @@ -1,5 +0,0 @@ -^CMake Error \(dev\) at Werror_dev.cmake:1 \(message\): - Some author warning -Call Stack \(most recent call first\): - CMakeLists.txt:3 \(include\) -This error is for project developers. Use -Wno-error=dev to suppress it.$ diff --git a/Tests/RunCMake/CommandLine/Werror_dev.cmake b/Tests/RunCMake/CommandLine/Werror_dev.cmake deleted file mode 100644 index e05cf9da8b..0000000000 --- a/Tests/RunCMake/CommandLine/Werror_dev.cmake +++ /dev/null @@ -1 +0,0 @@ -message(AUTHOR_WARNING "Some author warning") diff --git a/Tests/RunCMake/CommandLine/Wno-deprecated.cmake b/Tests/RunCMake/CommandLine/Wno-deprecated.cmake deleted file mode 100644 index 3142b42dca..0000000000 --- a/Tests/RunCMake/CommandLine/Wno-deprecated.cmake +++ /dev/null @@ -1 +0,0 @@ -message(DEPRECATION "Some deprecated warning") diff --git a/Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake b/Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake deleted file mode 100644 index 3142b42dca..0000000000 --- a/Tests/RunCMake/CommandLine/Wno-error_deprecated.cmake +++ /dev/null @@ -1 +0,0 @@ -message(DEPRECATION "Some deprecated warning") diff --git a/Tests/RunCMake/CommandLine/Wno-error_dev.cmake b/Tests/RunCMake/CommandLine/Wno-error_dev.cmake deleted file mode 100644 index e05cf9da8b..0000000000 --- a/Tests/RunCMake/CommandLine/Wno-error_dev.cmake +++ /dev/null @@ -1 +0,0 @@ -message(AUTHOR_WARNING "Some author warning") diff --git a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt index d0aa995b6f..57047fb413 100644 --- a/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt +++ b/Tests/RunCMake/TargetPolicies/PolicyList-stderr.txt @@ -19,6 +19,7 @@ \* CMP0052 \* CMP0060 \* CMP0063 + \* CMP0065 Call Stack \(most recent call first\): CMakeLists.txt:3 \(include\) diff --git a/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-result.txt index d00491fd7e..d00491fd7e 100644 --- a/Tests/RunCMake/CommandLine/W_bad-arg1-result.txt +++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-result.txt diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt new file mode 100644 index 0000000000..9844158689 --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<NOTAGENEX> + + Expression did not evaluate to a known generator expression diff --git a/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake new file mode 100644 index 0000000000..f050cdfd7d --- /dev/null +++ b/Tests/RunCMake/install/DIRECTORY-DESTINATION-bad.cmake @@ -0,0 +1 @@ +install(DIRECTORY dir DESTINATION $<NOTAGENEX>) diff --git a/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt b/Tests/RunCMake/install/FILES-DESTINATION-bad-result.txt index d00491fd7e..d00491fd7e 100644 --- a/Tests/RunCMake/CommandLine/W_bad-arg2-result.txt +++ b/Tests/RunCMake/install/FILES-DESTINATION-bad-result.txt diff --git a/Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt b/Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt new file mode 100644 index 0000000000..9844158689 --- /dev/null +++ b/Tests/RunCMake/install/FILES-DESTINATION-bad-stderr.txt @@ -0,0 +1,6 @@ +CMake Error: + Error evaluating generator expression: + + \$<NOTAGENEX> + + Expression did not evaluate to a known generator expression diff --git a/Tests/RunCMake/install/FILES-DESTINATION-bad.cmake b/Tests/RunCMake/install/FILES-DESTINATION-bad.cmake new file mode 100644 index 0000000000..0fda078db6 --- /dev/null +++ b/Tests/RunCMake/install/FILES-DESTINATION-bad.cmake @@ -0,0 +1 @@ +install(FILES empty.c DESTINATION $<NOTAGENEX>) diff --git a/Tests/RunCMake/install/RunCMakeTest.cmake b/Tests/RunCMake/install/RunCMakeTest.cmake index a5f5bd0ecd..043bd1ff37 100644 --- a/Tests/RunCMake/install/RunCMakeTest.cmake +++ b/Tests/RunCMake/install/RunCMakeTest.cmake @@ -6,6 +6,8 @@ run_cmake(DIRECTORY-message-lazy) run_cmake(SkipInstallRulesWarning) run_cmake(SkipInstallRulesNoWarning1) run_cmake(SkipInstallRulesNoWarning2) +run_cmake(DIRECTORY-DESTINATION-bad) +run_cmake(FILES-DESTINATION-bad) run_cmake(TARGETS-DESTINATION-bad) run_cmake(CMP0062-OLD) run_cmake(CMP0062-NEW) diff --git a/Tests/SimpleInstall/CMakeLists.txt b/Tests/SimpleInstall/CMakeLists.txt index cc3c3be61d..e365076c0b 100644 --- a/Tests/SimpleInstall/CMakeLists.txt +++ b/Tests/SimpleInstall/CMakeLists.txt @@ -209,9 +209,9 @@ else() ARCHIVE DESTINATION MyTest/lib/static OPTIONAL # for coverage...target should always exist ) - install(FILES lib1.h DESTINATION MyTest/include/foo) + install(FILES lib1.h DESTINATION MyTest/include/$<1:foo>$<0:/wrong>) install(FILES lib2.h - DESTINATION MyTest/include/foo + DESTINATION $<1:MyTest/include/foo>$<0:/wrong> COMPONENT Development PERMISSIONS OWNER_READ OWNER_WRITE RENAME lib2renamed.h @@ -252,7 +252,7 @@ else() file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") install( - DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share + DIRECTORY TestSubDir scripts/ DESTINATION $<1:MyTest/share>$<0:/wrong> FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE @@ -263,14 +263,14 @@ else() # Alternate directory installation for coverage. install( - DIRECTORY scripts/ DESTINATION MyTest/share/alt + DIRECTORY scripts/ DESTINATION $<1:MyTest/share/alt>$<0:/wrong> COMPONENT Development USE_SOURCE_PERMISSIONS PATTERN "CVS" EXCLUDE REGEX "\\.txt$" EXCLUDE ) install( - DIRECTORY TestSubDir DESTINATION MyTest/share/alt + DIRECTORY TestSubDir DESTINATION $<1:MyTest/share/alt>$<0:/wrong> FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE diff --git a/Tests/SimpleInstallS2/CMakeLists.txt b/Tests/SimpleInstallS2/CMakeLists.txt index cc3c3be61d..e365076c0b 100644 --- a/Tests/SimpleInstallS2/CMakeLists.txt +++ b/Tests/SimpleInstallS2/CMakeLists.txt @@ -209,9 +209,9 @@ else() ARCHIVE DESTINATION MyTest/lib/static OPTIONAL # for coverage...target should always exist ) - install(FILES lib1.h DESTINATION MyTest/include/foo) + install(FILES lib1.h DESTINATION MyTest/include/$<1:foo>$<0:/wrong>) install(FILES lib2.h - DESTINATION MyTest/include/foo + DESTINATION $<1:MyTest/include/foo>$<0:/wrong> COMPONENT Development PERMISSIONS OWNER_READ OWNER_WRITE RENAME lib2renamed.h @@ -252,7 +252,7 @@ else() file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/CVS") file(REMOVE_RECURSE "${CMAKE_INSTALL_PREFIX}/MyTest/share/TestSubDir/CVS") install( - DIRECTORY TestSubDir scripts/ DESTINATION MyTest/share + DIRECTORY TestSubDir scripts/ DESTINATION $<1:MyTest/share>$<0:/wrong> FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE @@ -263,14 +263,14 @@ else() # Alternate directory installation for coverage. install( - DIRECTORY scripts/ DESTINATION MyTest/share/alt + DIRECTORY scripts/ DESTINATION $<1:MyTest/share/alt>$<0:/wrong> COMPONENT Development USE_SOURCE_PERMISSIONS PATTERN "CVS" EXCLUDE REGEX "\\.txt$" EXCLUDE ) install( - DIRECTORY TestSubDir DESTINATION MyTest/share/alt + DIRECTORY TestSubDir DESTINATION $<1:MyTest/share/alt>$<0:/wrong> FILE_PERMISSIONS OWNER_READ OWNER_WRITE DIRECTORY_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE |