Skip to content

Commit

Permalink
download git on build instead of submodule and ignore version check (…
Browse files Browse the repository at this point in the history
…related to RobLoach#98)
  • Loading branch information
konsumer committed Nov 22, 2021
1 parent 1178a31 commit 7cdf04c
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
3 changes: 0 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
[submodule "vendor/raylib"]
path = vendor/raylib
url = https://github.com/raysan5/raylib.git
22 changes: 17 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
include(FetchContent)

cmake_minimum_required(VERSION 3.11)
project (node-raylib
VERSION 0.8.0
Expand All @@ -20,12 +22,22 @@ endif()
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

# TODO: Move this to cmake/FindRaylib.cmake?
find_package(raylib 3.5.0)
# version doesn't seem to pick correct version
#find_package(raylib 3.5 QUIET EXACT)
if (NOT raylib_FOUND)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples
set(BUILD_GAMES OFF CACHE BOOL "" FORCE) # or games
add_subdirectory(vendor/raylib)
include(FetchContent)
FetchContent_Declare(
raylib
GIT_REPOSITORY https://github.com/raysan5/raylib.git
GIT_TAG 3.5.0
)
FetchContent_GetProperties(raylib)
if (NOT raylib_POPULATED)
set(FETCHCONTENT_QUIET NO)
FetchContent_Populate(raylib)
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
add_subdirectory(${raylib_SOURCE_DIR} ${raylib_BINARY_DIR})
endif()
endif()

# Add all the include directories.
Expand Down
1 change: 0 additions & 1 deletion vendor/raylib
Submodule raylib deleted from e25e38

0 comments on commit 7cdf04c

Please sign in to comment.