Update CMakeLists.txt

This commit is contained in:
Maple Redleaf
2025-12-12 11:19:05 -06:00
parent 99f769a79b
commit 795b54a90a

View File

@@ -7,8 +7,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Dependencies # Dependencies
set(RAYLIB_VERSION 5.5) set(RAYLIB_VERSION 5.5)
find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED
if(NOT raylib_FOUND) # If there's none, fetch and build raylib include(FetchContent)
include(FetchContent) set(FETCHCONTENT_QUIET NO)
if(NOT raylib_DIR) # If there's none, fetch and build raylib
FetchContent_Declare( FetchContent_Declare(
raylib raylib
DOWNLOAD_EXTRACT_TIMESTAMP OFF DOWNLOAD_EXTRACT_TIMESTAMP OFF
@@ -16,26 +17,16 @@ if(NOT raylib_FOUND) # If there's none, fetch and build raylib
) )
FetchContent_GetProperties(raylib) FetchContent_GetProperties(raylib)
if(NOT raylib_POPULATED) # Have we downloaded raylib yet? if(NOT raylib_POPULATED) # Have we downloaded raylib yet?
set(FETCHCONTENT_QUIET NO)
FetchContent_MakeAvailable(raylib) FetchContent_MakeAvailable(raylib)
endif() endif()
endif() endif()
set(RAYLIB_CPP_VERSION "v5.5.0") FetchContent_Declare(
find_package(raylib_cpp QUIET) # QUIET or REQUIRED
if(NOT raylib_cpp_FOUND) # If there's none, fetch and build raylib
include(FetchContent)
FetchContent_Declare(
raylib_cpp raylib_cpp
DOWNLOAD_EXTRACT_TIMESTAMP OFF GIT_REPOSITORY https://github.com/RobLoach/raylib-cpp.git
URL https://github.com/RobLoach/raylib-cpp/archive/refs/tags/${RAYLIB_CPP_VERSION}.tar.gz GIT_TAG master
) )
FetchContent_GetProperties(raylib_cpp) FetchContent_MakeAvailable(raylib_cpp)
if(NOT raylib_cpp_POPULATED) # Have we downloaded raylib yet?
set(FETCHCONTENT_QUIET NO)
FetchContent_MakeAvailable(raylib_cpp)
endif()
endif()
# Our Project # Our Project
add_executable(${PROJECT_NAME}) add_executable(${PROJECT_NAME})