Skip to content

Commit

Permalink
Export static targets in a separate file
Browse files Browse the repository at this point in the history
  • Loading branch information
mochaaP authored and levlam committed Oct 14, 2023
1 parent 5881dde commit ebd77d5
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 3 additions & 0 deletions TdConfig.cmake
Original file line number Diff line number Diff line change
@@ -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()
2 changes: 1 addition & 1 deletion sqlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
2 changes: 1 addition & 1 deletion tdactor/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
2 changes: 1 addition & 1 deletion tddb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
2 changes: 1 addition & 1 deletion tdnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
2 changes: 1 addition & 1 deletion tdutils/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
)
Expand Down

1 comment on commit ebd77d5

@Misganaw178
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Its ok

Please sign in to comment.