diff options
author | Robert Maynard <robert.maynard@kitware.com> | 2019-04-03 18:42:35 (GMT) |
---|---|---|
committer | Robert Maynard <robert.maynard@kitware.com> | 2019-04-19 17:52:50 (GMT) |
commit | ce078dda79df1c8d9f142e45d2fa3cf971a09594 (patch) | |
tree | ea3941cabdb1df8f5dbefc29223f9f2bfc1e8d8d /Tests/RunCMake/File_Generate | |
parent | 3e129d71bc12a325c0548aaaea24470cd172470b (diff) | |
download | CMake-ce078dda79df1c8d9f142e45d2fa3cf971a09594.zip CMake-ce078dda79df1c8d9f142e45d2fa3cf971a09594.tar.gz CMake-ce078dda79df1c8d9f142e45d2fa3cf971a09594.tar.bz2 |
Relax the usage of TARGET_OBJECTS generator expression
The geneator expression can now be used with static, shared, and
module libraries and executables.
Diffstat (limited to 'Tests/RunCMake/File_Generate')
-rw-r--r-- | Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt | 3 | ||||
-rw-r--r-- | Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake | 7 |
2 files changed, 4 insertions, 6 deletions
diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt index b08ef5a..4c2e35f 100644 --- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects-stderr.txt @@ -3,6 +3,7 @@ CMake Error at OutputNameMatchesObjects.cmake:[0-9]+ \(file\): \$<TARGET_OBJECTS:foo> - Objects of target "foo" referenced but is not an OBJECT library. + Objects of target "foo" referenced but is not an allowed library types + \(EXECUTABLE, STATIC, SHARED, MODULE, OBJECT\). Call Stack \(most recent call first\): CMakeLists.txt:[0-9]+ \(include\) diff --git a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake index daa7c49..84825fe 100644 --- a/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake +++ b/Tests/RunCMake/File_Generate/OutputNameMatchesObjects.cmake @@ -1,11 +1,8 @@ enable_language(CXX) file(GENERATE - OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<BOOL:$<TARGET_OBJECTS:foo>>somefile.cpp" + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/$<LOWER_CASE:$<CONFIG>/somefile.cpp" CONTENT "static const char content[] = \"$<TARGET_OBJECTS:foo>\";\n" ) -add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/input.txt" - COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_SOURCE_DIR}/input.txt" "${CMAKE_CURRENT_BINARY_DIR}") - -add_executable(foo empty.cpp "${CMAKE_CURRENT_BINARY_DIR}/1somefile.cpp" "${CMAKE_CURRENT_BINARY_DIR}/input.txt") +add_library(foo INTERFACE ) |