wgtmac commented on code in PR #2076:
URL: https://github.com/apache/orc/pull/2076#discussion_r1861424495
##########
cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -197,6 +203,13 @@ if (ORC_PACKAGE_KIND STREQUAL "conan")
add_resolved_library (orc_zlib ${ZLIB_LIBRARIES} ${ZLIB_INCLUDE_DIR})
list (APPEND ORC_SYSTEM_DEPENDENCIES ZLIB)
list (APPEND ORC_INSTALL_INTERFACE_TARGETS "$<INSTALL_INTERFACE:ZLIB::ZLIB>")
+elseif (ORC_PACKAGE_KIND STREQUAL "vcpkg")
+ find_package(ZLIB REQUIRED)
+ add_library (orc_zlib INTERFACE IMPORTED)
+ target_link_libraries(orc_zlib INTERFACE ZLIB::ZLIB)
+ list (APPEND ORC_VCPKG_DEPENDENCIES ZLIB)
Review Comment:
Should this line be deleted since `ORC_VCPKG_DEPENDENCIES` is not used
elsewhere?
##########
CMakeLists.txt:
##########
@@ -157,6 +157,9 @@ enable_testing()
INCLUDE(GNUInstallDirs) # Put it before ThirdpartyToolchain to make
CMAKE_INSTALL_LIBDIR available.
set(ORC_INSTALL_CMAKE_DIR ${CMAKE_INSTALL_LIBDIR}/cmake/orc)
+if (ORC_PACKAGE_KIND STREQUAL "vcpkg")
Review Comment:
nit: put line 159 into a `else ()` statement.
##########
cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -153,6 +153,12 @@ if (ORC_PACKAGE_KIND STREQUAL "conan")
add_resolved_library (orc_snappy ${Snappy_LIBRARIES} ${Snappy_INCLUDE_DIR})
list (APPEND ORC_SYSTEM_DEPENDENCIES Snappy)
list (APPEND ORC_INSTALL_INTERFACE_TARGETS
"$<INSTALL_INTERFACE:Snappy::snappy>")
+elseif (ORC_PACKAGE_KIND STREQUAL "vcpkg")
+ find_package(Snappy CONFIG REQUIRED)
+ add_library (orc_snappy INTERFACE IMPORTED)
+ target_link_libraries(orc_snappy INTERFACE Snappy::snappy)
Review Comment:
It doesn't need to call `target_include_directories` because
`Snappy::snappy` already exported the headers?
##########
cmake_modules/ThirdpartyToolchain.cmake:
##########
@@ -249,6 +262,18 @@ if (ORC_PACKAGE_KIND STREQUAL "conan")
add_resolved_library (orc_zstd ${zstd_LIBRARIES} ${zstd_INCLUDE_DIR})
list (APPEND ORC_SYSTEM_DEPENDENCIES ZSTD)
list (APPEND ORC_INSTALL_INTERFACE_TARGETS
"$<INSTALL_INTERFACE:$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>>")
+elseif (ORC_PACKAGE_KIND STREQUAL "vcpkg")
+ find_package(zstd CONFIG REQUIRED)
+ add_library(orc_zstd INTERFACE)
+ if (TARGET zstd::libzstd_shared)
+ target_link_libraries(orc_zstd INTERFACE zstd::libzstd_shared)
+ elseif (TARGET zstd::libzstd_static)
+ target_link_libraries(orc_zstd INTERFACE zstd::libzstd_static)
+ else()
+ message(FATAL_ERROR "No suitable ZSTD library target found.")
Review Comment:
This section is not consistent with others. Could we simply use
`target_link_libraries(orc_zstd INTERFACE
$<IF:$<TARGET_EXISTS:zstd::libzstd_shared>,zstd::libzstd_shared,zstd::libzstd_static>)`
--
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]