diff --git a/RELEASE.md b/RELEASE.md index 7fe5e8f7c8e..ea96f9d9984 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -283,6 +283,7 @@ mention the version explicitly. These files are listed below: # gradle.properties R/rdeephaven/DESCRIPTION +cpp-client/deephaven/CMakeLists.txt ``` This leaves the files "ready" for the next regular release, and also ensures any build done from diff --git a/cpp-client/build.gradle b/cpp-client/build.gradle index a615c404721..fc40076144f 100644 --- a/cpp-client/build.gradle +++ b/cpp-client/build.gradle @@ -68,6 +68,7 @@ def buildCppClientImage = Docker.registerDockerTask(project, 'cppClient') { include 'cpp-tests-to-junit.sh' include 'build-dependencies.sh' include 'deephaven/CMakeLists.txt' + include 'deephaven/cmake/**' include 'deephaven/dhcore/**' include 'deephaven/dhclient/**' include 'deephaven/examples/**' @@ -87,6 +88,7 @@ def buildCppClientImage = Docker.registerDockerTask(project, 'cppClient') { ${prefix}/log """) copyFile('deephaven/CMakeLists.txt', "${prefix}/src/deephaven/") + copyFile('deephaven/cmake/', "${prefix}/src/deephaven/cmake/") copyFile('deephaven/dhcore/', "${prefix}/src/deephaven/dhcore/") copyFile('deephaven/dhclient/', "${prefix}/src/deephaven/dhclient/") copyFile('deephaven/examples/', "${prefix}/src/deephaven/examples/") diff --git a/cpp-client/deephaven/CMakeLists.txt b/cpp-client/deephaven/CMakeLists.txt index 9cfc70db45a..2c8be6d3a3d 100644 --- a/cpp-client/deephaven/CMakeLists.txt +++ b/cpp-client/deephaven/CMakeLists.txt @@ -8,6 +8,7 @@ endif() project(deephaven) +set(deephaven_VERSION 0.36.0) set(CMAKE_CXX_STANDARD 17) # for CMAKE_INSTALL_{dir} @@ -40,15 +41,46 @@ if(NOT DHCORE_ONLY) ) install(TARGETS dhclient dhcore dhcore_static dhclient_tests - EXPORT deephavenConfig + EXPORT deephavenTargets ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) - install(EXPORT deephavenConfig - DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/deephaven + include(CMakePackageConfigHelpers) + write_basic_package_version_file( + "${CMAKE_CURRENT_BINARY_DIR}/deephaven/deephavenConfigVersion.cmake" + VERSION ${deephaven_VERSION} + COMPATIBILITY AnyNewerVersion + ) + + export(EXPORT deephavenTargets + FILE "${CMAKE_CURRENT_BINARY_DIR}/deephaven/deephavenTargets.cmake" NAMESPACE deephaven:: ) + configure_file(cmake/deephavenConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/deephaven/deephavenConfig.cmake" + COPYONLY + ) + + set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/deephaven) + install(EXPORT deephavenTargets + FILE + deephavenTargets.cmake + NAMESPACE + deephaven:: + DESTINATION + ${ConfigPackageLocation} + ) + install( + FILES + cmake/deephavenConfig.cmake + "${CMAKE_CURRENT_BINARY_DIR}/deephaven/deephavenConfigVersion.cmake" + DESTINATION + ${ConfigPackageLocation} + COMPONENT + Devel + ) + endif() diff --git a/cpp-client/deephaven/cmake/deephavenConfig.cmake b/cpp-client/deephaven/cmake/deephavenConfig.cmake new file mode 100644 index 00000000000..88aa04e9744 --- /dev/null +++ b/cpp-client/deephaven/cmake/deephavenConfig.cmake @@ -0,0 +1,9 @@ +include(CMakeFindDependencyMacro) +find_dependency(Arrow 16.0.0) +find_dependency(ArrowFlight 16.0.0) +find_dependency(Immer) +find_dependency(Protobuf) +find_dependency(gRPC 1.63.0) +find_dependency(Threads) + +include("${CMAKE_CURRENT_LIST_DIR}/deephavenTargets.cmake") diff --git a/cpp-client/deephaven/dhclient/CMakeLists.txt b/cpp-client/deephaven/dhclient/CMakeLists.txt index 53b2773fd49..48d530f206c 100644 --- a/cpp-client/deephaven/dhclient/CMakeLists.txt +++ b/cpp-client/deephaven/dhclient/CMakeLists.txt @@ -8,7 +8,7 @@ include(GNUInstallDirs) find_package(Arrow CONFIG REQUIRED) find_package(ArrowFlight CONFIG REQUIRED HINTS ${Arrow_DIR}) -find_package(Immer REQUIRED) +find_package(Immer CONFIG REQUIRED) find_package(Protobuf CONFIG REQUIRED) find_package(gRPC CONFIG REQUIRED) find_package(Threads REQUIRED) @@ -133,7 +133,6 @@ target_link_libraries(dhclient PUBLIC deephaven::dhcore) target_link_libraries(dhclient PUBLIC ArrowFlight::arrow_flight_shared) target_link_libraries(dhclient PUBLIC Arrow::arrow_shared) -target_link_libraries(dhclient PUBLIC immer) -target_link_libraries(dhclient PUBLIC protobuf::libprotobuf) -target_link_libraries(dhclient PUBLIC gRPC::grpc++) -target_link_libraries(dhclient PUBLIC Threads::Threads) +target_link_libraries(dhclient PRIVATE protobuf::libprotobuf) +target_link_libraries(dhclient PRIVATE gRPC::grpc++) +target_link_libraries(dhclient PRIVATE Threads::Threads) diff --git a/cpp-client/deephaven/dhcore/CMakeLists.txt b/cpp-client/deephaven/dhcore/CMakeLists.txt index 2db271b125f..4209f7cc974 100644 --- a/cpp-client/deephaven/dhcore/CMakeLists.txt +++ b/cpp-client/deephaven/dhcore/CMakeLists.txt @@ -6,7 +6,7 @@ set(CMAKE_CXX_STANDARD 17) # for CMAKE_INSTALL_{dir} include(GNUInstallDirs) -find_package(Immer REQUIRED) +find_package(Immer CONFIG REQUIRED) set(ALL_FILES src/types.cc @@ -142,5 +142,5 @@ foreach (whichlib dhcore dhcore_static) target_include_directories(${whichlib} PRIVATE flatbuf) target_include_directories(${whichlib} PUBLIC $) - target_link_libraries(${whichlib} PUBLIC immer) + target_link_libraries(${whichlib} PRIVATE immer) endforeach()