2014-04-14 14:27:52 -07:00
|
|
|
project(glad)
|
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
find_package(OpenGL REQUIRED)
|
2014-04-14 14:27:52 -07:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
add_library(glad SHARED)
|
|
|
|
add_library(OBS::obsglad ALIAS glad)
|
2014-04-14 14:27:52 -07:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
target_sources(glad PRIVATE src/glad.c include/glad/glad.h)
|
2014-04-14 14:27:52 -07:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
target_include_directories(glad PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
2017-12-02 19:50:32 -08:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
target_compile_definitions(glad PRIVATE GLAD_GLAPI_EXPORT_BUILD)
|
2017-12-02 19:50:32 -08:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
target_link_libraries(glad PUBLIC OpenGL::GL)
|
2014-04-14 14:27:52 -07:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
set_target_properties(
|
|
|
|
glad
|
|
|
|
PROPERTIES OUTPUT_NAME obsglad
|
|
|
|
FOLDER "deps"
|
|
|
|
VERSION "${OBS_VERSION_MAJOR}"
|
|
|
|
SOVERSION "1")
|
|
|
|
|
|
|
|
if(OS_WINDOWS)
|
|
|
|
set(MODULE_DESCRIPTION "Glad OpenGL Loading Library")
|
|
|
|
|
|
|
|
configure_file(${CMAKE_SOURCE_DIR}/cmake/bundle/windows/obs-module.rc.in
|
|
|
|
obsglad.rc)
|
|
|
|
|
|
|
|
target_sources(glad PRIVATE src/glad_wgl.c include/glad/glad_wgl.h obsglad.rc)
|
|
|
|
|
|
|
|
elseif(OS_POSIX AND NOT OS_MACOS)
|
|
|
|
find_package(OpenGL REQUIRED)
|
|
|
|
|
|
|
|
if(TARGET OpenGL::EGL)
|
2022-05-13 20:35:09 -07:00
|
|
|
target_sources(glad PRIVATE src/glad_egl.c include/EGL/eglplatform.h
|
|
|
|
include/glad/glad_egl.h)
|
2021-11-29 13:02:23 -08:00
|
|
|
|
|
|
|
target_link_libraries(glad PRIVATE OpenGL::EGL)
|
|
|
|
endif()
|
2014-04-14 14:27:52 -07:00
|
|
|
|
|
|
|
endif()
|
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
if(NOT MSVC)
|
|
|
|
target_compile_options(glad PRIVATE -fvisibility=hidden)
|
|
|
|
endif()
|
2014-04-14 14:27:52 -07:00
|
|
|
|
2021-11-29 13:02:23 -08:00
|
|
|
setup_binary_target(glad)
|