1
0
Fork 0
mirror of https://github.com/ocornut/imgui.git synced 2026-01-09 23:54:20 +00:00
imgui/examples/example_glfw_opengl3/CMakeLists.txt
Konstantin Podsvirov b567ffe7e0 Add CMake project
Export Dear ImGui as CMake's ImGui package.

Options:
- ImGui_USER_CONFIG;
- ImGui_EXAMPLES;
- ImGui_BACKENDS;
- ImGui_MISC;
- ImGui_3RDPARTY;
- ImGui_OPENGL_LOADER;
- ImGui_FREETYPE;
- ImGui_TOOLS;
- ImGui_PACKAGE.

Export targets:
- ImGui::Core;
- ImGui::ImplGLUT;
- ImGui::ImplSDL2;
- ImGui::ImplSDLRenderer2;
- ImGui::ImplSDL3;
- ImGui::ImplSDLRenderer3;
- ImGui::ImplGlfw;
- ImGui::ImplOpenGL2;
- ImGui::ImplOpenGL3;
- ImGui::ImplVulkan;
- ImGui::FreeType;
- ImGui::StdLib;
- ImGui::BinaryToCompressedC.

Import targets from:
- build directory;
- installed package.

Examples:
- example_null;
- example_glut_opengl2
- example_sdl2_sdlrenderer2;
- example_sdl2_opengl2;
- example_sdl2_opengl3;
- example_sdl2_vulkan;
- example_sdl3_sdlrenderer3;
- example_sdl3_opengl3;
- example_sdl3_vulkan;
- example_glfw_opengl2;
- example_glfw_opengl3;
- example_glfw_vulkan.

Presets:
- vcpkg (require $env{VCPKG_ROOT});
- emscripten (inherits vcpkg and require $env{EMSCRIPTEN_ROOT}).
2025-06-25 21:37:37 +03:00

21 lines
502 B
CMake

cmake_minimum_required(VERSION 3.5)
project(example_glfw_opengl3
LANGUAGES C CXX)
find_package(ImGui CONFIG REQUIRED
COMPONENTS ImplGlfw ImplOpenGL3)
add_executable(${PROJECT_NAME} WIN32 main.cpp)
if(EMSCRIPTEN)
set_target_properties(${PROJECT_NAME} PROPERTIES
SUFFIX .html)
endif()
target_link_libraries(${PROJECT_NAME}
PRIVATE ImGui::ImplGlfw ImGui::ImplOpenGL3)
include(GNUInstallDirs)
install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")