Skip to content

Commit

Permalink
[irods#6251] CMake: use find_package for fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
SwooshyCueb authored and alanking committed Feb 20, 2024
1 parent e6c23ec commit b32b11b
Show file tree
Hide file tree
Showing 77 changed files with 109 additions and 197 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ if (IRODS_BUILD_WITH_WERROR)
endif()

find_package(nlohmann_json "3.6.1" REQUIRED)
find_package(fmt "8.1.1" REQUIRED
HINTS "${IRODS_EXTERNALS_FULLPATH_FMT}")

if (NOT DEFINED THREADS_PREFER_PTHREAD_FLAG)
set(THREADS_PREFER_PTHREAD_FLAG TRUE)
Expand Down
3 changes: 0 additions & 3 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ target_link_libraries(
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_random.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_regex.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
OpenSSL::SSL
${CMAKE_DL_LIBS}
rt
Expand Down Expand Up @@ -83,7 +82,6 @@ target_link_libraries(
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_regex.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_thread.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
OpenSSL::SSL
OpenSSL::Crypto
${CMAKE_DL_LIBS}
Expand Down Expand Up @@ -142,7 +140,6 @@ target_link_libraries(
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_regex.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_thread.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
${CMAKE_DL_LIBS}
rt
)
Expand Down
3 changes: 2 additions & 1 deletion lib/administration/resource/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ foreach(variant IN ITEMS client server)
)
target_link_libraries(
${target_name}
PUBLIC
fmt::fmt
PRIVATE
nlohmann_json::nlohmann_json
)
Expand All @@ -24,7 +26,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/api/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
${target_name}
Expand Down
3 changes: 2 additions & 1 deletion lib/administration/ticket/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ foreach(variant IN ITEMS client server)

target_link_libraries(
${target_name}
PUBLIC
fmt::fmt
PRIVATE
nlohmann_json::nlohmann_json
)
Expand All @@ -24,7 +26,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/api/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)

target_compile_definitions(
Expand Down
5 changes: 3 additions & 2 deletions lib/administration/user/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ add_library(
)
target_link_libraries(
irods_user_administration_common
PUBLIC
fmt::fmt
PRIVATE
nlohmann_json::nlohmann_json
)
Expand All @@ -24,7 +26,6 @@ target_include_directories(
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/api/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
irods_user_administration_common
Expand All @@ -48,6 +49,7 @@ foreach(variant IN ITEMS client server)
${target_name}
PUBLIC
irods_user_administration_common
fmt::fmt
PRIVATE
nlohmann_json::nlohmann_json
)
Expand All @@ -61,7 +63,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/api/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
${target_name}
Expand Down
3 changes: 2 additions & 1 deletion lib/administration/zone/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ foreach(variant IN ITEMS client server)
)
target_link_libraries(
${target_name}
PUBLIC
fmt::fmt
PRIVATE
nlohmann_json::nlohmann_json
)
Expand All @@ -24,7 +26,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/api/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
${target_name}
Expand Down
2 changes: 1 addition & 1 deletion lib/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ foreach(variant IN ITEMS client server)
irods_lib_api_${variant}
PUBLIC
nlohmann_json::nlohmann_json
fmt::fmt
OpenSSL::Crypto
OpenSSL::SSL
)
Expand All @@ -179,7 +180,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/drivers/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
irods_lib_api_${variant}
Expand Down
7 changes: 3 additions & 4 deletions lib/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ target_link_libraries(
irods_common_core
PUBLIC
nlohmann_json::nlohmann_json
fmt::fmt
Threads::Threads
)
target_include_directories(
Expand All @@ -94,7 +95,6 @@ target_include_directories(
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/icat/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down Expand Up @@ -131,6 +131,7 @@ target_link_libraries(
irods_plugin_dependencies_obj
PUBLIC
nlohmann_json::nlohmann_json
fmt::fmt
irods_common
)
target_include_directories(
Expand All @@ -148,7 +149,6 @@ target_include_directories(
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/drivers/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
set_target_properties(irods_plugin_dependencies_obj PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE TRUE)
set_target_properties(irods_plugin_dependencies_obj PROPERTIES POSITION_INDEPENDENT_CODE TRUE)
Expand All @@ -175,7 +175,6 @@ target_link_libraries(
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_random.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
${CMAKE_DL_LIBS}
)
target_include_directories(
Expand Down Expand Up @@ -236,6 +235,7 @@ foreach(variant IN ITEMS client server)
irods_lib_core_${variant}
PUBLIC
nlohmann_json::nlohmann_json
fmt::fmt
OpenSSL::Crypto
OpenSSL::SSL
)
Expand All @@ -256,7 +256,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/drivers/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
2 changes: 1 addition & 1 deletion lib/filesystem/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ foreach(variant IN ITEMS client server)
irods_filesystem_${variant}
PUBLIC
nlohmann_json::nlohmann_json
fmt::fmt
)
target_include_directories(
irods_filesystem_${variant}
Expand All @@ -54,7 +55,6 @@ foreach(variant IN ITEMS client server)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/drivers/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
irods_filesystem_${variant}
Expand Down
2 changes: 1 addition & 1 deletion lib/metadata/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ foreach(variant IN ITEMS server client)
target_link_libraries(
irods_lib_metadata_${variant}
PUBLIC
fmt::fmt
irods_lib_api_${variant}
irods_lib_core_${variant}
irods_filesystem_${variant}
Expand All @@ -25,7 +26,6 @@ foreach(variant IN ITEMS server client)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/lib/rbudp/include>"
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
)
target_compile_definitions(
irods_lib_metadata_${variant}
Expand Down
3 changes: 1 addition & 2 deletions plugins/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ foreach(plugin IN LISTS IRODS_API_PLUGINS)
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/lib/libarchive.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
"${IRODS_EXTERNALS_FULLPATH_NANODBC}/lib/libnanodbc.so"
nlohmann_json::nlohmann_json
fmt::fmt
)
target_include_directories(
${plugin_target}
Expand All @@ -70,7 +70,6 @@ foreach(plugin IN LISTS IRODS_API_PLUGINS)
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/api/include>"
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_NANODBC}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
Expand Down
3 changes: 1 addition & 2 deletions plugins/auth/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ foreach(plugin IN LISTS IRODS_AUTH_PLUGINS)
irods_${variant}
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
nlohmann_json::nlohmann_json
fmt::fmt
OpenSSL::Crypto
${CMAKE_DL_LIBS}
)
Expand All @@ -43,7 +43,6 @@ foreach(plugin IN LISTS IRODS_AUTH_PLUGINS)
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/api/include>"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
3 changes: 1 addition & 2 deletions plugins/auth_legacy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ foreach(plugin IN LISTS IRODS_AUTH_LEGACY_PLUGINS)
irods_${variant}
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
nlohmann_json::nlohmann_json
fmt::fmt
OpenSSL::Crypto
${CMAKE_DL_LIBS}
)
Expand All @@ -44,7 +44,6 @@ foreach(plugin IN LISTS IRODS_AUTH_LEGACY_PLUGINS)
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_IRODS_SOURCE_DIR}/server/api/include>"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
3 changes: 1 addition & 2 deletions plugins/database/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,16 +69,15 @@ foreach(plugin IN LISTS IRODS_DATABASE_PLUGINS)
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_regex.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
"${IRODS_EXTERNALS_FULLPATH_NANODBC}/lib/libnanodbc.so"
fmt::fmt
${ODBC_LIBRARY}
)
target_include_directories(
${plugin_target}
PRIVATE
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_NANODBC}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
Expand Down
3 changes: 1 addition & 2 deletions plugins/experimental/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ foreach(plugin IN LISTS IRODS_EXPERIMENTAL_API_PLUGINS)
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/lib/libarchive.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
fmt::fmt
${CMAKE_DL_LIBS}
)
target_include_directories(
Expand All @@ -40,7 +40,6 @@ foreach(plugin IN LISTS IRODS_EXPERIMENTAL_API_PLUGINS)
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
3 changes: 1 addition & 2 deletions plugins/microservices/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,12 @@ foreach(plugin IN LISTS IRODS_MICROSERVICE_PLUGINS)
irods_server
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
fmt::fmt
)
target_include_directories(
${plugin_target}
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
3 changes: 1 addition & 2 deletions plugins/network/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@ foreach(plugin IN LISTS IRODS_NETWORK_PLUGINS)
irods_${variant}
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
fmt::fmt
OpenSSL::SSL
OpenSSL::Crypto
)
target_include_directories(
${plugin_target}
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
3 changes: 1 addition & 2 deletions plugins/resources/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -45,15 +45,14 @@ foreach(plugin IN LISTS IRODS_RESOURCE_PLUGINS)
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/lib/libarchive.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
fmt::fmt
OpenSSL::Crypto
)
target_include_directories(
${plugin_target}
PRIVATE
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
3 changes: 1 addition & 2 deletions plugins/resources/replication/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ target_link_libraries(
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/lib/libarchive.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_filesystem.so"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/lib/libboost_system.so"
"${IRODS_EXTERNALS_FULLPATH_FMT}/lib/libfmt.so"
fmt::fmt
OpenSSL::Crypto
)
target_include_directories(
Expand All @@ -29,7 +29,6 @@ target_include_directories(
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"${IRODS_EXTERNALS_FULLPATH_ARCHIVE}/include"
"${IRODS_EXTERNALS_FULLPATH_BOOST}/include"
"${IRODS_EXTERNALS_FULLPATH_FMT}/include"
"${IRODS_EXTERNALS_FULLPATH_SPDLOG}/include"
)
target_compile_definitions(
Expand Down
Loading

0 comments on commit b32b11b

Please sign in to comment.