Skip to content

Commit 48ed27f

Browse files
committed
Added GLFW submodule as lib
1 parent 83d0172 commit 48ed27f

File tree

5 files changed

+30
-6579
lines changed

5 files changed

+30
-6579
lines changed

CMakeLists.txt

+24
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,29 @@ set(CMAKE_EXE_LINKER_FLAGS "-static-libgcc -static-libstdc++")
1515

1616
add_compile_definitions(STB_IMAGE_IMPLEMENTATION)
1717

18+
19+
# DOWNLOAD ALL THE SUBMODULES
20+
find_package(Git QUIET)
21+
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
22+
# Update submodules as needed
23+
option(GIT_SUBMODULE "Check submodules during build" ON)
24+
if(GIT_SUBMODULE)
25+
message(STATUS "Submodule update")
26+
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
27+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
28+
RESULT_VARIABLE GIT_SUBMOD_RESULT)
29+
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
30+
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules")
31+
endif()
32+
endif()
33+
endif()
34+
35+
# CHECK ALL THE SUBMODULES
36+
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/glfw/CMakeLists.txt")
37+
message(FATAL_ERROR "The glfw submodules was not downloaded! GIT_SUBMODULE was turned off or failed. Please update submodules and try again.")
38+
endif()
39+
40+
41+
add_subdirectory(external/glfw)
1842
add_subdirectory("include")
1943
add_subdirectory("src")

include/GLFW/LICENSE.md

-23
This file was deleted.

0 commit comments

Comments
 (0)