diff options
author | Brad King <brad.king@kitware.com> | 2020-09-23 15:57:43 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2020-09-23 15:58:02 (GMT) |
commit | 869d6c82a0c4e55948ef183c43480dce1ff8dfa9 (patch) | |
tree | 6596b5414986c315647ecd1114474ee0d002544f /Tests | |
parent | 226f6bc61568543e1a35035b6fae6f949196ef8a (diff) | |
parent | bf114602daf09031ec7cf524758e95439bf21627 (diff) | |
download | CMake-869d6c82a0c4e55948ef183c43480dce1ff8dfa9.zip CMake-869d6c82a0c4e55948ef183c43480dce1ff8dfa9.tar.gz CMake-869d6c82a0c4e55948ef183c43480dce1ff8dfa9.tar.bz2 |
Merge topic 'install-EXPORT-source-CONFIG'
bf114602da install(EXPORT): Fix exporting target w/ source named using CONFIG genex
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !5240
Diffstat (limited to 'Tests')
-rw-r--r-- | Tests/ExportImport/Export/CMakeLists.txt | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Tests/ExportImport/Export/CMakeLists.txt b/Tests/ExportImport/Export/CMakeLists.txt index 387fe6b..6d9b4ab 100644 --- a/Tests/ExportImport/Export/CMakeLists.txt +++ b/Tests/ExportImport/Export/CMakeLists.txt @@ -669,3 +669,18 @@ endif() # IMPORTED_LINK_INTERFACE_LANGUAGES entries should not be targets. add_library(C INTERFACE) add_library(CXX INTERFACE) + +#------------------------------------------------------------------------------ +# test export of targets built from sources named using $<CONFIG> generator-expression +# FIXME: Enable test on Xcode generator when it supports per-config sources. +if(NOT XCODE) + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/Generated_$<CONFIG>.cpp" CONTENT "// content") + add_library(testStaticFromGeneratedSource STATIC) + target_sources(testStaticFromGeneratedSource PRIVATE "${CMAKE_CURRENT_BINARY_DIR}/Generated_$<CONFIG>.cpp") + + add_library(testLibFromGeneratedSource SHARED empty.cpp) + target_link_libraries(testLibFromGeneratedSource PRIVATE testStaticFromGeneratedSource) + + install(TARGETS testLibFromGeneratedSource EXPORT testLibFromGeneratedSource_Export) + install(EXPORT testLibFromGeneratedSource_Export DESTINATION lib) +endif() |