Merge pull request #954 from jeroen/static

build both shared and static library
This commit is contained in:
Even Rouault 2017-07-03 12:03:29 +02:00 committed by GitHub
commit 5736b1a368
1 changed files with 7 additions and 1 deletions

View File

@ -86,8 +86,14 @@ if(WIN32)
else() else()
add_definitions(-DOPJ_STATIC) add_definitions(-DOPJ_STATIC)
endif() endif()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
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})
endif() endif()
add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS})
if(UNIX) if(UNIX)
target_link_libraries(${OPENJPEG_LIBRARY_NAME} m) target_link_libraries(${OPENJPEG_LIBRARY_NAME} m)
endif() endif()