2012-09-28 11:26:51 +02:00
|
|
|
# jpwl apps
|
|
|
|
|
|
|
|
# First thing define the common source:
|
|
|
|
set(common_SRCS
|
2012-10-25 10:15:41 +02:00
|
|
|
convert.c
|
|
|
|
index.c
|
2012-09-28 11:26:51 +02:00
|
|
|
${OPENJPEG_SOURCE_DIR}/src/bin/common/color.c
|
|
|
|
${OPENJPEG_SOURCE_DIR}/src/bin/common/opj_getopt.c
|
|
|
|
)
|
|
|
|
|
|
|
|
# Headers file are located here:
|
|
|
|
include_directories(
|
2012-10-01 09:49:52 +02:00
|
|
|
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
2013-03-17 23:22:11 +01:00
|
|
|
${OPENJPEG_BINARY_DIR}/src/bin/common # opj_apps_config.h
|
2012-10-25 10:15:41 +02:00
|
|
|
${OPENJPEG_SOURCE_DIR}/src/lib/openmj2
|
2012-09-28 11:26:51 +02:00
|
|
|
${OPENJPEG_SOURCE_DIR}/src/bin/common
|
|
|
|
${LCMS_INCLUDE_DIRNAME}
|
|
|
|
${Z_INCLUDE_DIRNAME}
|
|
|
|
${PNG_INCLUDE_DIRNAME}
|
|
|
|
${TIFF_INCLUDE_DIRNAME}
|
|
|
|
)
|
|
|
|
|
|
|
|
if(WIN32)
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-DOPJ_EXPORTS)
|
|
|
|
else()
|
|
|
|
add_definitions(-DOPJ_STATIC)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
|
2012-11-16 10:31:12 +01:00
|
|
|
add_definitions(-DOPJ_USE_LEGACY)
|
2012-09-28 11:26:51 +02:00
|
|
|
foreach(exe decompress compress)
|
|
|
|
set(jpwl_exe opj_jpwl_${exe})
|
|
|
|
set(jp2_exe opj_${exe})
|
|
|
|
add_executable(${jpwl_exe}
|
2012-10-25 10:15:41 +02:00
|
|
|
#../jp2/${jp2_exe}.c
|
|
|
|
${jpwl_exe}.c
|
2012-09-28 11:26:51 +02:00
|
|
|
${common_SRCS}
|
|
|
|
)
|
|
|
|
set_property(
|
|
|
|
TARGET ${jpwl_exe}
|
|
|
|
APPEND PROPERTY COMPILE_DEFINITIONS USE_JPWL
|
|
|
|
)
|
2012-10-25 10:20:12 +02:00
|
|
|
|
2012-09-28 11:26:51 +02:00
|
|
|
target_link_libraries(${jpwl_exe} openjpwl
|
2012-10-25 10:20:12 +02:00
|
|
|
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
|
|
|
|
2012-09-28 11:26:51 +02:00
|
|
|
# To support universal exe:
|
|
|
|
if(ZLIB_FOUND AND APPLE)
|
|
|
|
target_link_libraries(${jpwl_exe} z)
|
2012-10-01 14:29:09 +02:00
|
|
|
else(ZLIB_FOUND AND APPLE)
|
2012-09-28 11:26:51 +02:00
|
|
|
target_link_libraries(${jpwl_exe} ${Z_LIBNAME})
|
|
|
|
endif()
|
2012-10-25 10:20:12 +02:00
|
|
|
|
2012-09-28 11:26:51 +02:00
|
|
|
if(UNIX)
|
|
|
|
target_link_libraries(${jpwl_exe} m)
|
|
|
|
endif()
|
2012-10-25 10:20:12 +02:00
|
|
|
|
2012-09-28 11:26:51 +02:00
|
|
|
install(TARGETS ${jpwl_exe}
|
|
|
|
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
|
|
)
|
|
|
|
endforeach()
|