2013-05-14 20:56:06 +00:00
|
|
|
#Build the OpenGL extension wrangler
|
2020-12-31 12:48:34 +00:00
|
|
|
cmake_minimum_required(VERSION 3.10.3)
|
2013-05-14 20:56:06 +00:00
|
|
|
|
|
|
|
#project(glew)
|
|
|
|
|
|
|
|
set(GLEW_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR})
|
|
|
|
source_group(API FILES ${API})
|
|
|
|
|
|
|
|
FILE(GLOB GLEW_FILES
|
|
|
|
${GLEW_SOURCE_DIR}/include/GL/*.h
|
|
|
|
${GLEW_SOURCE_DIR}/src/glew.c
|
|
|
|
)
|
|
|
|
|
2014-10-07 15:40:35 +00:00
|
|
|
add_library(bundled_glew STATIC ${GLEW_FILES})
|
2022-10-22 23:20:45 +00:00
|
|
|
target_include_directories(bundled_glew PUBLIC ${GLEW_SOURCE_DIR}/include)
|
|
|
|
target_compile_definitions(bundled_glew PUBLIC GLEW_STATIC)
|
|
|
|
set_target_properties(bundled_glew PROPERTIES LINKER_LANGUAGE C)
|
2013-12-11 09:59:10 +00:00
|
|
|
|
2024-01-31 20:44:11 +00:00
|
|
|
if(MINGW OR UNIX)
|
|
|
|
target_compile_options(bundled_glew PRIVATE "-Wno-attributes")
|
|
|
|
|
|
|
|
# this is required for bundled 64bit glew lib
|
|
|
|
# http://stackoverflow.com/questions/7216244/why-is-fpic-absolutely-necessary-on-64-and-not-on-32bit-platforms
|
|
|
|
# note: -mcmodel=large might be an option to set too
|
|
|
|
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
|
set_target_properties(bundled_glew PROPERTIES POSITION_INDEPENDENT_CODE ON)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2013-12-11 09:59:10 +00:00
|
|
|
#install(TARGETS glew
|
|
|
|
# LIBRARY DESTINATION "${GLEW_SOURCE_DIR}/lib/"
|
|
|
|
# ARCHIVE DESTINATION "${GLEW_SOURCE_DIR}/lib/"
|
|
|
|
#)
|