2023-11-19 11:59:25 +01:00
|
|
|
cmake_minimum_required(VERSION 3.16)
|
|
|
|
# https://github.com/ocornut/imgui with custom modifications made to the OpenGL 3 and GLFW backends
|
|
|
|
project(imgui_custom)
|
|
|
|
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
|
|
|
|
|
|
add_library(imgui_custom OBJECT
|
|
|
|
source/imgui_impl_opengl3.cpp
|
|
|
|
source/imgui_impl_glfw.cpp
|
|
|
|
)
|
|
|
|
|
|
|
|
target_include_directories(imgui_custom PUBLIC
|
|
|
|
include
|
|
|
|
)
|
|
|
|
|
|
|
|
target_link_libraries(imgui_custom PRIVATE imgui_includes)
|
2023-12-22 23:39:38 +01:00
|
|
|
target_include_directories(imgui_all_includes INTERFACE include)
|
2023-11-19 14:55:50 +01:00
|
|
|
|
|
|
|
find_package(OpenGL REQUIRED)
|
2023-11-20 21:47:23 +01:00
|
|
|
find_package(Freetype REQUIRED)
|
2023-11-19 14:55:50 +01:00
|
|
|
|
2024-01-26 12:13:22 +01:00
|
|
|
find_package(GLFW QUIET)
|
|
|
|
if (NOT GLFW_FOUND OR "${GLFW_LIBRARIES}" STREQUAL "")
|
|
|
|
find_package(glfw3 QUIET)
|
|
|
|
set(GLFW_INCLUDE_DIRS ${glfw3_INCLUDE_DIRS})
|
|
|
|
set(GLFW_LIBRARIES ${glfw3_LIBRARIES})
|
|
|
|
|
|
|
|
if (NOT glfw3_FOUND OR "${GLFW_LIBRARIES}" STREQUAL "")
|
|
|
|
find_package(PkgConfig REQUIRED)
|
|
|
|
pkg_search_module(GLFW REQUIRED glfw3)
|
|
|
|
endif ()
|
|
|
|
endif()
|
|
|
|
|
2023-12-21 16:02:28 +01:00
|
|
|
if ("${GLFW_LIBRARIES}" MATCHES ".+dll")
|
|
|
|
set(GLFW_LIBRARIES "glfw3")
|
|
|
|
endif ()
|
|
|
|
|
2024-01-26 12:13:22 +01:00
|
|
|
target_include_directories(imgui_custom PUBLIC ${FREETYPE_INCLUDE_DIRS} ${OpenGL_INCLUDE_DIRS})
|
|
|
|
target_link_directories(imgui_custom PUBLIC ${FREETYPE_LIBRARY_DIRS} ${OpenGL_LIBRARY_DIRS})
|
2023-12-21 16:02:28 +01:00
|
|
|
target_link_libraries(imgui_custom PUBLIC ${GLFW_LIBRARIES} ${OPENGL_LIBRARIES})
|