2012-10-15 11:44:34 +02:00
|
|
|
# openmj2:
|
2012-09-28 10:51:14 +02:00
|
|
|
set(OPENMJ2_LIBRARY_NAME openmj2)
|
2012-10-15 11:44:34 +02:00
|
|
|
|
|
|
|
include_directories(
|
|
|
|
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
|
|
|
)
|
|
|
|
|
2012-09-28 10:51:14 +02:00
|
|
|
set(OPENMJ2_SRCS
|
|
|
|
mj2.c
|
2012-09-28 11:52:57 +02:00
|
|
|
mj2_convert.c
|
2012-10-09 11:45:43 +02:00
|
|
|
# FIXME: legacy
|
2012-10-15 10:09:31 +02:00
|
|
|
j2k_lib.c
|
|
|
|
cio.c
|
2012-10-09 11:45:43 +02:00
|
|
|
jp2.c
|
|
|
|
j2k.c
|
|
|
|
tcd.c
|
|
|
|
mct.c
|
|
|
|
t1.c
|
|
|
|
t2.c
|
|
|
|
pi.c
|
|
|
|
bio.c
|
|
|
|
mqc.c
|
|
|
|
tgt.c
|
|
|
|
dwt.c
|
|
|
|
event.c
|
2012-10-15 10:09:31 +02:00
|
|
|
image.c
|
|
|
|
jpt.c
|
|
|
|
raw.c
|
2012-10-09 11:45:43 +02:00
|
|
|
openjpeg.c
|
2012-09-28 10:51:14 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Build the library
|
|
|
|
if(WIN32)
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-DOPJ_EXPORTS)
|
2012-10-15 11:44:34 +02:00
|
|
|
else()
|
2012-09-28 10:51:14 +02:00
|
|
|
add_definitions(-DOPJ_STATIC)
|
2012-10-15 11:44:34 +02:00
|
|
|
endif()
|
|
|
|
endif()
|
2012-09-28 10:51:14 +02:00
|
|
|
|
|
|
|
# build mj2 lib:
|
|
|
|
add_library(${OPENMJ2_LIBRARY_NAME} ${OPENMJ2_SRCS})
|
2012-10-09 11:45:43 +02:00
|
|
|
# FIXME: We are using an openjpeg 1.5 copy:
|
|
|
|
#target_link_libraries(${OPENMJ2_LIBRARY_NAME} openjp2)
|
2012-09-28 10:51:14 +02:00
|
|
|
if(UNIX)
|
|
|
|
target_link_libraries(${OPENMJ2_LIBRARY_NAME} m)
|
|
|
|
endif()
|
|
|
|
set_target_properties(${OPENMJ2_LIBRARY_NAME} PROPERTIES ${OPENJPEG_LIBRARY_PROPERTIES})
|
2017-11-14 11:45:09 +01:00
|
|
|
if(NOT ${CMAKE_VERSION} VERSION_LESS "2.8.12")
|
2015-09-01 20:43:43 +02:00
|
|
|
target_compile_options(${OPENMJ2_LIBRARY_NAME} PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
|
|
|
endif()
|
2012-09-28 10:51:14 +02:00
|
|
|
|
|
|
|
# Install library
|
|
|
|
install(TARGETS ${OPENMJ2_LIBRARY_NAME}
|
|
|
|
EXPORT OpenMJ2Targets
|
2016-05-02 16:03:16 +02:00
|
|
|
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR}
|
2012-09-28 10:51:14 +02:00
|
|
|
COMPONENT Libraries
|
|
|
|
)
|
|
|
|
|
|
|
|
# Install includes files
|
2016-05-02 16:03:16 +02:00
|
|
|
#install(FILES mj2.h
|
|
|
|
# DESTINATION ${OPENJPEG_INSTALL_INCLUDE_DIR}/${subdir}
|
2012-09-28 10:51:14 +02:00
|
|
|
# COMPONENT Headers
|
|
|
|
#)
|