Skip to content

Commit 9fa5c68

Browse files
committed
Fix split between TdTargets and TdStaticTargets.
1 parent 91b57cc commit 9fa5c68

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

CMakeLists.txt

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1091,13 +1091,27 @@ add_library(Td::TdStatic ALIAS TdStatic)
10911091
add_library(Td::TdJson ALIAS TdJson)
10921092
add_library(Td::TdJsonStatic ALIAS TdJsonStatic)
10931093

1094-
install(TARGETS tdjson TdJson tdjson_static TdJsonStatic tdjson_private tdclient tdcore tdapi TdStatic EXPORT TdTargets
1094+
set(INSTALL_TARGETS tdjson TdJson)
1095+
set(INSTALL_STATIC_TARGETS tdjson_static TdJsonStatic tdjson_private tdcore)
1096+
if (BUILD_SHARED_LIBS)
1097+
set(INSTALL_TARGETS ${INSTALL_TARGETS} tdclient TdStatic tdapi)
1098+
else()
1099+
set(INSTALL_STATIC_TARGETS ${INSTALL_STATIC_TARGETS} tdclient TdStatic tdapi)
1100+
endif()
1101+
1102+
install(TARGETS ${INSTALL_TARGETS} EXPORT TdTargets
10951103
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
10961104
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
10971105
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}"
10981106
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
10991107
)
11001108

1109+
install(TARGETS ${INSTALL_STATIC_TARGETS} EXPORT TdStaticTargets
1110+
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}"
1111+
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}"
1112+
INCLUDES DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
1113+
)
1114+
11011115
# generate pkg-config files
11021116
include(GeneratePkgConfig)
11031117

0 commit comments

Comments
 (0)