summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/CMakeLists.txt27
1 files changed, 21 insertions, 6 deletions
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index faee8bf..19efd3a 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -1,9 +1,15 @@
-set(BUILD_SHARED_LIBS No)
-set(BUILD_GMOCK No)
-set(INSTALL_GTEST No)
-set(USE_EXTERNAL_GLFW Off)
-set(OpenGL_GL_PREFERENCE GLVND)
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()
+endfunction()
+set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "")
+set(ENTT_USE_LIBCPP OFF CACHE INTERNAL "")
+set(ENTT_BUILD_TESTING OFF CACHE INTERNAL "")
FetchContent_Declare(
EnTT
GIT_REPOSITORY https://github.com/skypjack/entt.git
@@ -11,6 +17,8 @@ FetchContent_Declare(
GIT_SHALLOW Yes
OVERRIDE_FIND_PACKAGE
)
+set(BUILD_GMOCK OFF CACHE INTERNAL "")
+set(INSTALL_GTEST OFF CACHE INTERNAL "")
FetchContent_Declare(
GTest
GIT_REPOSITORY https://github.com/google/googletest.git
@@ -18,6 +26,7 @@ FetchContent_Declare(
GIT_SHALLOW Yes
OVERRIDE_FIND_PACKAGE
)
+set(JSON_MultipleHeaders ON CACHE INTERNAL "")
FetchContent_Declare(
nlohmann_json
GIT_REPOSITORY https://github.com/nlohmann/json.git
@@ -25,6 +34,9 @@ FetchContent_Declare(
GIT_SHALLOW Yes
OVERRIDE_FIND_PACKAGE
)
+set(CMAKE_BUILD_TYPE Release CACHE INTERNAL "")
+set(OpenGL_GL_PREFERENCE GLVND CACHE INTERNAL "")
+set(USE_EXTERNAL_GLFW OFF CACHE INTERNAL "")
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
@@ -32,4 +44,7 @@ FetchContent_Declare(
GIT_SHALLOW Yes
OVERRIDE_FIND_PACKAGE
)
-FetchContent_MakeAvailable(EnTT GTest nlohmann_json raylib)
+find_package(EnTT REQUIRED 3)
+find_package(GTest REQUIRED 1)
+find_package(nlohmann_json REQUIRED 3)
+find_package(raylib REQUIRED 4)