From 50a750ab2d11b7d03d18c295ddf8222289b9f29f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Madar=C3=A1sz?= Date: Tue, 19 Jan 2021 12:02:17 +0100 Subject: [PATCH] code: move raylib to FindRaylib.cmake --- code/apps/client/CMakeLists.txt | 21 +-------------------- code/apps/client/FindRaylib.cmake | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+), 20 deletions(-) create mode 100644 code/apps/client/FindRaylib.cmake diff --git a/code/apps/client/CMakeLists.txt b/code/apps/client/CMakeLists.txt index 6d73f40..72f5777 100644 --- a/code/apps/client/CMakeLists.txt +++ b/code/apps/client/CMakeLists.txt @@ -1,23 +1,4 @@ -find_package(raylib 3.5 QUIET) - -if (NOT raylib_FOUND) - include(FetchContent) - - FetchContent_Declare( - raylib - URL https://github.com/raysan5/raylib/archive/master.tar.gz - ) - - FetchContent_GetProperties(raylib) - if (NOT raylib_POPULATED) - set(FETCHCONTENT_QUIET NO) - FetchContent_Populate(raylib) - - set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) - - add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR}) - endif() -endif() +include(FindRaylib.cmake) add_library(client-common STATIC source/network.c diff --git a/code/apps/client/FindRaylib.cmake b/code/apps/client/FindRaylib.cmake new file mode 100644 index 0000000..b181916 --- /dev/null +++ b/code/apps/client/FindRaylib.cmake @@ -0,0 +1,20 @@ +find_package(raylib 3.5 QUIET) + +if (NOT raylib_FOUND) + include(FetchContent) + + FetchContent_Declare( + raylib + URL https://github.com/raysan5/raylib/archive/master.tar.gz + ) + + FetchContent_GetProperties(raylib) + if (NOT raylib_POPULATED) + set(FETCHCONTENT_QUIET NO) + FetchContent_Populate(raylib) + + set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) + + add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR}) + endif() +endif()