2012-08-30 19:14:39 +02:00
|
|
|
include_regular_expression("^.*$")
|
2011-08-12 15:57:36 +02:00
|
|
|
|
2012-10-05 18:57:30 +02:00
|
|
|
add_definitions(-DUSE_JPIP)
|
|
|
|
|
2012-08-30 19:14:39 +02:00
|
|
|
include_directories(
|
2012-10-05 18:57:30 +02:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
2012-10-01 09:49:52 +02:00
|
|
|
${OPENJPEG_BINARY_DIR}/src/lib/openjp2 # opj_config.h
|
2012-09-28 10:11:41 +02:00
|
|
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2
|
2012-03-02 11:23:20 +01:00
|
|
|
${FCGI_INCLUDE_DIRS}
|
|
|
|
${CURL_INCLUDE_DIRS}
|
2011-08-12 15:57:36 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
# Defines the source code for the library
|
2012-08-30 19:14:39 +02:00
|
|
|
set(OPENJPIP_SRCS
|
2012-03-02 11:23:20 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/boxheader_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/codestream_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgreg_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/marker_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/msgqueue_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/box_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/faixbox_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/index_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/metadata_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/placeholder_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/byte_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/ihdrbox_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/manfbox_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/mhixbox_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/target_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cachemodel_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/j2kheader_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/jp2k_encoder.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/openjpip.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/query_parser.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/channel_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/session_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/jpip_parser.c
|
2012-03-02 11:46:04 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/sock_manager.c
|
2016-05-10 22:02:49 +02:00
|
|
|
${OPENJPEG_SOURCE_DIR}/src/lib/openjp2/opj_malloc.c
|
2012-03-02 11:23:20 +01:00
|
|
|
)
|
|
|
|
|
2012-08-30 19:14:39 +02:00
|
|
|
set(SERVER_SRCS
|
2012-03-02 11:46:04 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/auxtrans_manager.c
|
2012-03-02 11:23:20 +01:00
|
|
|
)
|
2011-10-25 23:10:48 +02:00
|
|
|
|
2012-08-30 19:14:39 +02:00
|
|
|
set(LOCAL_SRCS
|
2012-03-02 11:23:20 +01:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/jp2k_decoder.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/imgsock_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/jpipstream_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/cache_manager.c
|
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}/dec_clientmsg_handler.c
|
|
|
|
)
|
2011-08-12 15:57:36 +02:00
|
|
|
|
|
|
|
# Build the library
|
2012-10-05 19:05:06 +02:00
|
|
|
if(WIN32)
|
|
|
|
if(BUILD_SHARED_LIBS)
|
|
|
|
add_definitions(-DOPJ_EXPORTS)
|
|
|
|
else()
|
|
|
|
add_definitions(-DOPJ_STATIC)
|
|
|
|
endif()
|
|
|
|
endif()
|
|
|
|
add_library(openjpip ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
|
|
|
set_target_properties(openjpip
|
|
|
|
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(openjpip PRIVATE ${OPENJPEG_LIBRARY_COMPILE_OPTIONS})
|
|
|
|
endif()
|
2012-10-05 19:05:06 +02:00
|
|
|
target_link_libraries(openjpip ${OPENJPEG_LIBRARY_NAME})
|
2012-08-30 19:14:39 +02:00
|
|
|
if(WIN32)
|
2012-03-02 11:23:20 +01:00
|
|
|
# add Winsock on windows+mingw
|
2012-10-05 19:05:06 +02:00
|
|
|
target_link_libraries(openjpip ws2_32)
|
2012-08-30 19:20:03 +02:00
|
|
|
endif()
|
2011-08-12 15:57:36 +02:00
|
|
|
|
2012-03-02 11:23:20 +01:00
|
|
|
# Install library
|
2012-10-05 19:05:06 +02:00
|
|
|
install(TARGETS openjpip
|
2012-03-02 11:23:20 +01:00
|
|
|
EXPORT OpenJPEGTargets
|
2012-10-05 19:05:06 +02:00
|
|
|
RUNTIME DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
|
|
LIBRARY DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
|
|
ARCHIVE DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
2011-11-24 11:42:47 +01:00
|
|
|
)
|
2011-08-12 15:57:36 +02:00
|
|
|
|
2012-08-30 19:14:39 +02:00
|
|
|
if(BUILD_JPIP_SERVER)
|
|
|
|
add_library(openjpip_server STATIC ${OPENJPIP_SRCS} ${SERVER_SRCS})
|
|
|
|
target_link_libraries(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})
|
|
|
|
set_target_properties(openjpip_server
|
2012-03-02 11:23:20 +01:00
|
|
|
PROPERTIES COMPILE_FLAGS "-DSERVER")
|
2012-08-30 19:14:39 +02:00
|
|
|
install(TARGETS openjpip_server
|
2012-03-02 11:23:20 +01:00
|
|
|
EXPORT OpenJPEGTargets
|
|
|
|
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
|
|
|
)
|
2012-08-30 19:20:03 +02:00
|
|
|
endif()
|