@@ -17,31 +17,6 @@ if (${CANDY_STATIC})
1717 set (CANDY_STATIC_POCO 1)
1818endif ()
1919
20- macro (Fetch NAME GIT_REPOSITORY GIT_TAG)
21- include (FetchContent)
22- if (${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.28" )
23- FetchContent_Declare(
24- ${NAME}
25- GIT_REPOSITORY ${GIT_REPOSITORY}
26- GIT_TAG ${GIT_TAG}
27- EXCLUDE_FROM_ALL
28- )
29- FetchContent_MakeAvailable(${NAME} )
30- else ()
31- FetchContent_Declare(
32- ${NAME}
33- GIT_REPOSITORY ${GIT_REPOSITORY}
34- GIT_TAG ${GIT_TAG}
35- )
36- FetchContent_GetProperties(${NAME} )
37- if (NOT ${NAME} _POPULATED)
38- FetchContent_Populate(${NAME} )
39- add_subdirectory (${${NAME} _SOURCE_DIR} ${${NAME} _BINARY_DIR} EXCLUDE_FROM_ALL )
40- endif ()
41- endif ()
42- endmacro ()
43-
44-
4520if (${CANDY_STATIC_OPENSSL} )
4621 execute_process (
4722 COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_BINARY_DIR} /openssl
@@ -86,10 +61,12 @@ if (${CANDY_STATIC_OPENSSL})
8661endif ()
8762
8863if (${CANDY_STATIC_FMT} )
64+ include (${CMAKE_CURRENT_SOURCE_DIR} /cmake/Fetch.cmake)
8965 Fetch(fmt "https://github.com/fmtlib/fmt.git" "10.2.1" )
9066endif ()
9167
9268if (${CANDY_STATIC_SPDLOG} )
69+ include (${CMAKE_CURRENT_SOURCE_DIR} /cmake/Fetch.cmake)
9370 Fetch(spdlog "https://github.com/gabime/spdlog.git" "v1.14.1" )
9471endif ()
9572
@@ -109,6 +86,7 @@ if (${CANDY_STATIC_POCO})
10986 set (ENABLE_ACTIVERECORD_COMPILER OFF CACHE BOOL "" FORCE)
11087 set (ENABLE_ZIP OFF CACHE BOOL "" FORCE)
11188 set (ENABLE_JWT OFF CACHE BOOL "" FORCE)
89+ include (${CMAKE_CURRENT_SOURCE_DIR} /cmake/Fetch.cmake)
11290 Fetch(poco "https://github.com/pocoproject/poco.git" "poco-1.13.3-release" )
11391endif ()
11492
0 commit comments