@@ -11,16 +11,23 @@ endif()
1111
1212function (find_package_or_fetch)
1313 set (options )
14- set (oneValueArgs PACKAGE_NAME VERSION GIT_REPOSITORY TAG)
14+ set (oneValueArgs CONAN_PKG_NAME PACKAGE_NAME VERSION GIT_REPOSITORY TAG)
1515 set (multiValueArgs)
1616 cmake_parse_arguments (PARSE_ARGV 0 arg
1717 "${options} " "${oneValueArgs} " "${multiValueArgs} "
1818 )
19+
20+ set (actual_pkg_name ${arg_PACKAGE_NAME} )
21+ if (arg_CONAN_PKG_NAME)
22+ set (actual_pkg_name ${arg_CONAN_PKG_NAME} )
23+ endif ()
24+
1925 if (NOT FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON" )
20- find_package (${arg_PACKAGE_NAME } ${FIND_PACKAGE_OPTIONS} )
26+ find_package (${actual_pkg_name } ${FIND_PACKAGE_OPTIONS} )
2127 endif ()
28+
2229 if (FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "ON" OR FETCH_DEPENDENCIES_WITH_CMAKE STREQUAL "MISSING" )
23- if (NOT ${arg_PACKAGE_NAME } _FOUND)
30+ if (NOT ${actual_pkg_name } _FOUND)
2431 message (STATUS "📦 Fetching ${arg_PACKAGE_NAME} " )
2532 FetchContent_Declare(
2633 ${arg_PACKAGE_NAME}
@@ -33,7 +40,7 @@ function(find_package_or_fetch)
3340 FetchContent_MakeAvailable(${arg_PACKAGE_NAME} )
3441 message (STATUS "\t ✅ Fetched ${arg_PACKAGE_NAME} " )
3542 else ()
36- message (STATUS "📦 ${arg_PACKAGE_NAME } found here: ${arg_PACKAGE_NAME } _DIR" )
43+ message (STATUS "📦 ${actual_pkg_name } found here: ${actual_pkg_name } _DIR" )
3744 endif ()
3845 endif ()
3946endfunction ()
@@ -53,6 +60,7 @@ endif()
5360set (FLATBUFFERS_BUILD_TESTS OFF )
5461set (FLATBUFFERS_BUILD_SHAREDLIB ${SPARROW_IPC_BUILD_SHARED} )
5562find_package_or_fetch(
63+ CONAN_PKG_NAME flatbuffers
5664 PACKAGE_NAME FlatBuffers
5765 VERSION v25.2.10
5866 GIT_REPOSITORY https://github.com/google/flatbuffers.git
@@ -71,4 +79,4 @@ if(SPARROW_IPC_BUILD_TESTS)
7179 GIT_REPOSITORY https://github.com/doctest/doctest.git
7280 TAG v2.4.12
7381 )
74- endif ()
82+ endif ()
0 commit comments