diff --git a/src/lib/openjp2/CMakeLists.txt b/src/lib/openjp2/CMakeLists.txt index 0e8e9a9c..7f9fee31 100644 --- a/src/lib/openjp2/CMakeLists.txt +++ b/src/lib/openjp2/CMakeLists.txt @@ -86,8 +86,14 @@ if(WIN32) else() add_definitions(-DOPJ_STATIC) 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() -add_library(${OPENJPEG_LIBRARY_NAME} ${OPENJPEG_SRCS}) + if(UNIX) target_link_libraries(${OPENJPEG_LIBRARY_NAME} m) endif()