--- orc-rel-release-1.6.6/c++/src/orcConfig.cmake.orig 2021-09-02 08:12:02.402411800 -0400
+++ orc-rel-release-1.6.6/c++/src/orcConfig.cmake 2021-09-02 08:11:53.797563660 -0400
@@ -0,0 +1 @@
+include("${CMAKE_CURRENT_LIST_DIR}/orcTargets.cmake")
--- orc-rel-release-1.6.6/c++/src/CMakeLists.txt.orig 2020-12-03 15:46:53.000000000 -0500
+++ orc-rel-release-1.6.6/c++/src/CMakeLists.txt 2021-09-15 14:47:07.195633659 -0400
@@ -227,7 +227,13 @@
add_definitions(-DBUILD_LIBHDFSPP)
endif(BUILD_LIBHDFSPP)
-add_library (orc STATIC ${SOURCE_FILES})
+add_library (orc SHARED ${SOURCE_FILES})
+
+set_target_properties(orc PROPERTIES
+ POSITION_INDEPENDENT_CODE ON
+ VERSION 1.6.6
+ SOVERSION 1
+)
target_link_libraries (orc
protobuf
@@ -238,4 +244,38 @@
${LIBHDFSPP_LIBRARIES}
)
-install(TARGETS orc DESTINATION lib)
+install(TARGETS orc
+ EXPORT orcExports
+ DESTINATION ${LIB_INSTALL_DIR})
+
+include(CMakePackageConfigHelpers)
+write_basic_package_version_file(
+ "${CMAKE_CURRENT_BINARY_DIR}/orcConfigVersion.cmake"
+ VERSION ${orc_VERSION}
+ COMPATIBILITY SameMajorVersion
+ )
+
+# A Package Config file that works from the build directory
+export(EXPORT orcExports
+ FILE "${CMAKE_CURRENT_BINARY_DIR}/orcTargets.cmake"
+ NAMESPACE orc::
+ )
+configure_file(orcConfig.cmake
+ "${CMAKE_CURRENT_BINARY_DIR}/orcConfig.cmake"
+ COPYONLY
+ )
+
+# A Package Config file that works from the installation directory
+set(ConfigPackageLocation ${CMAKE_INSTALL_LIBDIR}/cmake/orc)
+install(EXPORT orcExports
+ FILE orcTargets.cmake
+ NAMESPACE orc::
+ DESTINATION ${ConfigPackageLocation}
+ )
+install(FILES
+ orcConfig.cmake
+ "${CMAKE_CURRENT_BINARY_DIR}/orcConfigVersion.cmake"
+ DESTINATION ${ConfigPackageLocation}
+ )
+
+