41 lines
1.2 KiB
CMake
41 lines
1.2 KiB
CMake
# Makefile for the main JPWL OpenJPEG codecs: JPWL_ j2k_to_image and JPWL_image_to_j2k
|
|
|
|
ADD_DEFINITIONS(-DUSE_JPWL)
|
|
|
|
SET(JPWL_SRCS crc.c jpwl.c jpwl_lib.c rs.c)
|
|
IF(APPLE)
|
|
SET_SOURCE_FILES_PROPERTIES(
|
|
rs.c
|
|
PROPERTIES
|
|
COMPILE_FLAGS -fno-common)
|
|
ENDIF(APPLE)
|
|
|
|
INCLUDE_DIRECTORIES(
|
|
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
|
)
|
|
|
|
# Build the library
|
|
IF(WIN32)
|
|
IF(BUILD_SHARED_LIBS)
|
|
ADD_DEFINITIONS(-DOPJ_EXPORTS)
|
|
ELSE(BUILD_SHARED_LIBS)
|
|
ADD_DEFINITIONS(-DOPJ_STATIC)
|
|
ENDIF(BUILD_SHARED_LIBS)
|
|
ENDIF(WIN32)
|
|
ADD_LIBRARY(${OPENJPEG_LIBRARY_NAME}_JPWL ${JPWL_SRCS} ${OPENJPEG_SRCS})
|
|
IF(UNIX)
|
|
TARGET_LINK_LIBRARIES(${OPENJPEG_LIBRARY_NAME}_JPWL m)
|
|
ENDIF(UNIX)
|
|
SET_TARGET_PROPERTIES(${OPENJPEG_LIBRARY_NAME}_JPWL PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
|
IF(${CMAKE_VERSION} VERSION_GREATER "2.8.11")
|
|
TARGET_COMPILE_OPTIONS(${OPENJPEG_LIBRARY_NAME}_JPWL PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
|
ENDIF()
|
|
|
|
# Install library
|
|
INSTALL(TARGETS ${OPENJPEG_LIBRARY_NAME}_JPWL
|
|
EXPORT OpenJPEGTargets
|
|
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
)
|