paleolimbot commented on code in PR #406:
URL: https://github.com/apache/arrow-nanoarrow/pull/406#discussion_r1532497774


##########
CMakeLists.txt:
##########
@@ -154,13 +154,48 @@ else()
     endif()
   endif()
 
-  install(TARGETS nanoarrow DESTINATION lib)
+  install(TARGETS nanoarrow
+          DESTINATION lib
+          EXPORT nanoarrow-exports)
+  install(TARGETS coverage_config
+          DESTINATION lib
+          EXPORT nanoarrow-exports)
   install(DIRECTORY src/
           DESTINATION include
           FILES_MATCHING
-          PATTERN "*.h")
+          PATTERN "*.h*")
   install(FILES ${CMAKE_CURRENT_BINARY_DIR}/generated/nanoarrow_config.h
           DESTINATION include/nanoarrow)
+
+  # Set up build tree as a CMake package.
+  include(CMakePackageConfigHelpers)
+  write_basic_package_version_file(
+    "${PROJECT_BINARY_DIR}/nanoarrow-config-version.cmake"
+    VERSION ${nanoarrow_VERSION}
+    # Not sure if nanoarrow plans to promise any compatibility.
+    COMPATIBILITY AnyNewerVersion)
+  
configure_package_config_file("${CMAKE_CURRENT_LIST_DIR}/cmake/config.cmake.in"
+                                "${PROJECT_BINARY_DIR}/nanoarrow-config.cmake"
+                                INSTALL_DESTINATION "${PROJECT_BINARY_DIR}")
+  export(EXPORT nanoarrow-exports FILE 
"${PROJECT_BINARY_DIR}/nanoarrow-targets.cmake")
+
+  # Set up install tree as a CMake package.
+  include(GNUInstallDirs)
+  set(install_location "${CMAKE_INSTALL_LIBDIR}/cmake/nanoarrow")
+  set(build_location "${CMAKE_BINARY_DIR}/${install_location}")
+  write_basic_package_version_file(
+    "${build_location}/nanoarrow-config-version.cmake"
+    VERSION ${nanoarrow_VERSION}
+    # Not sure if nanoarrow plans to promise any compatibility.

Review Comment:
   That sounds perfect!



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to