Blob Blame History Raw
--- 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-1.7.3/c++/src/CMakeLists.txt	2022-02-10 14:55:16.260729962 -0500
@@ -236,15 +236,54 @@
   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.7.3
+  SOVERSION 1
+)
 
 target_link_libraries (orc
-  orc::protobuf
-  orc::zlib
-  orc::snappy
-  orc::lz4
-  orc::zstd
+  protobuf
+  z
+  snappy
+  lz4
+  zstd
   ${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}
+    )
+
--- orc-1.7.3/cmake_modules/ThirdpartyToolchain.cmake.orig	2022-02-10 14:22:42.421782851 -0500
+++ orc-1.7.3/cmake_modules/ThirdpartyToolchain.cmake	2022-02-10 15:31:26.865802496 -0500
@@ -10,19 +10,19 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
-set(LZ4_VERSION "1.9.3")
-set(SNAPPY_VERSION "1.1.7")
-set(ZLIB_VERSION "1.2.11")
-set(GTEST_VERSION "1.8.0")
-set(PROTOBUF_VERSION "3.5.1")
-set(ZSTD_VERSION "1.5.2")
+#set(LZ4_VERSION "1.9.3")
+#set(SNAPPY_VERSION "1.1.7")
+#set(ZLIB_VERSION "1.2.11")
+#set(GTEST_VERSION "1.8.0")
+#set(PROTOBUF_VERSION "3.5.1")
+#set(ZSTD_VERSION "1.5.2")
 
-option(ORC_PREFER_STATIC_PROTOBUF "Prefer static protobuf library, if available" ON)
-option(ORC_PREFER_STATIC_SNAPPY   "Prefer static snappy library, if available"   ON)
-option(ORC_PREFER_STATIC_LZ4      "Prefer static lz4 library, if available"      ON)
-option(ORC_PREFER_STATIC_ZSTD     "Prefer static zstd library, if available"     ON)
-option(ORC_PREFER_STATIC_ZLIB     "Prefer static zlib library, if available"     ON)
-option(ORC_PREFER_STATIC_GMOCK    "Prefer static gmock library, if available"    ON)
+option(ORC_PREFER_STATIC_PROTOBUF "Prefer static protobuf library, if available" OFF)
+option(ORC_PREFER_STATIC_SNAPPY   "Prefer static snappy library, if available"   OFF)
+option(ORC_PREFER_STATIC_LZ4      "Prefer static lz4 library, if available"      OFF)
+option(ORC_PREFER_STATIC_ZSTD     "Prefer static zstd library, if available"     OFF)
+option(ORC_PREFER_STATIC_ZLIB     "Prefer static zlib library, if available"     OFF)
+option(ORC_PREFER_STATIC_GMOCK    "Prefer static gmock library, if available"    OFF)
 
 # zstd requires us to add the threads
 FIND_PACKAGE(Threads REQUIRED)