diff options
Diffstat (limited to 'common')
| -rw-r--r-- | common/c_cpp/CMakeLists.txt | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/common/c_cpp/CMakeLists.txt b/common/c_cpp/CMakeLists.txt index 6b4543f..f87b1d5 100644 --- a/common/c_cpp/CMakeLists.txt +++ b/common/c_cpp/CMakeLists.txt @@ -5,6 +5,9 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON) add_library(common INTERFACE) +set(FETCHCONTENT_QUIET FALSE) +include(FetchContent) + # ----------------------------------------------------------------------------- # Language options # ----------------------------------------------------------------------------- @@ -27,6 +30,34 @@ if(NOT MINGW) endif() # ----------------------------------------------------------------------------- +# Dependency: Dear ImGui +# ----------------------------------------------------------------------------- +if(DEMO_NEEDS_DEAR_IMGUI) + FetchContent_Declare( + DEAR_IMGUI + GIT_REPOSITORY https://github.com/ocornut/imgui.git + GIT_TAG v1.92.4 + GIT_PROGRESS TRUE + GIT_SHALLOW TRUE + ) + FetchContent_MakeAvailable(DEAR_IMGUI) + message("dear_imgui_SOURCE_DIR: ${dear_imgui_SOURCE_DIR}") + add_library(common_dear_imgui STATIC + "${dear_imgui_SOURCE_DIR}/imgui.cpp" + "${dear_imgui_SOURCE_DIR}/imgui_demo.cpp" + "${dear_imgui_SOURCE_DIR}/imgui_draw.cpp" + "${dear_imgui_SOURCE_DIR}/imgui_tables.cpp" + "${dear_imgui_SOURCE_DIR}/imgui_widgets.cpp" + ) + target_include_directories(common_dear_imgui PUBLIC + "${dear_imgui_SOURCE_DIR}" + "${dear_imgui_SOURCE_DIR}/backends" + ) + target_compile_features(common_dear_imgui PRIVATE cxx_std_17) + target_link_libraries(common INTERFACE common_dear_imgui) +endif() + +# ----------------------------------------------------------------------------- # Dependency: FFmpeg # ----------------------------------------------------------------------------- if(DEMO_NEEDS_FFMPEG) |