瀏覽代碼

CMake: Project template fix to easily target raylib version (#2700)

pull/2703/head
Rob Loach 2 年之前
committed by GitHub
父節點
當前提交
4c3d577ddb
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增2 行删除
  1. +3
    -2
      projects/CMake/CMakeLists.txt

+ 3
- 2
projects/CMake/CMakeLists.txt 查看文件

@ -5,12 +5,13 @@ project(example)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
# Dependencies
find_package(raylib 4.2.0 QUIET) # QUIET or REQUIRED
set(RAYLIB_VERSION 4.2.0)
find_package(raylib ${RAYLIB_VERSION} QUIET) # QUIET or REQUIRED
if (NOT raylib_FOUND) # If there's none, fetch and build raylib
include(FetchContent)
FetchContent_Declare(
raylib
URL https://github.com/raysan5/raylib/archive/refs/tags/4.0.0.tar.gz
URL https://github.com/raysan5/raylib/archive/refs/tags/${RAYLIB_VERSION}.tar.gz
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?

Loading…
取消
儲存