pound-emu_pound/3rd_Party/CMakeLists.txt
Ronald Caesar a3ed44003b build: Refactor CMake build system
This new architecture decomposes the project into several distict static
libraries: common, host, kvm, and frontend.

By using static libraries, changes within one module will only require
that library to be re-linked, rather than recompiling and re-linking the
entire executable.

The third party library ImGui is now built as a static library target.

Signed-off-by: Ronald Caesar <github43132@proton.me>
2025-09-14 18:40:30 -04:00

36 lines
831 B
CMake

set(BUILD_SHARED_LIBS OFF)
set(BUILD_TESTING OFF)
set_directory_properties(PROPERTIES EXCLUDE_FROM_ALL ON SYSTEM ON)
# Set CMP0069 policy to "NEW" for building external targets with LTO enabled
set(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
# fmt
if (NOT TARGET fmt::fmt)
add_subdirectory(fmt)
endif()
# SDL3
if (NOT TARGET SDL3::SDL3)
set(SDL_DISKAUDIO OFF)
set(SDL_TEST_LIBRARY OFF)
set(SDL_PIPEWIRE OFF)
add_subdirectory(SDL3)
endif()
# ImGui
set(IMGUI_SRC
imgui/imgui.cpp
imgui/imgui_demo.cpp
imgui/imgui_draw.cpp
imgui/imgui_tables.cpp
imgui/imgui_widgets.cpp
imgui/backends/imgui_impl_sdl3.cpp
imgui/backends/imgui_impl_opengl3.cpp
)
add_library(imgui STATIC ${IMGUI_SRC})
target_link_libraries(imgui PRIVATE SDL3::SDL3)
target_include_directories(imgui PUBLIC
imgui
imgui/backends
)