Skip to content

Commit

Permalink
Since glew.h is directly used/included in ROOT's public interfaces, t…
Browse files Browse the repository at this point in the history
…he correct way will be to ship it as well with ROOT
  • Loading branch information
oshadura committed May 12, 2020
1 parent cdc074a commit ff634af
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions builtins/glew/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -33,19 +33,30 @@ if(APPLE)
endif()
endif()

add_library(GLEW STATIC ${GLEW_HEADERS} ${GLEW_SOURCES})
if (WIN32)
set (DLL_PREFIX lib)
endif ()

add_library(GLEW SHARED ${GLEW_HEADERS} ${GLEW_SOURCES})
target_compile_options(GLEW PRIVATE ${GLEW_DEFINITIONS})
target_include_directories(GLEW INTERFACE $<BUILD_INTERFACE:${GLEW_INCLUDE_DIR}>)
target_link_libraries(GLEW PRIVATE OpenGL::GL OpenGL::GLU)
set_target_properties(GLEW PROPERTIES COMPILE_DEFINITIONS "GLEW_STATIC")
set_target_properties (GLEW PROPERTIES COMPILE_DEFINITIONS "GLEW_BUILD" PREFIX "${DLL_PREFIX}")
if(NOT MSVC)
target_compile_options(GLEW PRIVATE -fPIC)
else()
target_compile_definitions (GLEW PRIVATE "GLEW_STATIC")
target_compile_definitions (GLEW PRIVATE "GLEW_BUILD")
endif()
add_library(GLEW::GLEW ALIAS GLEW)

set(GLEW_LIBRARY $<TARGET_FILE:GLEW> CACHE INTERNAL "")
set(GLEW_LIBRARIES GLEW::GLEW CACHE INTERNAL "")

set_property(GLOBAL APPEND PROPERTY ROOT_BUILTIN_TARGETS GLEW::GLEW)

install(TARGETS GLEW
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib
)

ROOT_INSTALL_HEADERS()

0 comments on commit ff634af

Please sign in to comment.