diff options
author | Deniz Bahadir <dbahadir@benocs.com> | 2020-09-18 12:48:33 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-09-22 11:35:02 (GMT) |
commit | bf114602daf09031ec7cf524758e95439bf21627 (patch) | |
tree | d62e27e79a5865fdeead8831cb986ab548df94d6 /Tests/ExportImport/Export | |
parent | 46bb6ae8d44e403f2fdd3ae6b074c74426ac20bb (diff) | |
download | CMake-bf114602daf09031ec7cf524758e95439bf21627.zip CMake-bf114602daf09031ec7cf524758e95439bf21627.tar.gz CMake-bf114602daf09031ec7cf524758e95439bf21627.tar.bz2 |
install(EXPORT): Fix exporting target w/ source named using CONFIG genex
Fixes: #21203
Diffstat (limited to 'Tests/ExportImport/Export')
-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() |