Refactor code to split jpip client code from server side.
This commit is contained in:
parent
ba01e855a3
commit
2b746a71cb
|
@ -164,14 +164,14 @@ ENDIF(CMAKE_COMPILER_IS_GNUCC)
|
|||
#-----------------------------------------------------------------------------
|
||||
# opj_config.h generation (1/2)
|
||||
INCLUDE (${CMAKE_ROOT}/Modules/CheckIncludeFile.cmake)
|
||||
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
|
||||
CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
|
||||
CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
|
||||
CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H)
|
||||
CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H)
|
||||
CHECK_INCLUDE_FILE("string.h" HAVE_STRING_H)
|
||||
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
|
||||
CHECK_INCLUDE_FILE("sys/types.h" HAVE_SYS_TYPES_H)
|
||||
CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
|
||||
|
||||
|
||||
|
@ -185,22 +185,14 @@ ADD_SUBDIRECTORY(libopenjpeg)
|
|||
OPTION(BUILD_CODEC "Build the CODEC executables" ON)
|
||||
OPTION(BUILD_MJ2 "Build the MJ2 executables." OFF)
|
||||
OPTION(BUILD_JPIP "Build the JPIP library and executables." OFF)
|
||||
IF(BUILD_JPIP)
|
||||
OPTION(BUILD_JPIP_SERVER "Build the JPIP server." OFF)
|
||||
ENDIF(BUILD_JPIP)
|
||||
OPTION(BUILD_VIEWER "Build the OPJViewer executable (C++)" OFF)
|
||||
OPTION(BUILD_JAVA "Build the openjpeg jar (Java)" OFF)
|
||||
MARK_AS_ADVANCED(BUILD_VIEWER)
|
||||
MARK_AS_ADVANCED(BUILD_JAVA)
|
||||
|
||||
IF(BUILD_JPIP)
|
||||
FIND_PACKAGE(CURL)
|
||||
ENDIF (BUILD_JPIP)
|
||||
|
||||
IF(NOT CURL_FOUND)
|
||||
IF(BUILD_JPIP)
|
||||
message(WARNING "You must have libcurl installed to use JPIP")
|
||||
ENDIF (BUILD_JPIP)
|
||||
SET(BUILD_JPIP OFF)
|
||||
ENDIF (NOT CURL_FOUND)
|
||||
|
||||
# Try to find lib Z
|
||||
FIND_PACKAGE(ZLIB)
|
||||
|
||||
|
|
|
@ -1,19 +1,20 @@
|
|||
# Build the each application if it needed
|
||||
|
||||
IF(BUILD_CODEC)
|
||||
ADD_SUBDIRECTORY(codec)
|
||||
ADD_SUBDIRECTORY(codec)
|
||||
ENDIF(BUILD_CODEC)
|
||||
|
||||
IF(BUILD_MJ2)
|
||||
ADD_SUBDIRECTORY(mj2)
|
||||
ADD_SUBDIRECTORY(mj2)
|
||||
ENDIF(BUILD_MJ2)
|
||||
|
||||
# Client & Server:
|
||||
IF(BUILD_JPIP)
|
||||
ADD_SUBDIRECTORY(jpip)
|
||||
ADD_SUBDIRECTORY(jpip)
|
||||
ENDIF(BUILD_JPIP)
|
||||
|
||||
IF(BUILD_VIEWER)
|
||||
ADD_SUBDIRECTORY(OPJViewer)
|
||||
ADD_SUBDIRECTORY(OPJViewer)
|
||||
ENDIF(BUILD_VIEWER)
|
||||
|
||||
IF(BUILD_JAVA)
|
||||
|
|
|
@ -1,3 +1,13 @@
|
|||
# required dep for server:
|
||||
IF(BUILD_JPIP_SERVER)
|
||||
FIND_PACKAGE(CURL REQUIRED)
|
||||
FIND_PACKAGE(FCGI REQUIRED)
|
||||
ENDIF(BUILD_JPIP_SERVER)
|
||||
|
||||
# JPIP client & server:
|
||||
ADD_SUBDIRECTORY(libopenjpip)
|
||||
ADD_SUBDIRECTORY(util)
|
||||
|
||||
# jpip server:
|
||||
IF(BUILD_JPIP_SERVER)
|
||||
ADD_SUBDIRECTORY(util)
|
||||
ENDIF(BUILD_JPIP_SERVER)
|
||||
|
|
|
@ -2,7 +2,7 @@ INCLUDE_REGULAR_EXPRESSION("^.*$")
|
|||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${OPENJPEG_SOURCE_DIR}/libopenjpeg
|
||||
${FCGI_INCLUDE_DIRNAME}
|
||||
${FCGI_INCLUDE_DIRS}
|
||||
${CURL_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
|
@ -47,18 +47,19 @@ SET(LOCAL_SRCS
|
|||
ADD_LIBRARY(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS})
|
||||
TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME} ${CURL_LIBRARIES})
|
||||
|
||||
ADD_LIBRARY(openjpip_server STATIC ${OPENJPIP_SRCS})
|
||||
TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBNAME} ${CURL_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(openjpip_server
|
||||
PROPERTIES COMPILE_FLAGS "-DSERVER")
|
||||
|
||||
# Install library
|
||||
INSTALL(TARGETS openjpip_local
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
||||
)
|
||||
|
||||
INSTALL(TARGETS openjpip_server
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
||||
)
|
||||
IF(BUILD_JPIP_SERVER)
|
||||
ADD_LIBRARY(openjpip_server STATIC ${OPENJPIP_SRCS})
|
||||
TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBRARIES} ${CURL_LIBRARIES})
|
||||
SET_TARGET_PROPERTIES(openjpip_server
|
||||
PROPERTIES COMPILE_FLAGS "-DSERVER")
|
||||
INSTALL(TARGETS openjpip_server
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_LIB_DIR} COMPONENT Libraries
|
||||
)
|
||||
ENDIF(BUILD_JPIP_SERVER)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Headers file are located here:
|
||||
INCLUDE_DIRECTORIES(
|
||||
${OPENJPEG_SOURCE_DIR}/applications/jpip/libopenjpip
|
||||
${FCGI_INCLUDE_DIRNAME}
|
||||
${FCGI_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
SET(OPJ_SERVER_SRCS
|
||||
|
@ -10,7 +10,7 @@ SET(OPJ_SERVER_SRCS
|
|||
|
||||
# Build executable
|
||||
ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS})
|
||||
TARGET_LINK_LIBRARIES(opj_server openjpip_server ${FCGI_LIBNAME})
|
||||
TARGET_LINK_LIBRARIES(opj_server openjpip_server ${FCGI_LIBRARIES})
|
||||
SET_PROPERTY(
|
||||
TARGET opj_server
|
||||
APPEND PROPERTY
|
||||
|
|
|
@ -108,15 +108,3 @@ ELSE (BUILD_THIRDPARTY)
|
|||
ENDIF (LCMS_FOUND)
|
||||
ENDIF(LCMS2_FOUND)
|
||||
ENDIF(BUILD_THIRDPARTY)
|
||||
|
||||
#------------
|
||||
# Try to find lib FCGI
|
||||
FIND_PACKAGE(FCGI)
|
||||
|
||||
IF(FCGI_FOUND)
|
||||
SET(FCGI_LIBNAME ${FCGI_LIBRARIES} PARENT_SCOPE)
|
||||
SET(FCGI_INCLUDE_DIRNAME ${FCGI_INCLUDE_DIRS} PARENT_SCOPE)
|
||||
message(STATUS "Your system seems to have a FCGI lib available, we will use it to build JPIP")
|
||||
ELSE (FCGI_FOUND) # not found
|
||||
message(STATUS "FCGI lib not found, JPIP will not be built as it requires FCGI")
|
||||
ENDIF(FCGI_FOUND)
|
||||
|
|
Loading…
Reference in New Issue