Merge pull request #969 from jeroen/staticlibs

install static libraries
This commit is contained in:
Even Rouault 2017-07-13 13:33:21 +02:00 committed by GitHub
commit 39e962a0ca
1 changed files with 3 additions and 1 deletions

View File

@ -87,11 +87,13 @@ if(WIN32)
add_definitions(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
endif() endif()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
else() else()
# Builds both static and dynamic libs # Builds both static and dynamic libs
add_library(${OPENJPEG_LIBRARY_NAME} SHARED ${OPENJPEG_SRCS}) add_library(${OPENJPEG_LIBRARY_NAME} SHARED ${OPENJPEG_SRCS})
add_library(openjp2_static STATIC ${OPENJPEG_SRCS}) add_library(openjp2_static STATIC ${OPENJPEG_SRCS})
set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME}) set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static)
endif() endif()
if(UNIX) if(UNIX)
@ -103,7 +105,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
endif() endif()
# Install library # Install library
install(TARGETS ${OPENJPEG_LIBRARY_NAME} install(TARGETS ${INSTALL_LIBS}
EXPORT OpenJPEGTargets EXPORT OpenJPEGTargets
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries