From e16f0a5b90f38048fef2469e29724053803a1e60 Mon Sep 17 00:00:00 2001 From: luffy-zh Date: Mon, 5 Aug 2024 17:46:09 +0800 Subject: [PATCH] ORC-1751: [C++] fix syntax error in ThirdpartyToolchain --- cmake_modules/FindZSTD.cmake | 4 ++-- cmake_modules/ThirdpartyToolchain.cmake | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/cmake_modules/FindZSTD.cmake b/cmake_modules/FindZSTD.cmake index faa1fe9350..581719453c 100644 --- a/cmake_modules/FindZSTD.cmake +++ b/cmake_modules/FindZSTD.cmake @@ -86,13 +86,13 @@ mark_as_advanced ( ) if(ZSTD_FOUND) - if(NOT TARGET zstd::libzstd_static AND ${ZSTD_STATIC_LIB}) + if(NOT TARGET zstd::libzstd_static AND ZSTD_STATIC_LIB) add_library(zstd::libzstd_static STATIC IMPORTED) set_target_properties(zstd::libzstd_static PROPERTIES IMPORTED_LOCATION "${ZSTD_STATIC_LIB}" INTERFACE_INCLUDE_DIRECTORIES "${ZSTD_INCLUDE_DIR}") endif() - if(NOT TARGET zstd::libzstd_shared AND NOT ${ZSTD_STATIC_LIB}) + if(NOT TARGET zstd::libzstd_shared AND NOT ZSTD_STATIC_LIB) add_library(zstd::libzstd_shared SHARED IMPORTED) set_target_properties(zstd::libzstd_shared PROPERTIES IMPORTED_LOCATION "${ZSTD_LIBRARY}" diff --git a/cmake_modules/ThirdpartyToolchain.cmake b/cmake_modules/ThirdpartyToolchain.cmake index 79324984a3..447d9a6a44 100644 --- a/cmake_modules/ThirdpartyToolchain.cmake +++ b/cmake_modules/ThirdpartyToolchain.cmake @@ -155,7 +155,7 @@ if (ORC_PACKAGE_KIND STREQUAL "conan") list (APPEND ORC_INSTALL_INTERFACE_TARGETS "$") elseif (NOT "${SNAPPY_HOME}" STREQUAL "") find_package (Snappy REQUIRED) - if (ORC_PREFER_STATIC_SNAPPY AND ${SNAPPY_STATIC_LIB}) + if (ORC_PREFER_STATIC_SNAPPY AND SNAPPY_STATIC_LIB) add_resolved_library (orc_snappy ${SNAPPY_STATIC_LIB} ${SNAPPY_INCLUDE_DIR}) else () add_resolved_library (orc_snappy ${SNAPPY_LIBRARY} ${SNAPPY_INCLUDE_DIR}) @@ -199,7 +199,7 @@ if (ORC_PACKAGE_KIND STREQUAL "conan") list (APPEND ORC_INSTALL_INTERFACE_TARGETS "$") elseif (NOT "${ZLIB_HOME}" STREQUAL "") find_package (ZLIB REQUIRED) - if (ORC_PREFER_STATIC_ZLIB AND ${ZLIB_STATIC_LIB}) + if (ORC_PREFER_STATIC_ZLIB AND ZLIB_STATIC_LIB) add_resolved_library (orc_zlib ${ZLIB_STATIC_LIB} ${ZLIB_INCLUDE_DIR}) else () add_resolved_library (orc_zlib ${ZLIB_LIBRARY} ${ZLIB_INCLUDE_DIR}) @@ -251,7 +251,7 @@ if (ORC_PACKAGE_KIND STREQUAL "conan") list (APPEND ORC_INSTALL_INTERFACE_TARGETS "$,zstd::libzstd_shared,zstd::libzstd_static>>") elseif (NOT "${ZSTD_HOME}" STREQUAL "") find_package (ZSTD REQUIRED) - if (ORC_PREFER_STATIC_ZSTD AND ${ZSTD_STATIC_LIB}) + if (ORC_PREFER_STATIC_ZSTD AND ZSTD_STATIC_LIB) add_resolved_library (orc_zstd ${ZSTD_STATIC_LIB} ${ZSTD_INCLUDE_DIR}) list (APPEND ORC_INSTALL_INTERFACE_TARGETS "$") else () @@ -310,7 +310,7 @@ if (ORC_PACKAGE_KIND STREQUAL "conan") list (APPEND ORC_INSTALL_INTERFACE_TARGETS "$") elseif (NOT "${LZ4_HOME}" STREQUAL "") find_package (LZ4 REQUIRED) - if (ORC_PREFER_STATIC_LZ4 AND ${LZ4_STATIC_LIB}) + if (ORC_PREFER_STATIC_LZ4 AND LZ4_STATIC_LIB) add_resolved_library (orc_lz4 ${LZ4_STATIC_LIB} ${LZ4_INCLUDE_DIR}) else () add_resolved_library (orc_lz4 ${LZ4_LIBRARY} ${LZ4_INCLUDE_DIR}) @@ -434,7 +434,7 @@ if (BUILD_CPP_TESTS) add_library (orc::gmock ALIAS orc_gmock) add_library (orc_gtest INTERFACE) add_library (orc::gtest ALIAS orc_gtest) - if (ORC_PREFER_STATIC_GMOCK AND ${GMOCK_STATIC_LIB}) + if (ORC_PREFER_STATIC_GMOCK AND GMOCK_STATIC_LIB) target_link_libraries (orc_gmock INTERFACE ${GMOCK_STATIC_LIB}) target_link_libraries (orc_gtest INTERFACE ${GTEST_STATIC_LIB}) else () @@ -466,13 +466,13 @@ if (ORC_PACKAGE_KIND STREQUAL "conan") elseif (NOT "${PROTOBUF_HOME}" STREQUAL "") find_package (Protobuf REQUIRED) - if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOBUF_STATIC_LIB}) + if (ORC_PREFER_STATIC_PROTOBUF AND PROTOBUF_STATIC_LIB) add_resolved_library (orc_protobuf ${PROTOBUF_STATIC_LIB} ${PROTOBUF_INCLUDE_DIR}) else () add_resolved_library (orc_protobuf ${PROTOBUF_LIBRARY} ${PROTOBUF_INCLUDE_DIR}) endif () - if (ORC_PREFER_STATIC_PROTOBUF AND ${PROTOC_STATIC_LIB}) + if (ORC_PREFER_STATIC_PROTOBUF AND PROTOC_STATIC_LIB) add_resolved_library (orc_protoc ${PROTOC_STATIC_LIB} ${PROTOBUF_INCLUDE_DIR}) else () add_resolved_library (orc_protoc ${PROTOC_LIBRARY} ${PROTOBUF_INCLUDE_DIR})