Skip to content

Commit

Permalink
Merge pull request #969 from jeroen/staticlibs
Browse files Browse the repository at this point in the history
install static libraries
  • Loading branch information
rouault authored Jul 13, 2017
2 parents 60f8ddf + 90ced71 commit 39e962a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/openjp2/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,13 @@ if(WIN32)
add_definitions(-DOPJ_STATIC)
endif()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME})
else()
# Builds both static and dynamic libs
add_library(${OPENJPEG_LIBRARY_NAME} SHARED ${OPENJPEG_SRCS})
add_library(openjp2_static STATIC ${OPENJPEG_SRCS})
set_target_properties(openjp2_static PROPERTIES OUTPUT_NAME ${OPENJPEG_LIBRARY_NAME})
set(INSTALL_LIBS ${OPENJPEG_LIBRARY_NAME} openjp2_static)
endif()

if(UNIX)
Expand All @@ -103,7 +105,7 @@ if(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
endif()

# Install library
install(TARGETS ${OPENJPEG_LIBRARY_NAME}
install(TARGETS ${INSTALL_LIBS}
EXPORT OpenJPEGTargets
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
Expand Down

0 comments on commit 39e962a

Please sign in to comment.