From ccd26494d9c5a8151ba6ed6f95408a736829d118 Mon Sep 17 00:00:00 2001 From: Andrew Kesterson Date: Tue, 12 May 2026 16:45:42 -0400 Subject: [PATCH] Import all dependencies as submodules, make cmake do the right thing --- .gitmodules | 21 ++++++++++++++ CMakeLists.txt | 43 ++++++++++++----------------- deps/SDL | 1 + deps/SDL_image | 1 + deps/SDL_mixer | 1 + deps/SDL_ttf | 1 + deps/jansson | 1 + deps/libakerror | 1 + deps/libakstdlib | 1 + include/akgl/SDL_GameControllerDB.h | 2 +- 10 files changed, 47 insertions(+), 26 deletions(-) create mode 160000 deps/SDL create mode 160000 deps/SDL_image create mode 160000 deps/SDL_mixer create mode 160000 deps/SDL_ttf create mode 160000 deps/jansson create mode 160000 deps/libakerror create mode 160000 deps/libakstdlib diff --git a/.gitmodules b/.gitmodules index 1395ee4..3085247 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,24 @@ [submodule "deps/semver"] path = deps/semver url = git@github.com:h2non/semver.c.git +[submodule "deps/SDL"] + path = deps/SDL + url = git@github.com:libsdl-org/SDL.git +[submodule "deps/SDL_image"] + path = deps/SDL_image + url = git@github.com:libsdl-org/SDL_image.git +[submodule "deps/SDL_mixer"] + path = deps/SDL_mixer + url = git@github.com:libsdl-org/SDL_mixer.git +[submodule "deps/SDL_ttf"] + path = deps/SDL_ttf + url = git@github.com:libsdl-org/SDL_ttf.git +[submodule "deps/libsdlerror"] + path = deps/libakerror + url = https://source.home.aklabs.net/andrew/libsdlerror.git +[submodule "deps/libakstdlib"] + path = deps/libakstdlib + url = https://source.home.aklabs.net/andrew/libakstdlib.git +[submodule "deps/jansson"] + path = deps/jansson + url = git@github.com:akheron/jansson.git diff --git a/CMakeLists.txt b/CMakeLists.txt index aa3121d..15f4214 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,22 +3,13 @@ project(akgl LANGUAGES C) include(CTest) -find_package(PkgConfig REQUIRED) -find_package(SDL3 REQUIRED) -find_package(SDL3_image REQUIRED) -find_package(SDL3_mixer REQUIRED) -find_package(SDL3_ttf REQUIRED) -find_package(akerror REQUIRED) -find_package(akstdlib REQUIRED) -find_package(jansson REQUIRED) -find_package(box2d REQUIRED) - -# Check for SDL3 using pkg-config -#pkg_check_modules(SDL3 REQUIRED sdl3) -#pkg_check_modules(SDL3_image REQUIRED sdl3-image) -#pkg_check_modules(SDL3_mixer REQUIRED sdl3-mixer) -#pkg_check_modules(jansson REQUIRED jansson) -#pkg_check_modules(akerror REQUIRED akerror) +add_subdirectory(deps/jansson EXCLUDE_FROM_ALL) +add_subdirectory(deps/libakerror EXCLUDE_FROM_ALL) +add_subdirectory(deps/libakstdlib EXCLUDE_FROM_ALL) +add_subdirectory(deps/SDL EXCLUDE_FROM_ALL) +add_subdirectory(deps/SDL_image EXCLUDE_FROM_ALL) +add_subdirectory(deps/SDL_mixer EXCLUDE_FROM_ALL) +add_subdirectory(deps/SDL_ttf EXCLUDE_FROM_ALL) set(GAMECONTROLLERDB_H "include/akgl/SDL_GameControllerDB.h") set(prefix ${CMAKE_INSTALL_PREFIX}) @@ -89,18 +80,20 @@ target_link_libraries(akgl SDL3_mixer::SDL3_mixer SDL3_ttf::SDL3_ttf akstdlib::akstdlib + akerror::akerror + jansson::jansson ) -target_link_libraries(test_actor PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_bitmasks PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_character PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_registry PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_sprite PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_staticstring PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_tilemap PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) -target_link_libraries(test_util PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) +target_link_libraries(test_actor PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_bitmasks PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_character PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_registry PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_sprite PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_staticstring PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_tilemap PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) +target_link_libraries(test_util PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) -target_link_libraries(charviewer PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer box2d::box2d jansson::jansson -lm) +target_link_libraries(charviewer PRIVATE akstdlib::akstdlib akerror::akerror akgl SDL3::SDL3 SDL3_ttf::SDL3_ttf SDL3_image::SDL3_image SDL3_mixer::SDL3_mixer jansson::jansson -lm) set(main_lib_dest "lib/akgl-${MY_LIBRARY_VERSION}") install(FILES ${CMAKE_CURRENT_BINARY_DIR}/akgl.pc DESTINATION "lib/pkgconfig/") diff --git a/deps/SDL b/deps/SDL new file mode 160000 index 0000000..d9d5536 --- /dev/null +++ b/deps/SDL @@ -0,0 +1 @@ +Subproject commit d9d5536704d585616d4db3c8ba3c4ff6fc2757e1 diff --git a/deps/SDL_image b/deps/SDL_image new file mode 160000 index 0000000..bec9134 --- /dev/null +++ b/deps/SDL_image @@ -0,0 +1 @@ +Subproject commit bec9134a26c7d0f31b36d6083c25296e04cabff5 diff --git a/deps/SDL_mixer b/deps/SDL_mixer new file mode 160000 index 0000000..a5e1890 --- /dev/null +++ b/deps/SDL_mixer @@ -0,0 +1 @@ +Subproject commit a5e1890afc5115ffd16cefdbb4d50f74bf4970ce diff --git a/deps/SDL_ttf b/deps/SDL_ttf new file mode 160000 index 0000000..a1ce367 --- /dev/null +++ b/deps/SDL_ttf @@ -0,0 +1 @@ +Subproject commit a1ce3670aec736ecbf0936c43f2f0cc53aa61e5b diff --git a/deps/jansson b/deps/jansson new file mode 160000 index 0000000..1eb7a81 --- /dev/null +++ b/deps/jansson @@ -0,0 +1 @@ +Subproject commit 1eb7a8129766153b5214153a00b1ae0e14e27a41 diff --git a/deps/libakerror b/deps/libakerror new file mode 160000 index 0000000..51b6b23 --- /dev/null +++ b/deps/libakerror @@ -0,0 +1 @@ +Subproject commit 51b6b23b4cbfc3ed8b169e92faf47389a98cdb6e diff --git a/deps/libakstdlib b/deps/libakstdlib new file mode 160000 index 0000000..4bd03f2 --- /dev/null +++ b/deps/libakstdlib @@ -0,0 +1 @@ +Subproject commit 4bd03f267ab0fd5c42a418157c6113f73853cfca diff --git a/include/akgl/SDL_GameControllerDB.h b/include/akgl/SDL_GameControllerDB.h index 3be6e71..6e299db 100644 --- a/include/akgl/SDL_GameControllerDB.h +++ b/include/akgl/SDL_GameControllerDB.h @@ -1,7 +1,7 @@ #ifndef _SDL_GAMECONTROLLERDB_H_ #define _SDL_GAMECONTROLLERDB_H_ -// Taken from https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt on Tue May 12 03:18:39 PM EDT 2026 +// Taken from https://raw.githubusercontent.com/mdqinc/SDL_GameControllerDB/refs/heads/master/gamecontrollerdb.txt on Tue May 12 04:45:15 PM EDT 2026 #define AKGL_SDL_GAMECONTROLLER_DB_LEN 2228