summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-10-19 19:20:53 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-11 13:24:21 (GMT)
commitc257c25419c68e755b0f8289d8d563437bf9e0c2 (patch)
tree20418dcf8153ad50a55a4f7a4c0bc14cdb9de22f /Tests
parentf36af9228b2ad36442f0cce9e8c8533fadef65aa (diff)
downloadCMake-c257c25419c68e755b0f8289d8d563437bf9e0c2.zip
CMake-c257c25419c68e755b0f8289d8d563437bf9e0c2.tar.gz
CMake-c257c25419c68e755b0f8289d8d563437bf9e0c2.tar.bz2
add_custom_{command,target}: Add genex support to OUTPUT and BYPRODUCTS
Move rejection of `#`, `<`, and `>` characters in outputs and byproducts to a generate-time check. This removes the front-end check that disallowed generator expressions. The generators have already been updated to handle them. Fixes: #12877
Diffstat (limited to 'Tests')
-rw-r--r--Tests/ConfigSources/CMakeLists.txt71
-rw-r--r--Tests/ConfigSources/custom1.cpp.in13
-rw-r--r--Tests/ConfigSources/custom2.cpp.in13
-rw-r--r--Tests/ConfigSources/custom3.cpp.in13
-rw-r--r--Tests/ConfigSources/custom4.cpp.in13
-rw-r--r--Tests/ConfigSources/custom5.cpp.in13
-rw-r--r--Tests/ConfigSources/main_debug.cpp9
-rw-r--r--Tests/ConfigSources/main_other.cpp9
-rw-r--r--Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake37
-rw-r--r--Tests/RunCMake/VS10Project/CustomCommandGenex.cmake21
-rw-r--r--Tests/RunCMake/VS10Project/RunCMakeTest.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt33
-rw-r--r--Tests/RunCMake/add_custom_command/BadByproduct.cmake1
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput-stderr.txt33
-rw-r--r--Tests/RunCMake/add_custom_command/BadOutput.cmake1
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt33
-rw-r--r--Tests/RunCMake/add_custom_target/BadByproduct.cmake1
17 files changed, 278 insertions, 37 deletions
diff --git a/Tests/ConfigSources/CMakeLists.txt b/Tests/ConfigSources/CMakeLists.txt
index 1db00cc..5513af8 100644
--- a/Tests/ConfigSources/CMakeLists.txt
+++ b/Tests/ConfigSources/CMakeLists.txt
@@ -16,6 +16,72 @@ void config_$<CONFIG>() {}
]]
)
+# Custom command outputs named with the configuration(s).
+add_custom_command(
+ OUTPUT "custom1_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom1.cpp.in" "custom1_$<CONFIG>.cpp"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom1.cpp.in
+ VERBATIM
+ )
+# Output path starts in a generator expression.
+add_custom_command(
+ OUTPUT "$<1:custom2_$<CONFIG>.cpp>"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom2.cpp.in" "custom2_$<CONFIG>.cpp"
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom2.cpp.in
+ VERBATIM
+ )
+# Source file generated as a custom command's byproduct.
+add_custom_command(
+ OUTPUT custom3.txt
+ BYPRODUCTS "$<1:custom3_$<CONFIG>.cpp>"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom3.cpp.in" "custom3_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E touch custom3.txt
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom3.cpp.in
+ VERBATIM
+ )
+# Source file generated as a custom target's byproduct.
+add_custom_target(custom4
+ BYPRODUCTS "custom4_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_CURRENT_SOURCE_DIR}/custom4.cpp.in" "custom4_$<CONFIG>.cpp"
+ VERBATIM
+ )
+# Source file generated by appended custom command.
+add_custom_command(
+ OUTPUT "custom5_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E echo custom5_$<CONFIG>.cpp
+ DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/custom5.cpp.in
+ VERBATIM
+ )
+add_custom_command(APPEND
+ OUTPUT "custom5_$<CONFIG>.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/custom5.cpp.in" "custom5_$<CONFIG>.cpp.in"
+ VERBATIM
+ )
+# Appending through any configuration's output affects all configurations.
+if(CMAKE_CONFIGURATION_TYPES MATCHES ";([^;]+)$")
+ set(last_config "${CMAKE_MATCH_1}")
+else()
+ set(last_config ${CMAKE_BUILD_TYPE})
+endif()
+add_custom_command(APPEND
+ OUTPUT "custom5_${last_config}.cpp"
+ COMMAND ${CMAKE_COMMAND} -E copy "custom5_$<CONFIG>.cpp.in" "custom5_$<CONFIG>.cpp"
+ VERBATIM
+ )
+foreach(n RANGE 1 5)
+ set_property(SOURCE custom${n}_Debug.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_DEBUG)
+ foreach(other Release RelWithDebInfo MinSizeRel)
+ set_property(SOURCE custom${n}_${other}.cpp PROPERTY COMPILE_DEFINITIONS CUSTOM_CFG_OTHER)
+ endforeach()
+endforeach()
+add_library(Custom STATIC
+ custom1_$<CONFIG>.cpp
+ custom2_$<CONFIG>.cpp
+ custom3_$<CONFIG>.cpp custom3.txt
+ custom4_$<CONFIG>.cpp
+ custom5_$<CONFIG>.cpp
+ )
+
# Per-config sources via INTERFACE_SOURCES.
add_library(iface INTERFACE)
target_sources(iface INTERFACE
@@ -34,7 +100,7 @@ add_executable(ConfigSources
$<$<CONFIG:NotAConfig>:does_not_exist.cpp>
${CMAKE_CURRENT_BINARY_DIR}/config_$<CONFIG>.cpp
)
-target_link_libraries(ConfigSources iface)
+target_link_libraries(ConfigSources Custom iface)
# Per-config sources via LINK_LIBRARIES.
add_library(iface_debug INTERFACE)
@@ -53,6 +119,7 @@ target_compile_definitions(ConfigSourcesLink PRIVATE
"$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
)
target_link_libraries(ConfigSourcesLink PRIVATE
+ Custom
"$<$<CONFIG:Debug>:iface_debug>"
"$<$<NOT:$<CONFIG:Debug>>:iface_other>"
"$<$<CONFIG:NotAConfig>:iface_does_not_exist>"
@@ -70,7 +137,7 @@ target_compile_definitions(ConfigSourcesLinkIface PRIVATE
"$<$<CONFIG:Debug>:CFG_DEBUG>"
"$<$<NOT:$<CONFIG:Debug>>:CFG_OTHER>"
)
-target_link_libraries(ConfigSourcesLinkIface ConfigSourcesIface)
+target_link_libraries(ConfigSourcesLinkIface Custom ConfigSourcesIface)
# A target with sources in only one configuration that is not the
# first in CMAKE_CONFIGURATION_TYPES.
diff --git a/Tests/ConfigSources/custom1.cpp.in b/Tests/ConfigSources/custom1.cpp.in
new file mode 100644
index 0000000..e5f21c7
--- /dev/null
+++ b/Tests/ConfigSources/custom1.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom1_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom1_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom2.cpp.in b/Tests/ConfigSources/custom2.cpp.in
new file mode 100644
index 0000000..438c1fd
--- /dev/null
+++ b/Tests/ConfigSources/custom2.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom2_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom2_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom3.cpp.in b/Tests/ConfigSources/custom3.cpp.in
new file mode 100644
index 0000000..4545b69
--- /dev/null
+++ b/Tests/ConfigSources/custom3.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom3_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom3_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom4.cpp.in b/Tests/ConfigSources/custom4.cpp.in
new file mode 100644
index 0000000..8a8b2a8
--- /dev/null
+++ b/Tests/ConfigSources/custom4.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom4_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom4_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/custom5.cpp.in b/Tests/ConfigSources/custom5.cpp.in
new file mode 100644
index 0000000..51f40ae
--- /dev/null
+++ b/Tests/ConfigSources/custom5.cpp.in
@@ -0,0 +1,13 @@
+#ifdef CUSTOM_CFG_DEBUG
+int custom5_debug()
+{
+ return 0;
+}
+#endif
+
+#ifdef CUSTOM_CFG_OTHER
+int custom5_other()
+{
+ return 0;
+}
+#endif
diff --git a/Tests/ConfigSources/main_debug.cpp b/Tests/ConfigSources/main_debug.cpp
index 9b1e68a..ef776f8 100644
--- a/Tests/ConfigSources/main_debug.cpp
+++ b/Tests/ConfigSources/main_debug.cpp
@@ -7,7 +7,14 @@
#include "iface.h"
+extern int custom1_debug();
+extern int custom2_debug();
+extern int custom3_debug();
+extern int custom4_debug();
+extern int custom5_debug();
+
int main(int argc, char** argv)
{
- return iface_src() + iface_debug();
+ return iface_src() + iface_debug() + custom1_debug() + custom2_debug() +
+ custom3_debug() + custom4_debug() + custom5_debug();
}
diff --git a/Tests/ConfigSources/main_other.cpp b/Tests/ConfigSources/main_other.cpp
index 3184a19..74f2156 100644
--- a/Tests/ConfigSources/main_other.cpp
+++ b/Tests/ConfigSources/main_other.cpp
@@ -7,7 +7,14 @@
#include "iface.h"
+extern int custom1_other();
+extern int custom2_other();
+extern int custom3_other();
+extern int custom4_other();
+extern int custom5_other();
+
int main(int argc, char** argv)
{
- return iface_src() + iface_other();
+ return iface_src() + iface_other() + custom1_other() + custom2_other() +
+ custom3_other() + custom4_other() + custom5_other();
}
diff --git a/Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake b/Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake
new file mode 100644
index 0000000..a7047bc
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CustomCommandGenex-check.cmake
@@ -0,0 +1,37 @@
+set(vcProjectFile "${RunCMake_TEST_BINARY_DIR}/foo.vcxproj")
+if(NOT EXISTS "${vcProjectFile}")
+ set(RunCMake_TEST_FAILED "Project file ${vcProjectFile} does not exist.")
+ return()
+endif()
+
+set(found_CustomBuild_out 0)
+set(found_CustomBuild_out_CONFIG 0)
+set(found_CustomBuild_out_CONFIG_CONFIG 0)
+set(found_CustomBuild_out_HASH 0)
+file(STRINGS "${vcProjectFile}" lines)
+foreach(line IN LISTS lines)
+ if(line MATCHES [[<CustomBuild Include=".*\\out\.txt\.rule">]])
+ set(found_CustomBuild_out 1)
+ endif()
+ if(line MATCHES [[<CustomBuild Include=".*\\out-\(CONFIG\)\.txt\.rule">]])
+ set(found_CustomBuild_out_CONFIG 1)
+ endif()
+ if(line MATCHES [[<CustomBuild Include=".*\\out-\(CONFIG\)-\(CONFIG\)\.txt\.rule">]])
+ set(found_CustomBuild_out_CONFIG_CONFIG 1)
+ endif()
+ if(line MATCHES [[<CustomBuild Include=".*\\[0-9A-Fa-f]+\.rule">]])
+ set(found_CustomBuild_out_HASH 1)
+ endif()
+endforeach()
+if(NOT found_CustomBuild_out)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for out.txt.rule not found in\n ${vcProjectFile}\n")
+endif()
+if(NOT found_CustomBuild_out_CONFIG)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for out-(CONFIG).txt.rule not found in\n ${vcProjectFile}\n")
+endif()
+if(NOT found_CustomBuild_out_CONFIG_CONFIG)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for out-(CONFIG)-(CONFIG).txt.rule not found in\n ${vcProjectFile}\n")
+endif()
+if(NOT found_CustomBuild_out_HASH)
+ string(APPEND RunCMake_TEST_FAILED "CustomBuild for <hash>.rule not found in\n ${vcProjectFile}\n")
+endif()
diff --git a/Tests/RunCMake/VS10Project/CustomCommandGenex.cmake b/Tests/RunCMake/VS10Project/CustomCommandGenex.cmake
new file mode 100644
index 0000000..5b69dc2
--- /dev/null
+++ b/Tests/RunCMake/VS10Project/CustomCommandGenex.cmake
@@ -0,0 +1,21 @@
+add_custom_command(
+ OUTPUT "$<1:out.txt>"
+ COMMAND ${CMAKE_COMMAND} -E touch "out.txt"
+ VERBATIM
+ )
+add_custom_command(
+ OUTPUT "out-$<CONFIG>.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "out-$<CONFIG>.txt"
+ VERBATIM
+ )
+add_custom_command(
+ OUTPUT "out-$<CONFIG>-$<CONFIG>.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "out-$<CONFIG>-$<CONFIG>.txt"
+ VERBATIM
+ )
+add_custom_command(
+ OUTPUT "out-$<CONFIG>-$<CONFIG:Debug>.txt"
+ COMMAND ${CMAKE_COMMAND} -E touch "out-$<CONFIG>-$<CONFIG:Debug>.txt"
+ VERBATIM
+ )
+add_custom_target(foo DEPENDS "out.txt" "out-$<CONFIG>.txt" "out-$<CONFIG>-$<CONFIG>.txt" "out-$<CONFIG>-$<CONFIG:Debug>.txt")
diff --git a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
index 133dacc..d5ed136 100644
--- a/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
+++ b/Tests/RunCMake/VS10Project/RunCMakeTest.cmake
@@ -7,6 +7,7 @@ if(CMAKE_C_COMPILER_ID STREQUAL "MSVC" AND CMAKE_C_COMPILER_VERSION VERSION_GREA
run_cmake(LanguageStandard)
endif()
+run_cmake(CustomCommandGenex)
run_cmake(VsCsharpSourceGroup)
run_cmake(VsCSharpCompilerOpts)
run_cmake(ExplicitCMakeLists)
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
index 086e397..6d51575 100644
--- a/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/BadByproduct-stderr.txt
@@ -1,36 +1,47 @@
CMake Error at BadByproduct.cmake:2 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a "#". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:3 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "<" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:4 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a ">". This character
- is not allowed.
+ BYPRODUCTS containing a ">" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+(
CMake Error at BadByproduct.cmake:5 \(add_custom_command\):
- add_custom_command called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+)+
CMake Error at BadByproduct.cmake:6 \(add_custom_command\):
- add_custom_command attempted to have a file
+ BYPRODUCTS path
.*RunCMake/add_custom_command/f
in a source directory as an output of custom command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+(
+CMake Error at BadByproduct.cmake:7 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:prop>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+
diff --git a/Tests/RunCMake/add_custom_command/BadByproduct.cmake b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
index 91bca52..7c786a4 100644
--- a/Tests/RunCMake/add_custom_command/BadByproduct.cmake
+++ b/Tests/RunCMake/add_custom_command/BadByproduct.cmake
@@ -4,3 +4,4 @@ add_custom_command(OUTPUT b BYPRODUCTS "a<")
add_custom_command(OUTPUT c BYPRODUCTS "a>")
add_custom_command(OUTPUT d BYPRODUCTS "$<CONFIG>/#")
add_custom_command(OUTPUT e BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/f)
+add_custom_command(OUTPUT f BYPRODUCTS "$<TARGET_PROPERTY:prop>")
diff --git a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
index 731e58d..506bec9 100644
--- a/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
+++ b/Tests/RunCMake/add_custom_command/BadOutput-stderr.txt
@@ -1,36 +1,47 @@
CMake Error at BadOutput.cmake:2 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "#". This character is
- not allowed.
+ OUTPUT containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadOutput.cmake:3 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "<". This character is
- not allowed.
+ OUTPUT containing a "<" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadOutput.cmake:4 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a ">". This character is
- not allowed.
+ OUTPUT containing a ">" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+(
CMake Error at BadOutput.cmake:5 \(add_custom_command\):
- add_custom_command called with OUTPUT containing a "<". This character is
- not allowed.
+ OUTPUT containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+)+
CMake Error at BadOutput.cmake:6 \(add_custom_command\):
- add_custom_command attempted to have a file
+ OUTPUT path
.*RunCMake/add_custom_command/e
in a source directory as an output of custom command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+(
+CMake Error at BadOutput.cmake:7 \(add_custom_command\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:prop>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+
diff --git a/Tests/RunCMake/add_custom_command/BadOutput.cmake b/Tests/RunCMake/add_custom_command/BadOutput.cmake
index 6875fe9..77acb7f 100644
--- a/Tests/RunCMake/add_custom_command/BadOutput.cmake
+++ b/Tests/RunCMake/add_custom_command/BadOutput.cmake
@@ -4,3 +4,4 @@ add_custom_command(OUTPUT "a<" COMMAND b)
add_custom_command(OUTPUT "a>" COMMAND c)
add_custom_command(OUTPUT "$<CONFIG>/#" COMMAND d)
add_custom_command(OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/e COMMAND f)
+add_custom_command(OUTPUT "$<TARGET_PROPERTY:prop>" COMMAND g)
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
index 0f58550..4f0f005 100644
--- a/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
+++ b/Tests/RunCMake/add_custom_target/BadByproduct-stderr.txt
@@ -1,36 +1,47 @@
CMake Error at BadByproduct.cmake:2 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a "#". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:3 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "<" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
CMake Error at BadByproduct.cmake:4 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a ">". This character
- is not allowed.
+ BYPRODUCTS containing a ">" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+(
CMake Error at BadByproduct.cmake:5 \(add_custom_target\):
- add_custom_target called with BYPRODUCTS containing a "<". This character
- is not allowed.
+ BYPRODUCTS containing a "#" is not allowed.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
-
+)+
CMake Error at BadByproduct.cmake:6 \(add_custom_target\):
- add_custom_target attempted to have a file
+ BYPRODUCTS path
.*RunCMake/add_custom_target/j
in a source directory as an output of custom command.
Call Stack \(most recent call first\):
CMakeLists.txt:3 \(include\)
+
+(
+CMake Error at BadByproduct.cmake:7 \(add_custom_target\):
+ Error evaluating generator expression:
+
+ \$<TARGET_PROPERTY:prop>
+
+ \$<TARGET_PROPERTY:prop> may only be used with binary targets. It may not
+ be used with add_custom_command or add_custom_target. Specify the target
+ to read a property from using the \$<TARGET_PROPERTY:tgt,prop> signature
+ instead.
+Call Stack \(most recent call first\):
+ CMakeLists.txt:3 \(include\)
+
+)+
diff --git a/Tests/RunCMake/add_custom_target/BadByproduct.cmake b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
index 963d641..e97f9fd 100644
--- a/Tests/RunCMake/add_custom_target/BadByproduct.cmake
+++ b/Tests/RunCMake/add_custom_target/BadByproduct.cmake
@@ -4,3 +4,4 @@ add_custom_target(c BYPRODUCTS "a<" COMMAND d)
add_custom_target(e BYPRODUCTS "a>" COMMAND f)
add_custom_target(g BYPRODUCTS "$<CONFIG>/#" COMMAND h)
add_custom_target(i BYPRODUCTS ${CMAKE_CURRENT_SOURCE_DIR}/j COMMAND k)
+add_custom_target(l BYPRODUCTS "$<TARGET_PROPERTY:prop>" COMMAND m)