Merge pull request #37 from Perlmint/feature/install_symbolic_link

This commit is contained in:
Gyusun Yeom 2021-02-06 22:11:39 +09:00 committed by GitHub
commit 0be1dc6b89
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -97,8 +97,16 @@ if(glew-cmake_BUILD_STATIC)
OUTPUT_NAME "glew"
DEBUG_POSTFIX d)
target_compile_definitions(libglew_static PUBLIC GLEW_STATIC)
target_compile_definitions(libglew_static PUBLIC GLEW_STATIC)
list(APPEND GLEW_TARGETS libglew_static)
if(NOT WIN32)
add_custom_command(TARGET libglew_static POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink libglew.a libGLEW.a
WORKING_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}
BYPRODUCTS ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libGLEW.a
COMMENT "create libGLEW symbolic link")
install(FILES ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY}/libGLEW.a TYPE LIB)
endif()
endif()
if(glew-cmake_BUILD_SHARED)
@ -112,6 +120,14 @@ if(glew-cmake_BUILD_SHARED)
set_target_properties(libglew_shared PROPERTIES
OUTPUT_NAME "glew"
DEBUG_POSTFIX d)
if(NOT WIN32)
add_custom_command(TARGET libglew_shared POST_BUILD
COMMAND ${CMAKE_COMMAND} ARGS -E create_symlink libglew.so libGLEW.so
WORKING_DIRECTORY ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}
BYPRODUCTS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libGLEW.so
COMMENT "create libGLEW symbolic link")
install(FILES ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/libGLEW.so TYPE LIB)
endif()
endif()
target_compile_definitions(libglew_shared PRIVATE GLEW_BUILD)