-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
40 lines (28 loc) · 1.29 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
cmake_minimum_required(VERSION 3.11) # FetchContent is available in 3.11+
project(music_tiles)
# Set this to the minimal version you want to support
find_package(raylib 3.0 QUIET) # Let CMake search for a raylib-config.cmake
# You could change the QUIET above to REQUIRED and remove this if() clause
# This part downloads raylib and builds it if it's not installed on your system
if (NOT raylib_FOUND) # If there's none, fetch and build raylib
include(FetchContent)
FetchContent_Declare(
raylib
URL https://github.com/raysan5/raylib/archive/3.0.0.tar.gz
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED) # Have we downloaded raylib yet?
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(raylib)
set(BUILD_GAMES OFF CACHE BOOL "" FORCE) # don't build the supplied examples
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples
# build raylib
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
endif()
endif()
# This is the main part:
add_subdirectory(src)
set(raylib_VERBOSE 1)
# Copy audio directory to build directory
file(COPY ${CMAKE_SOURCE_DIR}/audio DESTINATION ${CMAKE_BINARY_DIR}/release)
file(COPY ${CMAKE_SOURCE_DIR}/sheet DESTINATION ${CMAKE_BINARY_DIR}/release)