2014-04-14 14:27:52 -07:00
|
|
|
project(glad)
|
|
|
|
|
|
|
|
find_package(OpenGL)
|
|
|
|
|
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
|
|
|
find_package(X11)
|
|
|
|
endif()
|
|
|
|
|
|
|
|
set(glad_SOURCES
|
2014-07-06 14:00:56 -07:00
|
|
|
src/glad.c
|
|
|
|
include/glad/glad.h)
|
2014-04-14 14:27:52 -07:00
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
set(glad_PLATFORM_SOURCES
|
2014-07-06 14:00:56 -07:00
|
|
|
src/glad_wgl.c
|
|
|
|
include/glad/glad_wgl.h)
|
2014-04-14 14:27:52 -07:00
|
|
|
elseif(NOT APPLE)
|
|
|
|
set(glad_PLATFORM_SOURCES
|
2014-07-06 14:00:56 -07:00
|
|
|
src/glad_glx.c
|
|
|
|
include/glad/glad_glx.h)
|
2014-04-14 14:27:52 -07:00
|
|
|
endif()
|
|
|
|
|
|
|
|
add_library(glad SHARED
|
|
|
|
${glad_SOURCES}
|
|
|
|
${glad_PLATFORM_SOURCES})
|
|
|
|
set_target_properties(glad PROPERTIES
|
|
|
|
OUTPUT_NAME obsglad
|
|
|
|
VERSION "0"
|
|
|
|
SOVERSION "0")
|
|
|
|
target_include_directories(glad
|
|
|
|
PUBLIC include
|
|
|
|
PRIVATE ${X11_X11_INCLUDE_PATH} ${OPENGL_INCLUDE_DIR})
|
|
|
|
target_compile_definitions(glad
|
|
|
|
PRIVATE GLAD_GLAPI_EXPORT_BUILD)
|
|
|
|
|
2014-06-17 21:23:37 -07:00
|
|
|
if(NOT MSVC)
|
2014-04-14 14:27:52 -07:00
|
|
|
target_compile_options(glad
|
2015-02-04 19:04:37 -08:00
|
|
|
PRIVATE -DPIC -fvisibility=hidden)
|
|
|
|
if(NOT MINGW)
|
|
|
|
target_compile_options(glad PRIVATE -fPIC)
|
|
|
|
endif()
|
2014-04-14 14:27:52 -07:00
|
|
|
endif()
|
|
|
|
|
|
|
|
if(NOT WIN32 AND NOT APPLE)
|
|
|
|
set(glad_PLATFORM_DEPS
|
|
|
|
${X11_X11_LIB})
|
2015-05-03 05:38:24 -07:00
|
|
|
# only link to libdl on linux
|
|
|
|
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
|
|
|
|
set(glad_PLATFORM_DEPS
|
|
|
|
${glad_PLATFORM_DEPS}
|
|
|
|
-ldl)
|
|
|
|
endif()
|
2014-04-14 14:27:52 -07:00
|
|
|
endif()
|
|
|
|
|
|
|
|
target_link_libraries(glad
|
|
|
|
${glad_PLATFORM_DEPS}
|
|
|
|
${OPENGL_gl_LIBRARY})
|
|
|
|
|
|
|
|
install_obs_core(glad)
|