diff options
-rw-r--r-- | .editorconfig | 4 | ||||
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | CMakeLists.txt | 19 | ||||
-rw-r--r-- | libs/CMakeLists.txt | 9 | ||||
m--------- | libs/raylib | 0 |
5 files changed, 18 insertions, 17 deletions
diff --git a/.editorconfig b/.editorconfig index 335540e..3ab36f3 100644 --- a/.editorconfig +++ b/.editorconfig @@ -8,3 +8,7 @@ insert_final_newline = true [*.{c,h}] indent_style = space indent_size = 2 + +[CMake*.txt] +indent_style = space +indent_size = 2 diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..c3b76a7 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "libs/raylib"] + path = libs/raylib + url = https://github.com/raysan5/raylib.git diff --git a/CMakeLists.txt b/CMakeLists.txt index db4081d..8be905e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,23 +2,8 @@ cmake_minimum_required(VERSION 3.0) project(slgj C) set(CMAKE_C_STANDARD 99) -# the `pkg_check_modules` function is created with this call -find_package(PkgConfig REQUIRED) - -# Adding Raylib -include(FetchContent) -set(FETCHCONTENT_QUIET FALSE) -set(BUILD_EXAMPLES OFF CACHE BOOL "" FORCE) # don't build the supplied examples -set(BUILD_GAMES OFF CACHE BOOL "" FORCE) # don't build the supplied example games - -FetchContent_Declare( - raylib - GIT_REPOSITORY "https://github.com/raysan5/raylib.git" - GIT_TAG "master" - GIT_PROGRESS TRUE -) - -FetchContent_MakeAvailable(raylib) +# Third party libs (currently only raylib) +add_subdirectory(libs) # Adding our source files file(GLOB_RECURSE PROJECT_SOURCES CONFIGURE_DEPENDS "${CMAKE_CURRENT_LIST_DIR}/sources/*.c") # Define PROJECT_SOURCES as a list of all source files diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt new file mode 100644 index 0000000..4b4489c --- /dev/null +++ b/libs/CMakeLists.txt @@ -0,0 +1,9 @@ +set(BUILD_SHARED_LIBS OFF) # link third party libraries statically + +# raylib +if(NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/raylib") + message(FATAL_ERROR "Could not find raylib folder. Did you clone the Git submodules?") +endif() + +add_subdirectory(raylib) +target_compile_options(raylib PRIVATE "-w") # disable warnings diff --git a/libs/raylib b/libs/raylib new file mode 160000 +Subproject f1007554a0a8145060797c0aa8169bdaf2c1c6b |