vcpkg/ports/orc/fix-cmake.patch

145 lines
3.8 KiB
Diff
Raw Normal View History

diff --git a/c++/src/CMakeLists.txt b/c++/src/CMakeLists.txt
2024-04-02 06:34:36 +08:00
index 33ad5848..2a41e427 100644
--- a/c++/src/CMakeLists.txt
+++ b/c++/src/CMakeLists.txt
2024-04-02 06:34:36 +08:00
@@ -208,15 +208,30 @@ endif(BUILD_ENABLE_AVX512)
add_library (orc STATIC ${SOURCE_FILES})
+include(GNUInstallDirs)
+
+target_include_directories(orc
+ PUBLIC
+ $<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
2024-04-02 06:34:36 +08:00
+)
+
target_link_libraries (orc
- orc::protobuf
- orc::zlib
- orc::snappy
- orc::lz4
- orc::zstd
+ PRIVATE
+ protobuf::libprotobuf
+ ZLIB::ZLIB
+ Snappy::snappy
+ lz4::lz4
+ $<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>
${LIBHDFSPP_LIBRARIES}
2024-04-02 06:34:36 +08:00
- )
+)
add_dependencies(orc orc-format_ep)
-install(TARGETS orc DESTINATION lib)
+install(TARGETS orc EXPORT unofficial-orc)
+
+install(
+ EXPORT unofficial-orc
+ FILE unofficial-orc-config.cmake
+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-orc"
+ NAMESPACE unofficial::orc::
+)
2024-04-02 06:34:36 +08:00
\ No newline at end of file
diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake
2024-04-02 06:34:36 +08:00
index ec33193d..5b7a009d 100644
--- a/cmake_modules/ThirdpartyToolchain.cmake
+++ b/cmake_modules/ThirdpartyToolchain.cmake
2024-04-02 06:34:36 +08:00
@@ -83,7 +83,8 @@ ExternalProject_Add (orc-format_ep
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# Snappy
-
+find_package(Snappy CONFIG REQUIRED)
+if (0)
2024-04-02 06:34:36 +08:00
if (NOT "${SNAPPY_HOME}" STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan")
find_package (Snappy REQUIRED)
set(SNAPPY_VENDORED FALSE)
@@ -130,10 +131,12 @@ if (SNAPPY_VENDORED)
DESTINATION "lib")
endif ()
endif ()
+endif ()
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# ZLIB
-
+find_package(ZLIB REQUIRED)
+if (0)
2024-04-02 06:34:36 +08:00
if (NOT "${ZLIB_HOME}" STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan")
find_package (ZLIB REQUIRED)
set(ZLIB_VENDORED FALSE)
@@ -184,10 +187,11 @@ if (ZLIB_VENDORED)
DESTINATION "lib")
endif ()
endif ()
2024-04-02 06:34:36 +08:00
-
+endif ()
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# Zstd
-
+find_package(zstd CONFIG REQUIRED)
+if (0)
2024-04-02 06:34:36 +08:00
if (NOT "${ZSTD_HOME}" STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan")
find_package (ZSTD REQUIRED)
set(ZSTD_VENDORED FALSE)
@@ -249,10 +253,11 @@ if (ZSTD_VENDORED)
DESTINATION "lib")
endif ()
endif ()
2024-04-02 06:34:36 +08:00
-
+endif ()
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# LZ4
-
+find_package(lz4 CONFIG REQUIRED)
+if (0)
2024-04-02 06:34:36 +08:00
if (NOT "${LZ4_HOME}" STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan")
find_package (LZ4 REQUIRED)
set(LZ4_VENDORED FALSE)
@@ -307,11 +312,11 @@ if (LZ4_VENDORED)
DESTINATION "lib")
endif ()
endif ()
2024-04-02 06:34:36 +08:00
-
+endif ()
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# IANA - Time Zone Database
-if (WIN32)
+if (WIN32 AND TEST_VALGRIND_MEMCHECK)
SET(CURRENT_TZDATA_FILE "")
2024-04-02 06:34:36 +08:00
SET(CURRENT_TZDATA_SHA512 "")
File(DOWNLOAD "https://ftp.osuosl.org/pub/cygwin/noarch/release/tzdata/sha512.sum" ${CMAKE_CURRENT_BINARY_DIR}/sha512.sum)
@@ -413,7 +418,8 @@ endif ()
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# Protobuf
-
+find_package(Protobuf CONFIG REQUIRED)
+if (0)
2024-04-02 06:34:36 +08:00
if (NOT "${PROTOBUF_HOME}" STREQUAL "" OR ORC_PACKAGE_KIND STREQUAL "conan")
find_package (Protobuf REQUIRED)
set(PROTOBUF_VENDORED FALSE)
@@ -493,6 +499,7 @@ if (PROTOBUF_VENDORED)
DESTINATION "lib")
endif ()
endif ()
+endif ()
2024-04-02 06:34:36 +08:00
# ----------------------------------------------------------------------
# LIBHDFSPP
diff --git a/tools/src/CMakeLists.txt b/tools/src/CMakeLists.txt
2024-04-02 06:34:36 +08:00
index 3863c408..b71ab5ea 100644
--- a/tools/src/CMakeLists.txt
+++ b/tools/src/CMakeLists.txt
2024-04-02 06:34:36 +08:00
@@ -70,7 +70,7 @@ add_executable (orc-metadata
target_link_libraries (orc-metadata
orc
- orc::protobuf
+ protobuf::libprotobuf
${CMAKE_THREAD_LIBS_INIT}
2024-04-02 06:34:36 +08:00
)