34 lines
735 B
CMake
34 lines
735 B
CMake
cmake_minimum_required(VERSION 3.15)
|
|
project(ImGuiProject)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
# Find OpenGL
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
# Fetch GLFW
|
|
include(FetchContent)
|
|
|
|
FetchContent_Declare(
|
|
glfw
|
|
GIT_REPOSITORY https://github.com/glfw/glfw.git
|
|
GIT_TAG 3.3.8
|
|
)
|
|
FetchContent_MakeAvailable(glfw)
|
|
|
|
# ImGui sources
|
|
file(GLOB IMGUI_SRC
|
|
${CMAKE_SOURCE_DIR}/imgui/*.cpp
|
|
${CMAKE_SOURCE_DIR}/imgui/backends/imgui_impl_glfw.cpp
|
|
${CMAKE_SOURCE_DIR}/imgui/backends/imgui_impl_opengl3.cpp
|
|
)
|
|
|
|
add_executable(ImGuiProject main.cpp ${IMGUI_SRC})
|
|
|
|
target_include_directories(ImGuiProject PRIVATE
|
|
${CMAKE_SOURCE_DIR}/imgui
|
|
${CMAKE_SOURCE_DIR}/imgui/backends
|
|
)
|
|
|
|
target_link_libraries(ImGuiProject PRIVATE glfw OpenGL::GL)
|