Skip to content

Commit

Permalink
Update CMakeLists.txt
Browse files Browse the repository at this point in the history
  • Loading branch information
PGZXB authored Jul 31, 2024
1 parent 44dd0ec commit e0d55c2
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,13 @@ if(IMGUI4CJ_GLFW_OPENGL3_BACKEND)

# OpenGL3
list(APPEND IMGUI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/external/cimgui/imgui/backends/imgui_impl_opengl3.cpp)
if (WIN32) # Windows
list(APPEND IMGUI_LIBRARIES opengl32)
else (WIN32) # Unix
list(APPEND IMGUI_LIBRARIES GL)
endif (WIN32)

find_package(OpenGL REQUIRED)
if (OPENGL_FOUND)
list(APPEND IMGUI_LIBRARIES ${OPENGL_gl_LIBRARY})
else (OPENGL_FOUND)
message(FATAL_ERROR "OpenGL not found")
endif()

# GLFW
list(APPEND IMGUI_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/external/cimgui/imgui/backends/imgui_impl_glfw.cpp)
Expand Down

0 comments on commit e0d55c2

Please sign in to comment.