From ebd77d51524742886d3f7930357aeb8aaab1474a Mon Sep 17 00:00:00 2001 From: Zephyr Lykos Date: Sat, 14 Oct 2023 08:05:01 +0800 Subject: [PATCH] Export static targets in a separate file --- CMakeLists.txt | 5 +++++ TdConfig.cmake | 3 +++ sqlite/CMakeLists.txt | 2 +- tdactor/CMakeLists.txt | 2 +- tddb/CMakeLists.txt | 2 +- tdnet/CMakeLists.txt | 2 +- tdutils/CMakeLists.txt | 2 +- 7 files changed, 13 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d01833865..cfc751958 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1127,6 +1127,11 @@ install(EXPORT TdTargets NAMESPACE Td:: DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Td" ) +install(EXPORT TdStaticTargets + FILE TdStaticTargets.cmake + NAMESPACE Td:: + DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/Td" +) # Install tdjson/tdjson_static: install(FILES ${TD_JSON_HEADERS} "${CMAKE_CURRENT_BINARY_DIR}/td/telegram/tdjson_export.h" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/td/telegram") diff --git a/TdConfig.cmake b/TdConfig.cmake index 3cdff38c2..b3f9efdd7 100644 --- a/TdConfig.cmake +++ b/TdConfig.cmake @@ -1,3 +1,6 @@ include(CMakeFindDependencyMacro) #TODO: write all external dependencies include("${CMAKE_CURRENT_LIST_DIR}/TdTargets.cmake") +if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/TdStaticTargets.cmake") + include("${CMAKE_CURRENT_LIST_DIR}/TdStaticTargets.cmake") +endif() diff --git a/sqlite/CMakeLists.txt b/sqlite/CMakeLists.txt index cc698b2be..82ceb04c8 100644 --- a/sqlite/CMakeLists.txt +++ b/sqlite/CMakeLists.txt @@ -70,7 +70,7 @@ elseif (MSVC) target_compile_options(tdsqlite PRIVATE /wd4996) endif() -install(TARGETS tdsqlite EXPORT TdTargets +install(TARGETS tdsqlite EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) diff --git a/tdactor/CMakeLists.txt b/tdactor/CMakeLists.txt index a156384ce..cf316b2f7 100644 --- a/tdactor/CMakeLists.txt +++ b/tdactor/CMakeLists.txt @@ -56,7 +56,7 @@ if (NOT CMAKE_CROSSCOMPILING) target_link_libraries(example PRIVATE tdactor) endif() -install(TARGETS tdactor EXPORT TdTargets +install(TARGETS tdactor EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) diff --git a/tddb/CMakeLists.txt b/tddb/CMakeLists.txt index 036f0ca61..04325f56e 100644 --- a/tddb/CMakeLists.txt +++ b/tddb/CMakeLists.txt @@ -56,7 +56,7 @@ if (NOT CMAKE_CROSSCOMPILING) target_link_libraries(binlog_dump PRIVATE tddb) endif() -install(TARGETS tddb EXPORT TdTargets +install(TARGETS tddb EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) diff --git a/tdnet/CMakeLists.txt b/tdnet/CMakeLists.txt index e14f3500f..d490f87f6 100644 --- a/tdnet/CMakeLists.txt +++ b/tdnet/CMakeLists.txt @@ -84,7 +84,7 @@ if (APPLE_WATCH) target_link_libraries(tdnet PRIVATE ${FOUNDATION_LIBRARY}) endif() -install(TARGETS tdnet EXPORT TdTargets +install(TARGETS tdnet EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" ) diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt index 56176ed34..b06c5c9e6 100644 --- a/tdutils/CMakeLists.txt +++ b/tdutils/CMakeLists.txt @@ -409,7 +409,7 @@ if (CMAKE_SYSTEM_NAME MATCHES "NetBSD") target_link_libraries(tdutils PUBLIC atomic) endif() -install(TARGETS tdutils EXPORT TdTargets +install(TARGETS tdutils EXPORT TdStaticTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" )