vyasr commented on code in PR #406:
URL: https://github.com/apache/arrow-nanoarrow/pull/406#discussion_r1532408983
##########
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:
The reason I ask this question is that we need to decide what the behavior
should be if someone does `find_package(nanoarrow 0.5.0)` and they have
nanoarrow 0.4.0 installed on the system. Should that be considered found, or
could 0.5.0 have broken something from 0.4.0? What about between major versions
2.0.0 and 1.0.0? The setting here will control that.
It sounds like perhaps the best solution for the moment is to set this to
`ExactVersion`, but perhaps after 1.0.0 change this to `SameMajorVersion`. Does
that align with your plans?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]