2018-02-12 22:14:14 +00:00
|
|
|
if(NOT PREFER_BUNDLED_LIBS)
|
|
|
|
set(CMAKE_MODULE_PATH ${ORIGINAL_CMAKE_MODULE_PATH})
|
|
|
|
find_package(GLEW)
|
|
|
|
set(CMAKE_MODULE_PATH ${OWN_CMAKE_MODULE_PATH})
|
|
|
|
if(GLEW_FOUND)
|
|
|
|
set(GLEW_BUNDLED OFF)
|
|
|
|
set(GLEW_DEP)
|
|
|
|
endif()
|
2017-10-25 14:57:25 +00:00
|
|
|
endif()
|
2017-09-12 18:03:06 +00:00
|
|
|
|
2018-02-12 22:14:14 +00:00
|
|
|
if(NOT GLEW_FOUND)
|
|
|
|
set(GLEW_BUNDLED ON)
|
|
|
|
set(GLEW_SRC_DIR src/engine/external/glew)
|
2020-01-19 19:32:54 +00:00
|
|
|
set_src(GLEW_SRC GLOB ${GLEW_SRC_DIR} glew.c)
|
|
|
|
set_src(GLEW_INCLUDES GLOB ${GLEW_SRC_DIR}/GL eglew.h glew.h glxew.h wglew.h)
|
2018-02-12 22:14:14 +00:00
|
|
|
add_library(glew EXCLUDE_FROM_ALL OBJECT ${GLEW_SRC} ${GLEW_INCLUDES})
|
|
|
|
set(GLEW_INCLUDEDIR ${GLEW_SRC_DIR})
|
|
|
|
target_include_directories(glew PRIVATE ${GLEW_INCLUDEDIR})
|
2017-09-12 18:03:06 +00:00
|
|
|
|
2018-02-12 22:14:14 +00:00
|
|
|
set(GLEW_DEP $<TARGET_OBJECTS:glew>)
|
|
|
|
set(GLEW_INCLUDE_DIRS ${GLEW_INCLUDEDIR})
|
|
|
|
set(GLEW_LIBRARIES)
|
2017-09-12 18:03:06 +00:00
|
|
|
|
2018-02-12 22:14:14 +00:00
|
|
|
list(APPEND TARGETS_DEP glew)
|
2017-09-12 18:03:06 +00:00
|
|
|
|
2018-02-12 22:14:14 +00:00
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(GLEW DEFAULT_MSG GLEW_INCLUDEDIR)
|
2017-09-12 18:03:06 +00:00
|
|
|
endif()
|