# Build Applications
OPTION(BUILD_CODEC "Build the CODEC executables" ON)
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)
IF(BUILD_JPIP)
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
MARK_AS_ADVANCED(BUILD_VIEWER)
MARK_AS_ADVANCED(BUILD_JAVA)
-# Try to find lib Z
-FIND_PACKAGE(ZLIB)
-
-IF(BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
+IF(BUILD_CODEC OR BUILD_MJ2)
# 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
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
ADD_SUBDIRECTORY(thirdparty)
ADD_SUBDIRECTORY(applications)
-ENDIF (BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
+ENDIF (BUILD_CODEC OR BUILD_MJ2)
#-----------------------------------------------------------------------------
# opj_config.h generation (2/2)
@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)
OPTION(BUILD_DOC "Build the HTML documentation (with doxygen if available)." OFF)
)
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)
TARGET_LINK_LIBRARIES(JPWL_j2k_to_image m)
)
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)
TARGET_LINK_LIBRARIES(JPWL_image_to_j2k m)
FIND_PACKAGE(FCGI REQUIRED)
ENDIF(BUILD_JPIP_SERVER)
-# JPIP client & server:
+# JPIP library:
ADD_SUBDIRECTORY(libopenjpip)
-# jpip server:
-IF(BUILD_JPIP_SERVER)
- ADD_SUBDIRECTORY(util)
-ENDIF(BUILD_JPIP_SERVER)
+# JPIP binaries:
+ADD_SUBDIRECTORY(util)
+
# Build the library
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(TARGETS openjpip_local
#include <unistd.h>
#include "jp2k_encoder.h"
+#ifdef SERVER
+
server_record_t * init_JPIPserver( int tcp_auxport, int udp_auxport)
{
server_record_t *record = (server_record_t *)malloc( sizeof(server_record_t));
free( *qr);
}
+
void local_log( bool query, bool messages, bool sessions, bool targets, QR_t *qr, server_record_t *rec)
{
if( query)
print_alltarget( rec->targetlist);
}
+#endif //SERVER
+
#ifndef SERVER
dec_server_record_t * init_dec_server( int port)
* JPIP server API
*==========================================================
*/
+
+ #ifdef SERVER
//! Server static records
typedef struct server_record{
*/
void end_QRprocess( server_record_t *rec, QR_t **qr);
-#ifndef SERVER
-
/**
* Option for local tests; print out parameter values to logstream (stderr)
*
${FCGI_INCLUDE_DIRS}
)
-SET(OPJ_SERVER_SRCS
+IF(BUILD_JPIP_SERVER)
+
+ SET(OPJ_SERVER_SRCS
${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
-ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS})
-TARGET_LINK_LIBRARIES(opj_server openjpip_server ${FCGI_LIBRARIES})
-SET_PROPERTY(
- TARGET opj_server
- APPEND PROPERTY
- COMPILE_DEFINITIONS SERVER QUIT_SIGNAL="quitJPIP"
- )
+ # On unix you need to link to the math library:
+ IF(UNIX)
+ TARGET_LINK_LIBRARIES(opj_server m)
+ ENDIF(UNIX)
-# On unix you need to link to the math library:
-IF(UNIX)
- TARGET_LINK_LIBRARIES(opj_server m)
-ENDIF(UNIX)
+ # Install exe
+ INSTALL(TARGETS opj_server
+ EXPORT OpenJPEGTargets
+ 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
opj_dec_server
jpip_to_jp2
# 3rd party libs
+#------------
+# Try to find lib Z
IF(BUILD_THIRDPARTY)
# Try to build it
message(STATUS "We will build Z lib from thirdparty")
SET(Z_INCLUDE_DIRNAME ${OPENJPEG_SOURCE_DIR}/thirdparty/include PARENT_SCOPE)
SET(ZLIB_FOUND 1)
ELSE (BUILD_THIRDPARTY)
+ # Try to find lib Z
+ FIND_PACKAGE(ZLIB)
IF(ZLIB_FOUND)
SET(Z_LIBNAME ${ZLIB_LIBRARIES} PARENT_SCOPE)
SET(Z_INCLUDE_DIRNAME ${ZLIB_INCLUDE_DIRS} PARENT_SCOPE)
#------------
-# Try to find lib PNG (which depends to zlib)
+# Try to find lib PNG (which depends on zlib)
IF(BUILD_THIRDPARTY)
# Try to build it
message(STATUS "We will build PNG lib from thirdparty")