summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2023-03-13 23:35:10 +0100
committerAki <please@ignore.pl>2024-04-05 19:40:50 +0200
commitf2bb61bce004163aacd1aad390f0eabfb5db9963 (patch)
tree51d330dea7228caa137f27a2e98bf3137e151a0e
parent6a962253fe0cc39183e2584948d5adec09639b7e (diff)
downloadkurator-f2bb61bce004163aacd1aad390f0eabfb5db9963.zip
kurator-f2bb61bce004163aacd1aad390f0eabfb5db9963.tar.gz
kurator-f2bb61bce004163aacd1aad390f0eabfb5db9963.tar.bz2
Use FetchContent to handle dependencies
-rw-r--r--.gitlab-ci.yml12
-rw-r--r--CMakeLists.txt9
-rw-r--r--contrib/CMakeLists.txt32
3 files changed, 47 insertions, 6 deletions
diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 53fc7bd..8337c56 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -14,6 +14,12 @@ build-linux:
artifacts:
paths:
- build-linux/
+ cache:
+ key:
+ files:
+ - contrib/CMakeLists.txt
+ paths:
+ - build-linux/_deps
build-windows:
stage: build
@@ -23,6 +29,12 @@ build-windows:
artifacts:
paths:
- build-windows/
+ cache:
+ key:
+ files:
+ - contrib/CMakeLists.txt
+ paths:
+ - build-windows/_deps
test-linux:
stage: test
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e07cd2c..fee45df 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,16 +8,13 @@ set(STEAM_APPID $ENV{STEAM_APPID} CACHE STRING "App ID for steam deployment")
set(STEAM_DEPOTID_WINDOWS $ENV{STEAM_DEPOTID_WINDOWS} CACHE STRING "Steam Depot ID for Windows builds")
set(STEAM_DEPOTID_LINUX $ENV{STEAM_DEPOTID_LINUX} CACHE STRING "Steam Depot ID for Linux builds")
set(CMAKE_INSTALL_BINDIR .)
-set(raylib_USE_STATIC_LIBS Yes)
enable_testing()
-find_package(EnTT 3 REQUIRED)
-find_package(GTest 1 REQUIRED)
-find_package(nlohmann_json 3 REQUIRED)
-find_package(raylib 4 REQUIRED)
include(AddResources)
include(AddVersionFile)
+include(FetchContent)
+include(GoogleTest)
+add_subdirectory(contrib) # Out of order to handle dependencies.
add_subdirectory(campaign)
-add_subdirectory(contrib)
add_subdirectory(engine)
add_subdirectory(kurator)
add_subdirectory(sim)
diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt
index a61ecb5..97b0708 100644
--- a/contrib/CMakeLists.txt
+++ b/contrib/CMakeLists.txt
@@ -1 +1,33 @@
+set(BUILD_SHARED_LIBS No)
+set(BUILD_GMOCK No)
+set(INSTALL_GTEST No)
add_subdirectory(imgui)
+FetchContent_Declare(
+ EnTT
+ GIT_REPOSITORY https://github.com/skypjack/entt.git
+ GIT_TAG v3.11.1
+ GIT_SHALLOW Yes
+ OVERRIDE_FIND_PACKAGE
+)
+FetchContent_Declare(
+ GTest
+ GIT_REPOSITORY https://github.com/google/googletest.git
+ GIT_TAG v1.13.0
+ GIT_SHALLOW Yes
+ OVERRIDE_FIND_PACKAGE
+)
+FetchContent_Declare(
+ nlohmann_json
+ GIT_REPOSITORY https://github.com/nlohmann/json.git
+ GIT_TAG v3.11.2
+ GIT_SHALLOW Yes
+ OVERRIDE_FIND_PACKAGE
+)
+FetchContent_Declare(
+ raylib
+ GIT_REPOSITORY https://github.com/raysan5/raylib.git
+ GIT_TAG 4.2.0
+ GIT_SHALLOW Yes
+ OVERRIDE_FIND_PACKAGE
+)
+FetchContent_MakeAvailable(EnTT GTest nlohmann_json raylib)