Skip to content

Commit

Permalink
add libdl for linux OpenGL3
Browse files Browse the repository at this point in the history
  • Loading branch information
Noy-Zini committed Nov 26, 2024
1 parent 54a0dc3 commit dc0ba58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions examples/align/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@ if(BUILD_GRAPHICAL_EXAMPLES)
add_executable( ${PROJECT_NAME} rs-align.cpp ${IMGUI_SOURCES})
set_property( TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 11 )
target_link_libraries( ${PROJECT_NAME} ${DEPENDENCIES} )
# Check the platform and conditionally link OpenGL and libdl
if(WIN32)
# For Windows, we don't need libdl, use Windows dynamic loading
target_link_libraries(${PROJECT_NAME} OpenGL::GL)
else()
# For non-Windows (Unix-like systems), link OpenGL and libdl
find_package(OpenGL REQUIRED)
target_link_libraries(${PROJECT_NAME} OpenGL::GL dl)
endif()
include_directories( ../../third-party/imgui ../../examples )
set_target_properties( ${PROJECT_NAME} PROPERTIES FOLDER Examples )
using_easyloggingpp( ${PROJECT_NAME} SHARED )
Expand Down

0 comments on commit dc0ba58

Please sign in to comment.