@@ -26,21 +26,32 @@ function(find_package_or_fetch)
2626 find_package (${actual_pkg_name} ${FIND_PACKAGE_OPTIONS} )
2727 endif ()
2828
29- if (FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON" OR FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "MISSING" )
30- if (NOT ${actual_pkg_name} _FOUND)
31- message (STATUS "📦 Fetching ${arg_PACKAGE_NAME} " )
32- FetchContent_Declare(
33- ${arg_PACKAGE_NAME}
34- GIT_SHALLOW TRUE
35- GIT_REPOSITORY ${arg_GIT_REPOSITORY}
36- GIT_TAG ${arg_TAG}
37- GIT_PROGRESS TRUE
38- SYSTEM
39- EXCLUDE_FROM_ALL )
40- FetchContent_MakeAvailable(${arg_PACKAGE_NAME} )
41- message (STATUS "\t ✅ Fetched ${arg_PACKAGE_NAME} " )
42- else ()
29+ if (arg_GIT_REPOSITORY)
30+ if (FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON" OR FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "MISSING" )
31+ if (NOT ${actual_pkg_name} _FOUND)
32+ message (STATUS "📦 Fetching ${arg_PACKAGE_NAME} " )
33+ FetchContent_Declare(
34+ ${arg_PACKAGE_NAME}
35+ GIT_SHALLOW TRUE
36+ GIT_REPOSITORY ${arg_GIT_REPOSITORY}
37+ GIT_TAG ${arg_TAG}
38+ GIT_PROGRESS TRUE
39+ SYSTEM
40+ EXCLUDE_FROM_ALL )
41+ FetchContent_MakeAvailable(${arg_PACKAGE_NAME} )
42+ message (STATUS "\t ✅ Fetched ${arg_PACKAGE_NAME} " )
43+ else ()
44+ message (STATUS "📦 ${actual_pkg_name} found here: ${${actual_pkg_name} _DIR}" )
45+ endif ()
46+ endif ()
47+ else ()
48+ # No GIT_REPOSITORY provided - only find_package is attempted
49+ if (${actual_pkg_name} _FOUND)
4350 message (STATUS "📦 ${actual_pkg_name} found here: ${${actual_pkg_name} _DIR}" )
51+ elseif (FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "OFF" )
52+ message (FATAL_ERROR "Could not find ${actual_pkg_name} and no GIT_REPOSITORY provided for fetching" )
53+ else ()
54+ message (WARNING "Could not find ${actual_pkg_name} and no GIT_REPOSITORY provided for fetching" )
4455 endif ()
4556 endif ()
4657endfunction ()
@@ -52,14 +63,17 @@ endif()
5263find_package_or_fetch(
5364 PACKAGE_NAME sparrow
5465 GIT_REPOSITORY https://github.com/man-group/sparrow.git
55- TAG 1.2 .0
66+ TAG 1.3 .0
5667)
5768unset (CREATE_JSON_READER_TARGET)
5869
5970if (NOT TARGET sparrow::sparrow)
6071 add_library (sparrow::sparrow ALIAS sparrow)
6172endif ()
6273if (${SPARROW_IPC_BUILD_TESTS} )
74+ find_package_or_fetch(
75+ PACKAGE_NAME sparrow-json-reader
76+ )
6377 if (NOT TARGET sparrow::json_reader)
6478 add_library (sparrow::json_reader ALIAS json_reader)
6579 endif ()
0 commit comments