added cmake support to openjpip
This commit is contained in:
parent
8ed4cb1a1e
commit
a098921d34
3
CHANGES
3
CHANGES
@ -5,6 +5,9 @@ What's New for OpenJPEG
|
||||
! : changed
|
||||
+ : added
|
||||
|
||||
August 12, 2011
|
||||
+ [antonin] added cmake support to openjpip
|
||||
|
||||
August 11, 2011
|
||||
* [mickael] Fixed issue #76
|
||||
* [antonin] minor bug fix in configure.ac (credit to Vincent Torri)
|
||||
|
20
CMake/FindFCGI.cmake
Normal file
20
CMake/FindFCGI.cmake
Normal file
@ -0,0 +1,20 @@
|
||||
# Look for the header file.
|
||||
FIND_PATH(FCGI_INCLUDE_DIR NAMES fastcgi.h)
|
||||
|
||||
# Look for the library.
|
||||
FIND_LIBRARY(FCGI_LIBRARY NAMES fcgi)
|
||||
|
||||
# Handle the QUIETLY and REQUIRED arguments and set FCGI_FOUND to TRUE if all listed variables are TRUE.
|
||||
INCLUDE(FindPackageHandleStandardArgs)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(FCGI DEFAULT_MSG FCGI_LIBRARY FCGI_INCLUDE_DIR)
|
||||
|
||||
# Copy the results to the output variables.
|
||||
IF(FCGI_FOUND)
|
||||
SET( ${FCGI_LIBRARY})
|
||||
SET(FCGI_INCLUDE_DIRS ${FCGI_INCLUDE_DIR})
|
||||
ELSE(FCGI_FOUND)
|
||||
SET(FCGI_LIBRARIES)
|
||||
SET(FCGI_INCLUDE_DIRS)
|
||||
ENDIF(FCGI_FOUND)
|
||||
|
||||
MARK_AS_ADVANCED(FCGI_INCLUDE_DIRS FCGI_LIBRARIES)
|
@ -212,12 +212,13 @@ ADD_SUBDIRECTORY(libopenjpeg)
|
||||
# Build Applications
|
||||
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_CODEC OR BUILD_MJ2)
|
||||
IF(BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
|
||||
OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF)
|
||||
ADD_SUBDIRECTORY(thirdparty)
|
||||
ADD_SUBDIRECTORY(applications)
|
||||
ENDIF (BUILD_CODEC OR BUILD_MJ2)
|
||||
ENDIF (BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP)
|
||||
|
||||
#-----------------------------------------------------------------------------
|
||||
# opj_config.h generation (2/2)
|
||||
|
@ -7,3 +7,7 @@ ENDIF(BUILD_CODEC)
|
||||
IF(BUILD_MJ2)
|
||||
ADD_SUBDIRECTORY(mj2)
|
||||
ENDIF(BUILD_MJ2)
|
||||
|
||||
IF(BUILD_JPIP)
|
||||
ADD_SUBDIRECTORY(jpip)
|
||||
ENDIF(BUILD_JPIP)
|
||||
|
@ -5,6 +5,9 @@ What's New for OpenJPIP
|
||||
! : changed
|
||||
+ : added
|
||||
|
||||
August 12, 2011
|
||||
+ [antonin] added cmake support to openjpip
|
||||
|
||||
July 6, 2011
|
||||
* [antonin] JPIP : fixed autotools to work with recent name changes
|
||||
|
||||
|
5
applications/jpip/CMakeLists.txt
Normal file
5
applications/jpip/CMakeLists.txt
Normal file
@ -0,0 +1,5 @@
|
||||
|
||||
ADD_SUBDIRECTORY(libopenjpip)
|
||||
ADD_SUBDIRECTORY(opj_server)
|
||||
ADD_SUBDIRECTORY(opj_client)
|
||||
ADD_SUBDIRECTORY(tools)
|
44
applications/jpip/libopenjpip/CMakeLists.txt
Normal file
44
applications/jpip/libopenjpip/CMakeLists.txt
Normal file
@ -0,0 +1,44 @@
|
||||
INCLUDE_REGULAR_EXPRESSION("^.*$")
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
${FCGI_INCLUDE_DIRNAME}
|
||||
)
|
||||
|
||||
# Defines the source code for the library
|
||||
SET(OPENJPIP_SRCS
|
||||
${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
|
||||
)
|
||||
|
||||
# Build the library
|
||||
ADD_LIBRARY(openjpip_local ${OPENJPIP_SRCS})
|
||||
|
||||
ADD_LIBRARY(openjpip_server ${OPENJPIP_SRCS})
|
||||
TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBNAME})
|
||||
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
|
||||
)
|
1
applications/jpip/opj_client/CMakeLists.txt
Normal file
1
applications/jpip/opj_client/CMakeLists.txt
Normal file
@ -0,0 +1 @@
|
||||
ADD_SUBDIRECTORY(opj_dec_server)
|
27
applications/jpip/opj_client/opj_dec_server/CMakeLists.txt
Normal file
27
applications/jpip/opj_client/opj_dec_server/CMakeLists.txt
Normal file
@ -0,0 +1,27 @@
|
||||
|
||||
SET(OPJ_DEC_SERVER_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cache_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_dec_server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jp2k_decoder.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/imgsock_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jpipstream_manager.c
|
||||
)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
../../libopenjpip
|
||||
)
|
||||
|
||||
# Build executable
|
||||
|
||||
ADD_EXECUTABLE(opj_dec_server ${OPJ_DEC_SERVER_SRCS})
|
||||
TARGET_LINK_LIBRARIES(opj_dec_server openjpip_local ${OPENJPEG_LIBRARY_NAME})
|
||||
|
||||
# On unix you need to link to the math library:
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(opj_dec_server m)
|
||||
ENDIF(UNIX)
|
||||
# Install exe
|
||||
INSTALL(TARGETS opj_dec_server
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
29
applications/jpip/opj_server/CMakeLists.txt
Normal file
29
applications/jpip/opj_server/CMakeLists.txt
Normal file
@ -0,0 +1,29 @@
|
||||
|
||||
# Headers file are located here:
|
||||
INCLUDE_DIRECTORIES(
|
||||
${FCGI_INCLUDE_DIRNAME}
|
||||
../libopenjpip
|
||||
)
|
||||
|
||||
SET(OPJ_SERVER_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/channel_manager.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/opj_server.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/query_parser.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/session_manager.c
|
||||
)
|
||||
|
||||
# Build executable
|
||||
|
||||
ADD_DEFINITIONS(-DSERVER)
|
||||
ADD_EXECUTABLE(opj_server ${OPJ_SERVER_SRCS})
|
||||
TARGET_LINK_LIBRARIES(opj_server openjpip_server ${FCGI_LIBNAME})
|
||||
|
||||
# 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
|
||||
)
|
39
applications/jpip/tools/CMakeLists.txt
Normal file
39
applications/jpip/tools/CMakeLists.txt
Normal file
@ -0,0 +1,39 @@
|
||||
|
||||
ADD_SUBDIRECTORY(indexer)
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
../libopenjpip
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(jpip_to_j2k jpip_to_j2k.c)
|
||||
TARGET_LINK_LIBRARIES(jpip_to_j2k openjpip_local)
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(jpip_to_j2k m)
|
||||
ENDIF(UNIX)
|
||||
# Install exe
|
||||
INSTALL(TARGETS jpip_to_j2k
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(jpip_to_jp2 jpip_to_jp2.c)
|
||||
TARGET_LINK_LIBRARIES(jpip_to_jp2 openjpip_local)
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(jpip_to_jp2 m)
|
||||
ENDIF(UNIX)
|
||||
# Install exe
|
||||
INSTALL(TARGETS jpip_to_jp2
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
||||
|
||||
ADD_EXECUTABLE(test_index test_index.c)
|
||||
TARGET_LINK_LIBRARIES(test_index openjpip_local)
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(test_index m)
|
||||
ENDIF(UNIX)
|
||||
# Install exe
|
||||
INSTALL(TARGETS test_index
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
26
applications/jpip/tools/indexer/CMakeLists.txt
Normal file
26
applications/jpip/tools/indexer/CMakeLists.txt
Normal file
@ -0,0 +1,26 @@
|
||||
SET(INDEXER_SRCS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/bio.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cio.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/index_create.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/int.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jp2.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/jpip.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/pi.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/t2.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tcd.c
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/tgt.c
|
||||
)
|
||||
|
||||
# Build executable
|
||||
|
||||
ADD_EXECUTABLE(index_create ${INDEXER_SRCS})
|
||||
|
||||
# On unix you need to link to the math library:
|
||||
IF(UNIX)
|
||||
TARGET_LINK_LIBRARIES(index_create m)
|
||||
ENDIF(UNIX)
|
||||
# Install exe
|
||||
INSTALL(TARGETS index_create
|
||||
EXPORT OpenJPEGTargets
|
||||
DESTINATION ${OPENJPEG_INSTALL_BIN_DIR} COMPONENT Applications
|
||||
)
|
17
thirdparty/CMakeLists.txt
vendored
17
thirdparty/CMakeLists.txt
vendored
@ -143,4 +143,21 @@ ELSE (LCMS2_FOUND) # not found lcms2
|
||||
ENDIF (LCMS_FOUND)
|
||||
ENDIF(LCMS2_FOUND)
|
||||
|
||||
#------------
|
||||
# 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("Your system seems to have a FCGI lib available, we will use it to build JPIP")
|
||||
|
||||
ELSE (FCGI_FOUND) # not found
|
||||
|
||||
message("FCGI lib not found, JPIP will not be built as it requires FCGI")
|
||||
|
||||
ENDIF(FCGI_FOUND)
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user