From 335ec9b4ec1d9006f6b551f8338fddbcd36a8568 Mon Sep 17 00:00:00 2001 From: Aki Date: Thu, 16 Mar 2023 19:08:20 +0100 Subject: Switched back to custom MakeAvailable --- contrib/CMakeLists.txt | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 19efd3a..3d98ee4 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -1,11 +1,13 @@ add_subdirectory(imgui) -function(MakeAvailable DEPNAME) - string(TOLOWER "${DEPNAME}" DEPNAME) - FetchContent_GetProperties(${DEPNAME}) - if(NOT ${DEPNAME}_POPULATED) - FetchContent_Populate(${DEPNAME}) - add_subdirectory(${${DEPNAME}_SOURCE_DIR} ${${DEPNAME}_BINARY_DIR} EXCLUDE_FROM_ALL) - endif() +function(MakeAvailable) + foreach(DEPNAME IN LISTS ARGN) + string(TOLOWER "${DEPNAME}" DEPNAME) + FetchContent_GetProperties(${DEPNAME}) + if(NOT ${DEPNAME}_POPULATED) + FetchContent_Populate(${DEPNAME}) + add_subdirectory(${${DEPNAME}_SOURCE_DIR} ${${DEPNAME}_BINARY_DIR} EXCLUDE_FROM_ALL) + endif() + endforeach() endfunction() set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "") set(ENTT_USE_LIBCPP OFF CACHE INTERNAL "") @@ -44,7 +46,4 @@ FetchContent_Declare( GIT_SHALLOW Yes OVERRIDE_FIND_PACKAGE ) -find_package(EnTT REQUIRED 3) -find_package(GTest REQUIRED 1) -find_package(nlohmann_json REQUIRED 3) -find_package(raylib REQUIRED 4) +MakeAvailable(EnTT GTest nlohmann_json raylib) -- cgit v1.1