forked from Lephenixnoir/Azur
meta: move submodules to 3rdparty/ (still internal)
This properly separates the libraries developed here from the (now clearly) third-part software that we build at the same time. There is still no install script for these libraries, they are only usable from the main CMakeLists.txt. This will change soon.
This commit is contained in:
parent
e2e73c4934
commit
019cf416fa
|
@ -1,9 +1,9 @@
|
|||
[submodule "imgui"]
|
||||
path = imgui
|
||||
path = 3rdparty/imgui
|
||||
url = https://github.com/ocornut/imgui
|
||||
[submodule "glm"]
|
||||
path = glm
|
||||
path = 3rdparty/glm
|
||||
url = https://github.com/g-truc/glm
|
||||
[submodule "gl3w"]
|
||||
path = gl3w
|
||||
path = 3rdparty/gl3w
|
||||
url = https://github.com/skaslev/gl3w
|
||||
|
|
|
@ -1,20 +1,48 @@
|
|||
#---
|
||||
# gl3w
|
||||
#---
|
||||
|
||||
# Use GL3W as an OpenGL loader on desktop
|
||||
if(AZUR_GRAPHICS_OPENGL_3_3)
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/gl3w/src/gl3w.c"
|
||||
COMMAND ./gl3w_gen.py
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/gl3w")
|
||||
add_library(gl3w gl3w/src/gl3w.c)
|
||||
target_include_directories(gl3w PUBLIC gl3w/include)
|
||||
# Link with GLX for GL3W to find the extensions, and -ldl
|
||||
target_link_libraries(gl3w INTERFACE PkgConfig::glx -ldl)
|
||||
endif()
|
||||
|
||||
#---
|
||||
# GLM
|
||||
#---
|
||||
|
||||
# Define the header-only library
|
||||
add_library(glm INTERFACE)
|
||||
|
||||
# Set the include directory
|
||||
target_include_directories(glm INTERFACE "${CMAKE_CURRENT_SOURCE_DIR}/glm")
|
||||
|
||||
#---
|
||||
# The Dear ImGui library for SDL + OpenGL3/OpenGLES2
|
||||
#---
|
||||
|
||||
set(SOURCES
|
||||
../imgui/imgui.cpp
|
||||
../imgui/imgui_demo.cpp
|
||||
../imgui/imgui_draw.cpp
|
||||
../imgui/imgui_tables.cpp
|
||||
../imgui/imgui_widgets.cpp
|
||||
../imgui/backends/imgui_impl_opengl3.cpp
|
||||
../imgui/backends/imgui_impl_sdl.cpp)
|
||||
imgui/imgui.cpp
|
||||
imgui/imgui_demo.cpp
|
||||
imgui/imgui_draw.cpp
|
||||
imgui/imgui_tables.cpp
|
||||
imgui/imgui_widgets.cpp
|
||||
imgui/backends/imgui_impl_opengl3.cpp
|
||||
imgui/backends/imgui_impl_sdl.cpp)
|
||||
|
||||
# Use Freetype if the library is installed, or the emscripten port
|
||||
if(AZUR_PLATFORM_EMSCRIPTEN)
|
||||
list(APPEND SOURCES ../imgui/misc/freetype/imgui_freetype.cpp)
|
||||
list(APPEND SOURCES imgui/misc/freetype/imgui_freetype.cpp)
|
||||
else()
|
||||
pkg_check_modules(freetype2 freetype2 IMPORTED_TARGET)
|
||||
if(freetype2_FOUND)
|
||||
list(APPEND SOURCES ../imgui/misc/freetype/imgui_freetype.cpp)
|
||||
list(APPEND SOURCES imgui/misc/freetype/imgui_freetype.cpp)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -37,14 +65,14 @@ endif()
|
|||
# FreeType2 settings
|
||||
if(freetype2_FOUND)
|
||||
target_compile_definitions(imgui PUBLIC -DIMGUI_ENABLE_FREETYPE)
|
||||
target_include_directories(imgui PRIVATE ../imgui/misc/freetype)
|
||||
target_include_directories(imgui PRIVATE imgui/misc/freetype)
|
||||
target_link_libraries(imgui PUBLIC PkgConfig::freetype2)
|
||||
elseif(AZUR_PLATFORM_EMSCRIPTEN)
|
||||
target_compile_definitions(imgui PUBLIC -DIMGUI_ENABLE_FREETYPE)
|
||||
target_include_directories(imgui PRIVATE ../imgui/misc/freetype)
|
||||
target_include_directories(imgui PRIVATE imgui/misc/freetype)
|
||||
target_compile_options(imgui PUBLIC -sUSE_FREETYPE=1)
|
||||
target_link_options(imgui INTERFACE -sUSE_FREETYPE=1)
|
||||
endif()
|
||||
|
||||
# Provide include directories
|
||||
target_include_directories(imgui PUBLIC ../imgui ../imgui/backends)
|
||||
target_include_directories(imgui PUBLIC imgui imgui/backends)
|
|
@ -112,13 +112,9 @@ set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
|
|||
# Subdirectory selection
|
||||
#---
|
||||
|
||||
# Exclud third-party software from the build on gint; it wouldn't work
|
||||
if(NOT AZUR_PLATFORM STREQUAL gint)
|
||||
# This provides GL3W on desktop
|
||||
add_subdirectory(gl3w-builds)
|
||||
# This provides Dear ImGui
|
||||
add_subdirectory(imgui-builds)
|
||||
# This provide GLM
|
||||
add_subdirectory(glm-builds)
|
||||
add_subdirectory(3rdparty)
|
||||
endif()
|
||||
|
||||
add_subdirectory(libnum)
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
# Use GL3W as an OpenGL loader on desktop
|
||||
if(AZUR_GRAPHICS_OPENGL_3_3)
|
||||
add_custom_command(OUTPUT "${CMAKE_CURRENT_SOURCE_DIR}/../gl3w/src/gl3w.c"
|
||||
COMMAND ./gl3w_gen.py
|
||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/../gl3w")
|
||||
add_library(gl3w
|
||||
../gl3w/src/gl3w.c)
|
||||
target_include_directories(gl3w PUBLIC
|
||||
../gl3w/include)
|
||||
# Link with GLX for GL3W to find the extensions, and -ldl
|
||||
target_link_libraries(gl3w INTERFACE PkgConfig::glx -ldl)
|
||||
endif()
|
|
@ -1,5 +0,0 @@
|
|||
# Define the header-only library
|
||||
add_library(glm INTERFACE)
|
||||
|
||||
# Set the include directory
|
||||
target_include_directories(glm INTERFACE ../glm)
|
Loading…
Reference in New Issue