From 9fa5c685f6bfdcfd38cfa76137c3828476b00759 Mon Sep 17 00:00:00 2001 From: levlam Date: Sun, 15 Oct 2023 00:57:35 +0300 Subject: [PATCH] Fix split between TdTargets and TdStaticTargets. --- CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a888dafa5..a7fc32a72 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1091,13 +1091,27 @@ add_library(Td::TdStatic ALIAS TdStatic) add_library(Td::TdJson ALIAS TdJson) add_library(Td::TdJsonStatic ALIAS TdJsonStatic) -install(TARGETS tdjson TdJson tdjson_static TdJsonStatic tdjson_private tdclient tdcore tdapi TdStatic EXPORT TdTargets +set(INSTALL_TARGETS tdjson TdJson) +set(INSTALL_STATIC_TARGETS tdjson_static TdJsonStatic tdjson_private tdcore) +if (BUILD_SHARED_LIBS) + set(INSTALL_TARGETS ${INSTALL_TARGETS} tdclient TdStatic tdapi) +else() + set(INSTALL_STATIC_TARGETS ${INSTALL_STATIC_TARGETS} tdclient TdStatic tdapi) +endif() + +install(TARGETS ${INSTALL_TARGETS} EXPORT TdTargets LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" ) +install(TARGETS ${INSTALL_STATIC_TARGETS} EXPORT TdStaticTargets + LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" + ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" + INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}" +) + # generate pkg-config files include(GeneratePkgConfig)