cmake option to download raylib
This commit is contained in:
parent
ecc8a1df95
commit
d94e24f63a
1 changed files with 22 additions and 2 deletions
|
|
@ -5,8 +5,28 @@ project(kubo LANGUAGES C)
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
|
|
||||||
set(RAYLIB_VERSION 5.5)
|
option(USE_SYSTEM_RAYLIB "Use system-installed raylib instead of downloading" OFF)
|
||||||
find_package(raylib ${RAYLIB_VERSION} REQUIRED)
|
|
||||||
|
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
|
set(SOURCES
|
||||||
kubo_command.c
|
kubo_command.c
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue