Skip to content

Commit

Permalink
fix exports name
Browse files Browse the repository at this point in the history
  • Loading branch information
cwaldren-ld committed Oct 7, 2024
1 parent 61f1108 commit da6370e
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 18 deletions.
22 changes: 15 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,13 @@ set(CMAKE_CXX_STANDARD 17)

set(CMAKE_POSITION_INDEPENDENT_CODE ON)

set(LD_TARGETS_EXPORT_NAME ${PROJECT_NAME}Targets)
set(LD_CMAKE_CONFIG_DIR "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(LD_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/cmake/${PROJECT_NAME}")
set(LD_CMAKE_PROJECT_CONFIG_FILE "${LD_CMAKE_CONFIG_DIR}/${PROJECT_NAME}Config.cmake")
set(LD_CMAKE_VERSION_CONFIG_FILE "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake")


if (LD_BUILD_UNIT_TESTS)
message(STATUS "LaunchDarkly: building unit tests")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_GLIBCXX_DEBUG")
Expand Down Expand Up @@ -192,18 +199,19 @@ include(CMakePackageConfigHelpers)
include(GNUInstallDirs)

write_basic_package_version_file(
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
${LD_CMAKE_VERSION_CONFIG_FILE}
COMPATIBILITY SameMajorVersion
)

install(FILES
"${CMAKE_CURRENT_SOURCE_DIR}/cmake/${CMAKE_PROJECT_NAME}Config.cmake"
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_PROJECT_NAME}ConfigVersion.cmake"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${CMAKE_PROJECT_NAME}"
${LD_CMAKE_PROJECT_CONFIG_FILE}
${LD_CMAKE_VERSION_CONFIG_FILE}
DESTINATION ${LD_CONFIG_INSTALL_DIR}
)


install(
EXPORT "${PROJECT_NAME}Targets"
NAMESPACE "${PROJECT_NAME}::"
DESTINATION "${CMAKE_INSTALL_DATADIR}/cmake/${CMAKE_PROJECT_NAME}"
EXPORT ${LD_TARGETS_EXPORT_NAME}
NAMESPACE ${PROJECT_NAME}::
DESTINATION ${LD_CONFIG_INSTALL_DIR}
)
2 changes: 1 addition & 1 deletion cmake/rfc3339_timestamp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ target_include_directories(timestamp PUBLIC
)
install(
TARGETS timestamp
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
4 changes: 2 additions & 2 deletions libs/client-sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,6 @@ install(DIRECTORY "${LaunchDarklyCPPClient_SOURCE_DIR}/include/launchdarkly"
)

install(
TARGETS ${LIBNAME} OPTIONAL
EXPORT "${PROJECT_NAME}Targets"
TARGETS ${LIBNAME}
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
2 changes: 1 addition & 1 deletion libs/common/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -90,5 +90,5 @@ target_compile_features(${LIBNAME} PUBLIC cxx_std_17)

install(
TARGETS ${LIBNAME}
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
2 changes: 1 addition & 1 deletion libs/internal/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,5 @@ target_compile_features(${LIBNAME} PUBLIC cxx_std_17)

install(
TARGETS ${LIBNAME}
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
2 changes: 1 addition & 1 deletion libs/server-sdk-redis-source/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ target_compile_features(${LIBNAME} PUBLIC cxx_std_17)

install(
TARGETS ${LIBNAME} OPTIONAL
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
3 changes: 1 addition & 2 deletions libs/server-sdk/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,5 @@ target_compile_features(${LIBNAME} PUBLIC cxx_std_17)

install(
TARGETS ${LIBNAME} OPTIONAL
EXPORT "${PROJECT_NAME}Targets"

EXPORT ${LD_TARGETS_EXPORT_NAME}
)
2 changes: 1 addition & 1 deletion libs/server-sent-events/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ target_compile_features(${LIBNAME} PUBLIC cxx_std_17)

install(
TARGETS ${LIBNAME}
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
2 changes: 1 addition & 1 deletion vendor/foxy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -259,5 +259,5 @@ endif ()

install(
TARGETS foxy
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)
2 changes: 1 addition & 1 deletion vendor/foxy/cmake/certify.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ set(BUILD_TESTING ${PREVIOUS_BUILD_TESTING})

install(
TARGETS core
EXPORT "${PROJECT_NAME}Targets"
EXPORT ${LD_TARGETS_EXPORT_NAME}
)

0 comments on commit da6370e

Please sign in to comment.