diff --git a/.gitignore b/.gitignore index f632636e0..1f2c6d077 100644 --- a/.gitignore +++ b/.gitignore @@ -59,3 +59,6 @@ examples/example_sdl2_metal/example_sdl2_metal examples/example_sdl2_opengl2/example_sdl2_opengl2 examples/example_sdl2_opengl3/example_sdl2_opengl3 examples/example_sdl2_sdlrenderer/example_sdl2_sdlrenderer + +## User Playground +playground/* diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..6f9dde684 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,15 @@ +cmake_minimum_required(VERSION 3.15) + +project(imgui) + +set(IMGUI_INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}) +add_library(imgui-core STATIC) +target_sources(imgui-core PUBLIC imgui.cpp imgui_demo.cpp imgui_draw.cpp imgui_tables.cpp imgui_widgets.cpp) +target_include_directories(imgui-core PUBLIC ${IMGUI_INC_DIR}) + +add_subdirectory(misc) + +# Playground is a private space where dev might test/experiment/freestyle stuffs +if(EXISTS playground) +add_subdirectory(playground) +endif() diff --git a/misc/CMakeLists.txt b/misc/CMakeLists.txt new file mode 100644 index 000000000..5e3a49c39 --- /dev/null +++ b/misc/CMakeLists.txt @@ -0,0 +1,4 @@ +add_subdirectory(cpp) +add_subdirectory(single_file) +add_subdirectory(fonts) +add_subdirectory(freetype) diff --git a/misc/cpp/CMakeLists.txt b/misc/cpp/CMakeLists.txt new file mode 100644 index 000000000..cd2f03341 --- /dev/null +++ b/misc/cpp/CMakeLists.txt @@ -0,0 +1,3 @@ +add_library(imgui-cpp STATIC) +target_sources(imgui-cpp PUBLIC imgui_stdlib.cpp) +target_include_directories(imgui-cpp PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${IMGUI_INC_DIR}) diff --git a/misc/fonts/CMakeLists.txt b/misc/fonts/CMakeLists.txt new file mode 100644 index 000000000..5e043f7f5 --- /dev/null +++ b/misc/fonts/CMakeLists.txt @@ -0,0 +1 @@ +add_executable(fonts-bin2compressed binary_to_compressed_c.cpp) diff --git a/misc/freetype/CMakeLists.txt b/misc/freetype/CMakeLists.txt new file mode 100644 index 000000000..014ba8f75 --- /dev/null +++ b/misc/freetype/CMakeLists.txt @@ -0,0 +1,7 @@ +find_package(Freetype) +if(Freetype_FOUND) +add_library(imgui-freetype STATIC) +target_include_directories(imgui-freetype PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} PRIVATE ${IMGUI_INC_DIR}) +target_sources(imgui-freetype PUBLIC imgui_freetype.cpp) +target_link_libraries(imgui-freetype Freetype::Freetype) +endif() diff --git a/misc/single_file/CMakeLists.txt b/misc/single_file/CMakeLists.txt new file mode 100644 index 000000000..9fd73c3e8 --- /dev/null +++ b/misc/single_file/CMakeLists.txt @@ -0,0 +1,2 @@ +add_library(imgui-jumbo INTERFACE) +target_include_directories(imgui-jumbo INTERFACE ${CMAKE_CURRENT_SOURCE_DIR})