diff --git a/CHANGES b/CHANGES index eedf8153..692f6ed5 100644 --- a/CHANGES +++ b/CHANGES @@ -5,8 +5,11 @@ What's New for OpenJPEG ! : changed + : added +November 19, 2011 +* [vincent] fix compilation of libopenjpip (libcurl dependency) with CMake. Credit to Winfried. + November 16, 2011 -* [vincent] fix compilation of libopenjpip (libcurl dependency) and fix 'distcheck' rule +* [vincent] fix compilation of libopenjpip (libcurl dependency) with the autotools and fix 'distcheck' rule October 21, 2011 * [mickael] remove one obvious memory leak from test functions diff --git a/CMakeLists.txt b/CMakeLists.txt index 065e5b60..0763ecd1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -210,6 +210,17 @@ 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) + 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) + IF(BUILD_CODEC OR BUILD_MJ2 OR BUILD_JPIP) OPTION(BUILD_THIRDPARTY "Build the thirdparty executables if it is needed" OFF) ADD_SUBDIRECTORY(thirdparty) diff --git a/applications/jpip/libopenjpip/CMakeLists.txt b/applications/jpip/libopenjpip/CMakeLists.txt index d56fba4a..2dce25f7 100644 --- a/applications/jpip/libopenjpip/CMakeLists.txt +++ b/applications/jpip/libopenjpip/CMakeLists.txt @@ -3,6 +3,7 @@ INCLUDE_REGULAR_EXPRESSION("^.*$") INCLUDE_DIRECTORIES( ${OPENJPEG_SOURCE_DIR}/libopenjpeg ${FCGI_INCLUDE_DIRNAME} + ${CURL_INCLUDE_DIRS} ) # Defines the source code for the library @@ -42,10 +43,10 @@ ${CMAKE_CURRENT_SOURCE_DIR}/dec_clientmsg_handler.c # Build the library ADD_LIBRARY(openjpip_local STATIC ${OPENJPIP_SRCS} ${LOCAL_SRCS}) -TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME}) +TARGET_LINK_LIBRARIES(openjpip_local ${OPENJPEG_LIBRARY_NAME} ${CURL_LIBRARIES}) ADD_LIBRARY(openjpip_server STATIC ${OPENJPIP_SRCS}) -TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBNAME}) +TARGET_LINK_LIBRARIES(openjpip_server ${FCGI_LIBNAME} ${CURL_LIBRARIES}) SET_TARGET_PROPERTIES(openjpip_server PROPERTIES COMPILE_FLAGS "-DSERVER")