Skip to content

Commit

Permalink
cmake: Update to comply with CMP0169
Browse files Browse the repository at this point in the history
  • Loading branch information
Tectu committed Dec 30, 2024
1 parent 121a814 commit d0be2fe
Showing 1 changed file with 9 additions and 18 deletions.
27 changes: 9 additions & 18 deletions lib/malloy/core/external.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,17 @@ find_package(
# fmt
########################################################################################################################
if (MALLOY_DEPENDENCY_FMT_DOWNLOAD)
set(MALLOY_TMP_VAR1 ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS ${MALLOY_BUILD_SHARED}) # fmt has no specific shared option

FetchContent_Declare(
fmt
GIT_REPOSITORY https://github.com/fmtlib/fmt
GIT_TAG 10.1.1
)
FetchContent_GetProperties(fmt)
if (NOT fmt_POPULATED)
FetchContent_Populate(fmt)
set(MALLOY_TMP_VAR1 ${BUILD_SHARED_LIBS})
set(BUILD_SHARED_LIBS ${MALLOY_BUILD_SHARED}) # fmt has no specific shared option

add_subdirectory(${fmt_SOURCE_DIR} ${fmt_BINARY_DIR})

set(BUILD_SHARED_LIBS ${MALLOY_TMP_VAR1})
FetchContent_MakeAvailable(fmt)

endif()
set(BUILD_SHARED_LIBS ${MALLOY_TMP_VAR1})
else()
find_package(fmt REQUIRED)
endif()
Expand All @@ -43,19 +38,15 @@ endif()
# spdlog
########################################################################################################################
if (MALLOY_DEPENDENCY_SPDLOG_DOWNLOAD)
set(SPDLOG_BUILD_SHARED ${MALLOY_BUILD_SHARED} CACHE INTERNAL "")
set(SPDLOG_FMT_EXTERNAL ON CACHE INTERNAL "")

FetchContent_Declare(
spdlog
GIT_REPOSITORY https://github.com/gabime/spdlog
GIT_TAG v1.x
)
FetchContent_GetProperties(spdlog)
if (NOT spdlog_POPULATED)
FetchContent_Populate(spdlog)
set(SPDLOG_BUILD_SHARED ${MALLOY_BUILD_SHARED} CACHE INTERNAL "")
set(SPDLOG_FMT_EXTERNAL ON CACHE INTERNAL "")

add_subdirectory(${spdlog_SOURCE_DIR} ${spdlog_BINARY_DIR})
endif()
FetchContent_MakeAvailable(spdlog)
else()
find_package(spdlog REQUIRED)
endif()
Expand Down

0 comments on commit d0be2fe

Please sign in to comment.