From e695fdb4c79e94c4b957a4a1f050878c4de0ae80 Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Fri, 23 Feb 2024 01:23:22 -0500 Subject: [PATCH] [91] Restore build compatibility with iRODS 4.3.1 packages. --- CMakeLists.txt | 7 ++++-- api_plugin/CMakeLists.txt | 47 ++++++++++++++++++++++++++++++++------ client/CMakeLists.txt | 20 ++++++++++++++-- parser/CMakeLists.txt | 18 ++++++++++++--- rule_engine/CMakeLists.txt | 19 ++++++++++++++- 5 files changed, 96 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 66072cd..3343109 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -60,9 +60,12 @@ endif() set(IRODS_BUILD_WITH_WERROR OFF CACHE BOOL "Choose whether to compile with -Werror.") +if (${IRODS_VERSION} VERSION_GREATER "4.3.1") + find_package(fmt "8.1.1" + HINTS "${IRODS_EXTERNALS_FULLPATH_FMT}") +endif() + find_package(nlohmann_json "3.6.1" REQUIRED) -find_package(fmt "8.1.1" - HINTS "${IRODS_EXTERNALS_FULLPATH_FMT}") find_package(Threads REQUIRED) find_package(OpenSSL REQUIRED COMPONENTS Crypto SSL) diff --git a/api_plugin/CMakeLists.txt b/api_plugin/CMakeLists.txt index 8e03e89..4d33bf5 100644 --- a/api_plugin/CMakeLists.txt +++ b/api_plugin/CMakeLists.txt @@ -38,9 +38,26 @@ foreach (IRODS_MODULE_VARIANT IN ITEMS client server) irods_plugin_dependencies irods_common irods_${IRODS_MODULE_VARIANT} - fmt::fmt ${IRODS_EXTERNALS_FULLPATH_NANODBC}/lib/libnanodbc.so) + if (${IRODS_VERSION} VERSION_GREATER "4.3.1") + target_link_libraries( + ${IRODS_MODULE_NAME} + PRIVATE + fmt::fmt) + else() + target_include_directories( + ${IRODS_MODULE_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/include + ${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include) + + target_link_libraries( + ${IRODS_MODULE_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so) + endif() + add_dependencies(${IRODS_MODULE_NAME} irods_genquery2_parser) install( @@ -63,8 +80,8 @@ target_link_objects( install( FILES "${CMAKE_CURRENT_SOURCE_DIR}/include/irods/plugins/api/genquery2_common.h" - #"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/plugins/api/rc_genquery2.h" - #"${CMAKE_CURRENT_SOURCE_DIR}/include/irods/plugins/api/rs_genquery2.hpp" +# "${CMAKE_CURRENT_SOURCE_DIR}/include/irods/plugins/api/rc_genquery2.h" +# "${CMAKE_CURRENT_SOURCE_DIR}/include/irods/plugins/api/rs_genquery2.hpp" DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/irods/plugins/api") #set(IRODS_PLUGIN_INVOCATION_FUNCTIONS irods_genquery2_invocation_functions) @@ -76,16 +93,32 @@ install( # ${CMAKE_CURRENT_SOURCE_DIR}/src/rs_genquery2.cpp) # #target_include_directories( -# ${IRODS_MODULE_NAME} +# ${IRODS_PLUGIN_INVOCATION_FUNCTIONS} # PRIVATE # $ # ${IRODS_INCLUDE_DIRS} # #${IRODS_EXTERNALS_FULLPATH_BOOST}/include # #${IRODS_EXTERNALS_FULLPATH_NANODBC}/include) -# ) # #target_link_libraries( # ${IRODS_PLUGIN_INVOCATION_FUNCTIONS} # PRIVATE -# irods_server -# fmt::fmt) +# irods_server) +# +#if (${IRODS_VERSION} VERSION_GREATER "4.3.1") +# target_link_libraries( +# ${IRODS_PLUGIN_INVOCATION_FUNCTIONS} +# PRIVATE +# fmt::fmt) +#else() +# target_include_directories( +# ${IRODS_PLUGIN_INVOCATION_FUNCTIONS} +# PRIVATE +# ${IRODS_EXTERNALS_FULLPATH_FMT}/include +# ${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include) +# +# target_link_libraries( +# ${IRODS_PLUGIN_INVOCATION_FUNCTIONS} +# PRIVATE +# ${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so) +#endif() diff --git a/client/CMakeLists.txt b/client/CMakeLists.txt index fed834d..711d7d6 100644 --- a/client/CMakeLists.txt +++ b/client/CMakeLists.txt @@ -22,8 +22,24 @@ target_link_libraries( ${IRODS_EXECUTABLE_NAME} PRIVATE irods_client - ${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_program_options.so - fmt::fmt) + ${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_program_options.so) + +if (${IRODS_VERSION} VERSION_GREATER "4.3.1") + target_link_libraries( + ${IRODS_EXECUTABLE_NAME} + PRIVATE + fmt::fmt) +else() + target_include_directories( + ${IRODS_EXECUTABLE_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/include) + + target_link_libraries( + ${IRODS_EXECUTABLE_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so) +endif() add_dependencies(${IRODS_EXECUTABLE_NAME} irods_genquery2_client) diff --git a/parser/CMakeLists.txt b/parser/CMakeLists.txt index ac89225..788e315 100644 --- a/parser/CMakeLists.txt +++ b/parser/CMakeLists.txt @@ -40,6 +40,18 @@ target_include_directories( target_link_libraries( ${IRODS_PARSER_NAME} PUBLIC - irods_common - nlohmann_json::nlohmann_json - fmt::fmt) + nlohmann_json::nlohmann_json) + +if (${IRODS_VERSION} VERSION_GREATER "4.3.1") + target_link_libraries( + ${IRODS_PARSER_NAME} + PRIVATE + irods_common + fmt::fmt) +else() + target_include_directories( + ${IRODS_PARSER_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/include + ${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include) +endif() diff --git a/rule_engine/CMakeLists.txt b/rule_engine/CMakeLists.txt index ea697fe..d663ad1 100644 --- a/rule_engine/CMakeLists.txt +++ b/rule_engine/CMakeLists.txt @@ -24,11 +24,28 @@ target_link_libraries( PRIVATE irods_server nlohmann_json::nlohmann_json - fmt::fmt ${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so ${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so ${CMAKE_DL_LIBS}) +if (${IRODS_VERSION} VERSION_GREATER "4.3.1") + target_link_libraries( + ${IRODS_RULE_ENGINE_PLUGIN_NAME} + PRIVATE + fmt::fmt) +else() + target_include_directories( + ${IRODS_RULE_ENGINE_PLUGIN_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/include + ${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include) + + target_link_libraries( + ${IRODS_RULE_ENGINE_PLUGIN_NAME} + PRIVATE + ${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so) +endif() + install( TARGETS ${IRODS_RULE_ENGINE_PLUGIN_NAME} LIBRARY DESTINATION ${IRODS_PLUGINS_DIRECTORY}/rule_engines)