Skip to content

Commit

Permalink
Merge pull request #31 from TakesxiSximada/sximada-patch-11
Browse files Browse the repository at this point in the history
fix GLEW library build configuration
  • Loading branch information
TakesxiSximada authored Oct 22, 2023
2 parents 6b50113 + 5366d83 commit 4a0fdc3
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 1 deletion.
4 changes: 3 additions & 1 deletion evogym/simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ endif()

if(UNIX)
find_package(OpenGL REQUIRED)
set(CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}) # use custom FindGLEW.cmake
set(GLEW_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/externals/glew/include)
set(GLEW_LIBRARY ${PROJECT_SOURCE_DIR}/externals/glew/lib/libGLEW.*)
find_package(GLEW REQUIRED)
endif()

Expand Down Expand Up @@ -46,4 +49,3 @@ add_subdirectory(SimulatorCPP/)

set(CMAKE_CXX_STANDARD_LIBRARIES -ldl)
# set(CMAKE_VERBOSE_MAKEFILE ON)

23 changes: 23 additions & 0 deletions evogym/simulator/FindGLEW.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# FindGLEW.cmake
# Search for GLEW library and include directories

find_path(GLEW_INCLUDE_DIR GL/glew.h)
find_library(GLEW_LIBRARY NAMES GLEW GLEW32)

if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
set(GLEW_FOUND TRUE)
else()
set(GLEW_FOUND FALSE)
endif()

if (GLEW_FOUND)
if (NOT GLEW_FIND_QUIETLY)
message(STATUS "Found GLEW: ${GLEW_LIBRARY}")
endif ()
else()
if (GLEW_FIND_REQUIRED)
message(FATAL_ERROR "Could NOT find GLEW")
endif ()
endif()

mark_as_advanced(GLEW_INCLUDE_DIR GLEW_LIBRARY)

0 comments on commit 4a0fdc3

Please sign in to comment.