mirror of
https://github.com/allankoechke/raylib-cpp.git
synced 2026-12-04 17:17:35 +00:00
Update the cmake include vendor project
This commit is contained in:
1
.gitmodules
vendored
1
.gitmodules
vendored
@@ -1,3 +1,4 @@
|
||||
[submodule "vendor/raylib"]
|
||||
path = vendor/raylib
|
||||
url = https://github.com/raysan5/raylib.git
|
||||
ignore = dirty
|
||||
|
||||
@@ -6,14 +6,6 @@ project (raylib-cpp
|
||||
HOMEPAGE_URL "https://github.com/robloach/raylib-cpp"
|
||||
LANGUAGES C CXX)
|
||||
|
||||
# raylib
|
||||
find_package(raylib 3.0.0 QUIET)
|
||||
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)
|
||||
endif()
|
||||
|
||||
# Options
|
||||
option(BUILD_RAYLIB_CPP_STATIC "Static Library" ON)
|
||||
option(BUILD_RAYLIB_CPP_EXAMPLES "Examples" ON)
|
||||
@@ -21,14 +13,15 @@ option(BUILD_RAYLIB_CPP_EXAMPLES "Examples" ON)
|
||||
# Include Directory
|
||||
add_subdirectory(include)
|
||||
|
||||
# Static Library
|
||||
if(BUILD_RAYLIB_CPP_STATIC)
|
||||
add_subdirectory(lib)
|
||||
endif()
|
||||
|
||||
# Examples
|
||||
if(BUILD_RAYLIB_CPP_EXAMPLES)
|
||||
add_subdirectory(examples)
|
||||
set(BUILD_RAYLIB_CPP_STATIC ON)
|
||||
endif()
|
||||
|
||||
# Static Library
|
||||
if(BUILD_RAYLIB_CPP_STATIC)
|
||||
add_subdirectory(lib)
|
||||
endif()
|
||||
|
||||
# Testing
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
find_package(Raylib)
|
||||
|
||||
# Get the sources together
|
||||
set(example_dirs audio core models shapes text textures)
|
||||
set(example_sources)
|
||||
@@ -23,6 +21,7 @@ foreach(example_source ${example_sources})
|
||||
# Setup the example
|
||||
add_executable(${example_name} ${example_source})
|
||||
|
||||
# Link against the static library.
|
||||
target_link_libraries(${example_name} PUBLIC libraylib-cpp)
|
||||
|
||||
string(REGEX MATCH ".*/.*/" resources_dir ${example_source})
|
||||
|
||||
@@ -1,6 +1,14 @@
|
||||
# libraylib-cpp static library
|
||||
add_library(libraylib-cpp STATIC libraylib-cpp)
|
||||
|
||||
# raylib
|
||||
find_package(raylib 3.0.0 QUIET)
|
||||
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(${CMAKE_CURRENT_SOURCE_DIR}/../vendor/raylib ${CMAKE_CURRENT_SOURCE_DIR}/../vendor/raylib)
|
||||
endif()
|
||||
|
||||
# Link raylib and raylib-cpp
|
||||
target_link_libraries(libraylib-cpp PUBLIC raylib raylib-cpp)
|
||||
|
||||
|
||||
@@ -34,9 +34,9 @@ if (NOT raylib-cpp_FOUND)
|
||||
if (NOT raylib-cpp_POPULATED) # Have we downloaded raylib yet?
|
||||
set(FETCHCONTENT_QUIET NO)
|
||||
FetchContent_Populate(raylib-cpp)
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_GAMES OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_RAYLIB_CPP_STATIC OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_RAYLIB_CPP_EXAMPLES OFF CACHE BOOL "" FORCE)
|
||||
set(BUILD_TESTING OFF CACHE BOOL "" FORCE)
|
||||
add_subdirectory(${raylib-cpp_SOURCE_DIR} ${raylib-cpp_BINARY_DIR})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@@ -28,8 +28,6 @@ macro(ADD_CATCH_TESTS executable)
|
||||
endforeach()
|
||||
endmacro()
|
||||
|
||||
find_package(Raylib)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CTEST_CUSTOM_TESTS_IGNORE pkg-config--static)
|
||||
|
||||
Reference in New Issue
Block a user