fix compilation of libopenjpip (libcurl dependency) with CMake. Credit to Winfried.
authorVincent Torri <vincent.torri@gmail.com>
Sat, 19 Nov 2011 07:16:14 +0000 (07:16 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Sat, 19 Nov 2011 07:16:14 +0000 (07:16 +0000)
CHANGES
CMakeLists.txt
applications/jpip/libopenjpip/CMakeLists.txt

diff --git a/CHANGES b/CHANGES
index eedf8153e21aa1fb6404f6ba62393ba85da8dad7..692f6ed5aa496c2838f208f9c442f103b8ebe398 100644 (file)
--- 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
index 065e5b60d5878308c96e74ab80fa6e267c30d782..0763ecd15b622b4b329619d4cdd0e7c2bfca0d25 100644 (file)
@@ -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)
index d56fba4a4c14ddf88390ed2e69bf1cf76d9b0382..2dce25f784ed6f427bc625d5cbb079e183a12f30 100644 (file)
@@ -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")