[1.5] remove pthread dependency in JPIP client and tweak thirdparty stuff
This commit is contained in:
parent
2b746a71cb
commit
040c9a68b6
|
@ -184,6 +184,7 @@ ADD_SUBDIRECTORY(libopenjpeg)
|
||||||
# Build Applications
|
# Build Applications
|
||||||
OPTION(BUILD_CODEC "Build the CODEC executables" ON)
|
OPTION(BUILD_CODEC "Build the CODEC executables" ON)
|
||||||
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF)
|
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF)
|
||||||
|
OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF)
|
||||||
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF)
|
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF)
|
||||||
IF(BUILD_JPIP)
|
IF(BUILD_JPIP)
|
||||||
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
|
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
|
||||||
|
@ -193,16 +194,13 @@ OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
|
||||||
MARK_AS_ADVANCED(BUILD_VIEWER)
|
MARK_AS_ADVANCED(BUILD_VIEWER)
|
||||||
MARK_AS_ADVANCED(BUILD_JAVA)
|
MARK_AS_ADVANCED(BUILD_JAVA)
|
||||||
|
|
||||||
# Try to find lib Z
|
IF(BUILD_CODEC OR BUILD_MJ2)
|
||||||
FIND_PACKAGE(ZLIB)
|
|
||||||
|
|
||||||
IF(BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
|
|
||||||
# OFF: It will only build 3rd party libs if they are not found on the system
|
# OFF: It will only build 3rd party libs if they are not found on the system
|
||||||
# ON: 3rd party libs will ALWAYS be build, and used
|
# ON: 3rd party libs will ALWAYS be build, and used
|
||||||
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
|
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
|
||||||
ADD_SUBDIRECTORY(thirdparty)
|
ADD_SUBDIRECTORY(thirdparty)
|
||||||
ADD_SUBDIRECTORY(applications)
|
ADD_SUBDIRECTORY(applications)
|
||||||
ENDIF (BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
|
ENDIF (BUILD_CODEC OR BUILD_MJ2)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# opj_config.h generation (2/2)
|
# opj_config.h generation (2/2)
|
||||||
|
@ -211,10 +209,6 @@ CONFIGURE_FILE("${OPENJPEG_SOURCE_DIR}/opj_config.h.cmake.in"
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
|
||||||
# Build JPWL-flavoured library and executables
|
|
||||||
OPTION(BUILD_JPWL "Build the JPWL library and executables" OFF)
|
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
# Build DOCUMENTATION (not in ALL target and only if Doxygen is found)
|
||||||
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
|
||||||
|
|
|
@ -70,7 +70,14 @@ IF(BUILD_JPWL)
|
||||||
)
|
)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
|
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${OPENJPEG_LIBRARY_NAME}_JPWL
|
||||||
${LCMS_LIBNAME} ${Z_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
||||||
|
|
||||||
|
# To support universal exe:
|
||||||
|
IF(ZLIB_FOUND AND APPLE)
|
||||||
|
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image z)
|
||||||
|
ELSe(ZLIB_FOUND AND APPLE)
|
||||||
|
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image ${Z_LIBNAME})
|
||||||
|
ENDIF(ZLIB_FOUND AND APPLE)
|
||||||
|
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m)
|
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m)
|
||||||
|
@ -87,7 +94,14 @@ IF(BUILD_JPWL)
|
||||||
)
|
)
|
||||||
|
|
||||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL
|
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${OPENJPEG_LIBRARY_NAME}_JPWL
|
||||||
${LCMS_LIBNAME} ${Z_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
${LCMS_LIBNAME} ${PNG_LIBNAME} ${TIFF_LIBNAME})
|
||||||
|
|
||||||
|
# To support universal exe:
|
||||||
|
IF(ZLIB_FOUND AND APPLE)
|
||||||
|
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k z)
|
||||||
|
ELSe(ZLIB_FOUND AND APPLE)
|
||||||
|
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k ${Z_LIBNAME})
|
||||||
|
ENDIF(ZLIB_FOUND AND APPLE)
|
||||||
|
|
||||||
IF(UNIX)
|
IF(UNIX)
|
||||||
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m)
|
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m)
|
||||||
|
|
|
@ -4,10 +4,9 @@ IF(BUILD_JPIP_SERVER)
|
||||||
FIND_PACKAGE(FCGI REQUIRED)
|
FIND_PACKAGE(FCGI REQUIRED)
|
||||||
ENDIF(BUILD_JPIP_SERVER)
|
ENDIF(BUILD_JPIP_SERVER)
|
||||||
|
|
||||||
# JPIP client & server:
|
# JPIP library:
|
||||||
ADD_SUBDIRECTORY(libopenjpip)
|
ADD_SUBDIRECTORY(libopenjpip)
|
||||||
|
|
||||||
# jpip server:
|
# JPIP binaries:
|
||||||
IF(BUILD_JPIP_SERVER)
|
ADD_SUBDIRECTORY(util)
|
||||||
ADD_SUBDIRECTORY(util)
|
|
||||||
ENDIF(BUILD_JPIP_SERVER)
|
|
||||||
|
|
|
@ -45,7 +45,7 @@ SET(LOCAL_SRCS
|
||||||
|
|
||||||
# Build the library
|
# Build the library
|
||||||
ADD_LIBRARY(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
ADD_LIBRARY(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
||||||
TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME} ${CURL_LIBRARIES})
|
TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME})
|
||||||
|
|
||||||
# Install library
|
# Install library
|
||||||
INSTALL(TARGETS openjpip_local
|
INSTALL(TARGETS openjpip_local
|
||||||
|
|
|
@ -46,6 +46,8 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include "jp2k_encoder.h"
|
#include "jp2k_encoder.h"
|
||||||
|
|
||||||
|
#ifdef SERVER
|
||||||
|
|
||||||
server_record_t * init_JPIPserver( int tcp_auxport, int udp_auxport)
|
server_record_t * init_JPIPserver( int tcp_auxport, int udp_auxport)
|
||||||
{
|
{
|
||||||
server_record_t *record = (server_record_t *)malloc( sizeof(server_record_t));
|
server_record_t *record = (server_record_t *)malloc( sizeof(server_record_t));
|
||||||
|
@ -176,6 +178,7 @@ void end_QRprocess( server_record_t *rec, QR_t **qr)
|
||||||
free( *qr);
|
free( *qr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void local_log( bool query, bool messages, bool sessions, bool targets, QR_t *qr, server_record_t *rec)
|
void local_log( bool query, bool messages, bool sessions, bool targets, QR_t *qr, server_record_t *rec)
|
||||||
{
|
{
|
||||||
if( query)
|
if( query)
|
||||||
|
@ -191,6 +194,8 @@ void local_log( bool query, bool messages, bool sessions, bool targets, QR_t *qr
|
||||||
print_alltarget( rec->targetlist);
|
print_alltarget( rec->targetlist);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif //SERVER
|
||||||
|
|
||||||
#ifndef SERVER
|
#ifndef SERVER
|
||||||
|
|
||||||
dec_server_record_t * init_dec_server( int port)
|
dec_server_record_t * init_dec_server( int port)
|
||||||
|
|
|
@ -65,6 +65,8 @@
|
||||||
* JPIP server API
|
* JPIP server API
|
||||||
*==========================================================
|
*==========================================================
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef SERVER
|
||||||
|
|
||||||
//! Server static records
|
//! Server static records
|
||||||
typedef struct server_record{
|
typedef struct server_record{
|
||||||
|
@ -129,8 +131,6 @@ void send_responsedata( server_record_t *rec, QR_t *qr);
|
||||||
*/
|
*/
|
||||||
void end_QRprocess( server_record_t *rec, QR_t **qr);
|
void end_QRprocess( server_record_t *rec, QR_t **qr);
|
||||||
|
|
||||||
#ifndef SERVER
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Option for local tests; print out parameter values to logstream (stderr)
|
* Option for local tests; print out parameter values to logstream (stderr)
|
||||||
*
|
*
|
||||||
|
|
|
@ -4,30 +4,33 @@ INCLUDE_DIRECTORIES(
|
||||||
${FCGI_INCLUDE_DIRS}
|
${FCGI_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
|
|
||||||
SET(OPJ_SERVER_SRCS
|
IF(BUILD_JPIP_SERVER)
|
||||||
|
|
||||||
|
SET(OPJ_SERVER_SRCS
|
||||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c
|
${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Build executable
|
||||||
|
ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS})
|
||||||
|
TARGET_LINK_LIBRARIES(opj_server openjpip_server)
|
||||||
|
SET_PROPERTY(
|
||||||
|
TARGET opj_server
|
||||||
|
APPEND PROPERTY
|
||||||
|
COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP"
|
||||||
|
)
|
||||||
|
|
||||||
# Build executable
|
# On unix you need to link to the math library:
|
||||||
ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS})
|
IF(UNIX)
|
||||||
TARGET_LINK_LIBRARIES(opj_server openjpip_server ${FCGI_LIBRARIES})
|
TARGET_LINK_LIBRARIES(opj_server m)
|
||||||
SET_PROPERTY(
|
ENDIF(UNIX)
|
||||||
TARGET opj_server
|
|
||||||
APPEND PROPERTY
|
|
||||||
COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP"
|
|
||||||
)
|
|
||||||
|
|
||||||
# On unix you need to link to the math library:
|
# Install exe
|
||||||
IF(UNIX)
|
INSTALL(TARGETS opj_server
|
||||||
TARGET_LINK_LIBRARIES(opj_server m)
|
EXPORT OpenJPEGTargets
|
||||||
ENDIF(UNIX)
|
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||||
|
)
|
||||||
|
ENDIF(BUILD_JPIP_SERVER)
|
||||||
|
|
||||||
# Install exe
|
|
||||||
INSTALL(TARGETS opj_server
|
|
||||||
EXPORT OpenJPEGTargets
|
|
||||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
|
||||||
)
|
|
||||||
#
|
|
||||||
SET(EXES
|
SET(EXES
|
||||||
opj_dec_server
|
opj_dec_server
|
||||||
jpip_to_jp2
|
jpip_to_jp2
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
# 3rd party libs
|
# 3rd party libs
|
||||||
|
|
||||||
|
#------------
|
||||||
|
# Try to find lib Z
|
||||||
IF(BUILD_THIRDPARTY)
|
IF(BUILD_THIRDPARTY)
|
||||||
# Try to build it
|
# Try to build it
|
||||||
message(STATUS "We will build Z lib from thirdparty")
|
message(STATUS "We will build Z lib from thirdparty")
|
||||||
|
@ -8,6 +10,8 @@ IF(BUILD_THIRDPARTY)
|
||||||
SET(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
|
SET(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
|
||||||
SET(ZLIB_FOUND 1)
|
SET(ZLIB_FOUND 1)
|
||||||
ELSE (BUILD_THIRDPARTY)
|
ELSE (BUILD_THIRDPARTY)
|
||||||
|
# Try to find lib Z
|
||||||
|
FIND_PACKAGE(ZLIB)
|
||||||
IF(ZLIB_FOUND)
|
IF(ZLIB_FOUND)
|
||||||
SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
|
SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
|
||||||
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
|
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
|
||||||
|
@ -19,7 +23,7 @@ ENDIF(BUILD_THIRDPARTY)
|
||||||
|
|
||||||
|
|
||||||
#------------
|
#------------
|
||||||
# Try to find lib PNG (which depends to zlib)
|
# Try to find lib PNG (which depends on zlib)
|
||||||
IF(BUILD_THIRDPARTY)
|
IF(BUILD_THIRDPARTY)
|
||||||
# Try to build it
|
# Try to build it
|
||||||
message(STATUS "We will build PNG lib from thirdparty")
|
message(STATUS "We will build PNG lib from thirdparty")
|
||||||
|
|
Loading…
Reference in New Issue