Fix split between TdTargets and TdStaticTargets.

This commit is contained in:
levlam 2023-10-15 00:57:35 +03:00
parent 91b57ccceb
commit 9fa5c685f6
1 changed files with 15 additions and 1 deletions

View File

@ -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)