diff --git a/CMakeLists.txt b/CMakeLists.txt index 5647d93..f6eb3a6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,8 +5,28 @@ project(kubo LANGUAGES C) set(CMAKE_C_STANDARD 99) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) -set(RAYLIB_VERSION 5.5) -find_package(raylib ${RAYLIB_VERSION} REQUIRED) +option(USE_SYSTEM_RAYLIB "Use system-installed raylib instead of downloading" OFF) + +if(USE_SYSTEM_RAYLIB) + set(RAYLIB_VERSION 5.5) + find_package(raylib ${RAYLIB_VERSION} REQUIRED) +else() + include(FetchContent) + set(FETCHCONTENT_QUIET FALSE) + set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples + set(BUILD_GAMES OFF CACHE BOOL "" FORCE) # don't build the supplied example games + set(GLFW_BUILD_WAYLAND "Build the bundled GLFW with Wayland support" ON) + set(GLFW_BUILD_X11 "Build the bundled GLFW with X11 support" ON) + + FetchContent_Declare( + raylib + GIT_REPOSITORY "https://github.com/raysan5/raylib.git" + GIT_TAG "master" + GIT_PROGRESS TRUE + ) + + FetchContent_MakeAvailable(raylib) +endif() set(SOURCES kubo_command.c