diff options
author | Gregor Jasny <gjasny@googlemail.com> | 2017-03-27 18:54:22 (GMT) |
---|---|---|
committer | Gregor Jasny <gjasny@googlemail.com> | 2017-03-30 20:24:54 (GMT) |
commit | d02709d7f76624d9ec5e178d79cf3658d551f197 (patch) | |
tree | 373a020c19f19042402a05e67aa5f45ef20ba8c3 /Tests | |
parent | 013ffe76e7d67fdb05fe29c82421b0a000feb468 (diff) | |
download | CMake-d02709d7f76624d9ec5e178d79cf3658d551f197.zip CMake-d02709d7f76624d9ec5e178d79cf3658d551f197.tar.gz CMake-d02709d7f76624d9ec5e178d79cf3658d551f197.tar.bz2 |
Genex: Add `TARGET_BUNDLE_[CONTENT_]_DIR` generator expressions
Closes #16733
Diffstat (limited to 'Tests')
14 files changed, 86 insertions, 0 deletions
diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt new file mode 100644 index 0000000..854447f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake:[0-9]* \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_CONTENT_DIR:empty> + + TARGET_BUNDLE_CONTENT_DIR not allowed for IMPORTED targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake new file mode 100644 index 0000000..ac2d3ce --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_CONTENT_DIR.cmake @@ -0,0 +1,2 @@ +add_library(empty UNKNOWN IMPORTED) +add_custom_target(custom COMMAND echo $<TARGET_BUNDLE_CONTENT_DIR:empty>) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt new file mode 100644 index 0000000..9b97df1 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at ImportedTarget-TARGET_BUNDLE_DIR.cmake:[0-9]* \(add_custom_target\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_DIR:empty> + + TARGET_BUNDLE_DIR not allowed for IMPORTED targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake new file mode 100644 index 0000000..17c8128 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/ImportedTarget-TARGET_BUNDLE_DIR.cmake @@ -0,0 +1,2 @@ +add_library(empty UNKNOWN IMPORTED) +add_custom_target(custom COMMAND echo $<TARGET_BUNDLE_DIR:empty>) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt new file mode 100644 index 0000000..03c02d9 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake:[0-9]* \(file\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_CONTENT_DIR:empty> + + TARGET_BUNDLE_CONTENT_DIR is allowed only for Bundle targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake new file mode 100644 index 0000000..63b3b1b --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_CONTENT_DIR.cmake @@ -0,0 +1,9 @@ + +enable_language(C) + +add_library(empty STATIC empty.c) + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt" + CONTENT "[$<TARGET_BUNDLE_CONTENT_DIR:empty>]" +) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-result.txt @@ -0,0 +1 @@ +1 diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt new file mode 100644 index 0000000..f895c88 --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR-stderr.txt @@ -0,0 +1,8 @@ +CMake Error at NonValidTarget-TARGET_BUNDLE_DIR.cmake:[0-9]* \(file\): + Error evaluating generator expression: + + \$<TARGET_BUNDLE_DIR:empty> + + TARGET_BUNDLE_DIR is allowed only for Bundle targets. +Call Stack \(most recent call first\): + CMakeLists.txt:[0-9]* \(include\) diff --git a/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake new file mode 100644 index 0000000..19f333a --- /dev/null +++ b/Tests/RunCMake/GeneratorExpression/NonValidTarget-TARGET_BUNDLE_DIR.cmake @@ -0,0 +1,9 @@ + +enable_language(C) + +add_library(empty STATIC empty.c) + +file(GENERATE + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/test.txt" + CONTENT "[$<TARGET_BUNDLE_DIR:empty>]" +) diff --git a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake index 084b5c3..63cd2da 100644 --- a/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake +++ b/Tests/RunCMake/GeneratorExpression/RunCMakeTest.cmake @@ -17,6 +17,8 @@ run_cmake(NonValidTarget-C_COMPILER_ID) run_cmake(NonValidTarget-CXX_COMPILER_ID) run_cmake(NonValidTarget-C_COMPILER_VERSION) run_cmake(NonValidTarget-CXX_COMPILER_VERSION) +run_cmake(NonValidTarget-TARGET_BUNDLE_DIR) +run_cmake(NonValidTarget-TARGET_BUNDLE_CONTENT_DIR) run_cmake(NonValidTarget-TARGET_PROPERTY) run_cmake(NonValidTarget-TARGET_POLICY) run_cmake(COMPILE_LANGUAGE-add_custom_target) @@ -32,6 +34,8 @@ run_cmake(OUTPUT_NAME-recursion) run_cmake(TARGET_PROPERTY-LOCATION) run_cmake(LINK_ONLY-not-linking) +run_cmake(ImportedTarget-TARGET_BUNDLE_DIR) +run_cmake(ImportedTarget-TARGET_BUNDLE_CONTENT_DIR) run_cmake(ImportedTarget-TARGET_PDB_FILE) if(LINKER_SUPPORTS_PDB) run_cmake(NonValidTarget-TARGET_PDB_FILE) diff --git a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake index 833eb85..0b854d8 100644 --- a/Tests/RunCMake/XcodeProject/XcodeBundles.cmake +++ b/Tests/RunCMake/XcodeProject/XcodeBundles.cmake @@ -58,6 +58,10 @@ if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(SharedFrameworkTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:SharedFramework>" "$<TARGET_BUNDLE_DIR:SharedFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:SharedFramework>" "$<TARGET_BUNDLE_CONTENT_DIR:SharedFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:SharedFramework>" "$<TARGET_FILE:SharedFramework>.old") add_dependencies(SharedFrameworkTest SharedFramework) @@ -71,6 +75,10 @@ if(NOT TEST_IOS OR NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(SharedFrameworkExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:SharedFrameworkExt>" "$<TARGET_BUNDLE_DIR:SharedFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:SharedFrameworkExt>" "$<TARGET_BUNDLE_CONTENT_DIR:SharedFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:SharedFrameworkExt>" "$<TARGET_FILE:SharedFrameworkExt>.old") add_dependencies(SharedFrameworkExtTest SharedFrameworkExt) @@ -84,6 +92,10 @@ if(NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(StaticFrameworkTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:StaticFramework>" "$<TARGET_BUNDLE_DIR:StaticFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:StaticFramework>" "$<TARGET_BUNDLE_CONTENT_DIR:StaticFramework>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:StaticFramework>" "$<TARGET_FILE:StaticFramework>.old") add_dependencies(StaticFrameworkTest StaticFramework) @@ -97,6 +109,10 @@ if(NOT XCODE_VERSION VERSION_LESS 6) add_custom_target(StaticFrameworkExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:StaticFrameworkExt>" "$<TARGET_BUNDLE_DIR:StaticFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:StaticFrameworkExt>" "$<TARGET_BUNDLE_CONTENT_DIR:StaticFrameworkExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:StaticFrameworkExt>" "$<TARGET_FILE:StaticFrameworkExt>.old") add_dependencies(StaticFrameworkExtTest StaticFrameworkExt) @@ -110,6 +126,10 @@ if(NOT CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE) add_custom_target(BundleTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:Bundle>" "$<TARGET_BUNDLE_DIR:Bundle>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:Bundle>" "$<TARGET_BUNDLE_CONTENT_DIR:Bundle>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:Bundle>" "$<TARGET_FILE:Bundle>.old") add_dependencies(BundleTest Bundle) @@ -123,6 +143,10 @@ if(NOT CMAKE_XCODE_ATTRIBUTE_ENABLE_BITCODE) add_custom_target(BundleExtTest ALL COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_DIR:BundleExt>" "$<TARGET_BUNDLE_DIR:BundleExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy + "$<TARGET_BUNDLE_CONTENT_DIR:BundleExt>" "$<TARGET_BUNDLE_CONTENT_DIR:BundleExt>.old" + COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:BundleExt>" "$<TARGET_FILE:BundleExt>.old") add_dependencies(BundleExtTest BundleExt) |