2010-05-06 00:08:41 +00:00
|
|
|
#
|
|
|
|
# Find the W3C libwww includes and library
|
|
|
|
#
|
|
|
|
# This module defines
|
|
|
|
# LIBWWW_INCLUDE_DIR, where to find tiff.h, etc.
|
2013-09-08 10:53:35 +00:00
|
|
|
# LIBWWW_LIBRARY, where to find the Libwww library.
|
|
|
|
# LIBWWW_FOUND, If false, do not try to use Libwww.
|
2010-05-06 00:08:41 +00:00
|
|
|
|
2011-08-12 14:41:58 +00:00
|
|
|
OPTION(WITH_LIBWWW_STATIC "Use only static libraries for libwww" OFF)
|
|
|
|
|
2010-05-06 00:08:41 +00:00
|
|
|
# also defined, but not for general use are
|
2010-10-03 09:39:04 +00:00
|
|
|
IF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
2010-05-06 00:08:41 +00:00
|
|
|
# in cache already
|
2013-09-08 10:53:35 +00:00
|
|
|
SET(Libwww_FIND_QUIETLY TRUE)
|
2010-10-03 09:39:04 +00:00
|
|
|
ENDIF(LIBWWW_LIBRARIES AND LIBWWW_INCLUDE_DIR)
|
2010-05-06 00:08:41 +00:00
|
|
|
|
2010-05-29 19:49:31 +00:00
|
|
|
FIND_PATH(LIBWWW_INCLUDE_DIR
|
2010-05-06 00:08:41 +00:00
|
|
|
WWWInit.h
|
|
|
|
PATHS
|
|
|
|
/usr/local/include
|
|
|
|
/usr/include
|
|
|
|
/sw/include
|
|
|
|
/opt/local/include
|
|
|
|
/opt/csw/include
|
|
|
|
/opt/include
|
|
|
|
PATH_SUFFIXES libwww w3c-libwww
|
|
|
|
)
|
|
|
|
|
2010-05-29 19:49:31 +00:00
|
|
|
# when installing libwww on mac os x using macports the file wwwconf.h resides
|
|
|
|
# in /opt/local/include and not in the real libwww include dir :/
|
|
|
|
FIND_PATH(LIBWWW_ADDITIONAL_INCLUDE_DIR
|
|
|
|
wwwconf.h
|
2010-05-06 00:08:41 +00:00
|
|
|
PATHS
|
2010-05-29 19:49:31 +00:00
|
|
|
/usr/local/include
|
|
|
|
/usr/include
|
|
|
|
/sw/include
|
|
|
|
/opt/local/include
|
|
|
|
/opt/csw/include
|
|
|
|
/opt/include
|
2010-05-06 00:08:41 +00:00
|
|
|
)
|
|
|
|
|
2010-05-29 19:49:31 +00:00
|
|
|
# combine both include directories into one variable
|
2010-06-09 17:30:53 +00:00
|
|
|
IF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
|
|
|
SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_ADDITIONAL_INCLUDE_DIR})
|
|
|
|
ENDIF(LIBWWW_ADDITIONAL_INCLUDE_DIR)
|
2010-05-29 19:49:31 +00:00
|
|
|
|
|
|
|
# helper to find all the libwww sub libraries
|
2013-09-08 10:53:35 +00:00
|
|
|
MACRO(FIND_WWW_LIBRARY MYLIBRARY OPTION FILE)
|
2011-08-12 14:41:58 +00:00
|
|
|
IF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL)
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES_OLD ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
|
|
|
|
ENDIF(WITH_LIBWWW_STATIC AND UNIX AND NOT APPLE AND NOT WITH_STATIC_EXTERNAL)
|
|
|
|
|
2013-09-08 10:53:35 +00:00
|
|
|
FIND_LIBRARY(${MYLIBRARY}_RELEASE
|
|
|
|
NAMES ${FILE}
|
|
|
|
PATHS
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
|
|
|
/usr/lib/x86_64-linux-gnu
|
|
|
|
/usr/local/X11R6/lib
|
|
|
|
/usr/X11R6/lib
|
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/csw/lib
|
|
|
|
/opt/lib
|
|
|
|
/usr/freeware/lib64
|
|
|
|
)
|
|
|
|
|
|
|
|
FIND_LIBRARY(${MYLIBRARY}_DEBUG
|
|
|
|
NAMES ${FILE}d
|
2010-05-29 19:49:31 +00:00
|
|
|
PATHS
|
|
|
|
/usr/local/lib
|
|
|
|
/usr/lib
|
2013-02-14 13:46:42 +00:00
|
|
|
/usr/lib/x86_64-linux-gnu
|
2010-05-29 19:49:31 +00:00
|
|
|
/usr/local/X11R6/lib
|
|
|
|
/usr/X11R6/lib
|
|
|
|
/sw/lib
|
|
|
|
/opt/local/lib
|
|
|
|
/opt/csw/lib
|
|
|
|
/opt/lib
|
|
|
|
/usr/freeware/lib64
|
|
|
|
)
|
2010-10-03 09:39:04 +00:00
|
|
|
|
2011-08-12 14:41:58 +00:00
|
|
|
IF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
|
|
|
|
SET(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_OLD})
|
|
|
|
ENDIF(CMAKE_FIND_LIBRARY_SUFFIXES_OLD)
|
|
|
|
|
2013-09-08 10:53:35 +00:00
|
|
|
IF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
|
|
|
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
|
|
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} optimized ${${MYLIBRARY}_RELEASE} debug ${${MYLIBRARY}_DEBUG})
|
|
|
|
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
|
|
ELSEIF(${MYLIBRARY}_RELEASE)
|
|
|
|
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
|
|
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_RELEASE})
|
|
|
|
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
|
|
|
ELSEIF(${MYLIBRARY}_DEBUG)
|
2011-08-12 14:41:58 +00:00
|
|
|
IF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
2013-09-08 10:53:35 +00:00
|
|
|
SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${${MYLIBRARY}_DEBUG})
|
2011-08-12 14:41:58 +00:00
|
|
|
ENDIF(${OPTION} STREQUAL REQUIRED OR WITH_STATIC OR WITH_LIBWWW_STATIC)
|
2013-09-08 10:53:35 +00:00
|
|
|
ELSE(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
|
|
|
IF(NOT Libwww_FIND_QUIETLY AND NOT WIN32)
|
2010-09-28 08:49:30 +00:00
|
|
|
MESSAGE(STATUS "Warning: Libwww: Library not found: ${MYLIBRARY}")
|
2013-09-08 10:53:35 +00:00
|
|
|
ENDIF(NOT Libwww_FIND_QUIETLY AND NOT WIN32)
|
|
|
|
ENDIF(${MYLIBRARY}_RELEASE AND ${MYLIBRARY}_DEBUG)
|
2010-09-28 08:49:30 +00:00
|
|
|
|
2013-09-08 10:53:35 +00:00
|
|
|
MARK_AS_ADVANCED(${MYLIBRARY}_RELEASE ${MYLIBRARY}_DEBUG)
|
2010-10-03 09:39:04 +00:00
|
|
|
ENDMACRO(FIND_WWW_LIBRARY)
|
|
|
|
|
|
|
|
MACRO(LINK_WWW_LIBRARY MYLIBRARY OTHERLIBRARY SYMBOL)
|
2011-08-12 14:41:58 +00:00
|
|
|
IF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL)
|
|
|
|
LINK_DEPENDS(LIBWWW_LIBRARIES ${MYLIBRARY} ${OTHERLIBRARY} ${SYMBOL})
|
|
|
|
ENDIF(NOT WITH_LIBWWW_STATIC AND NOT WITH_STATIC_EXTERNAL)
|
2010-10-03 09:39:04 +00:00
|
|
|
ENDMACRO(LINK_WWW_LIBRARY)
|
|
|
|
|
|
|
|
# Find and link required libs for static or dynamic
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWAPP_LIBRARY REQUIRED wwwapp) # cache core file ftp gopher html http mime news stream telnet trans utils zip xml xmlparse
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWCORE_LIBRARY REQUIRED wwwcore) # utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWFILE_LIBRARY REQUIRED wwwfile) # core trans utils html
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWHTML_LIBRARY REQUIRED wwwhtml) # core utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWHTTP_LIBRARY REQUIRED wwwhttp) # md5 core mime stream utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWMIME_LIBRARY REQUIRED wwwmime) # core cache stream utils
|
|
|
|
|
|
|
|
# Required for static or if underlinking
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWCACHE_LIBRARY OPTIONAL wwwcache) # core trans utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWSTREAM_LIBRARY OPTIONAL wwwstream) # core file utils
|
|
|
|
|
2010-11-02 16:16:50 +00:00
|
|
|
FIND_WWW_LIBRARY(LIBWWWTRANS_LIBRARY REQUIRED wwwtrans) # core utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWUTILS_LIBRARY REQUIRED wwwutils)
|
|
|
|
|
|
|
|
|
2010-10-03 09:39:04 +00:00
|
|
|
# Required only if underlinking
|
|
|
|
|
|
|
|
# Unused protocols
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWFTP_LIBRARY OPTIONAL wwwftp) # core file utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWGOPHER_LIBRARY OPTIONAL wwwgopher) # core html utils file
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWNEWS_LIBRARY OPTIONAL wwwnews) # core html mime stream utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWTELNET_LIBRARY OPTIONAL wwwtelnet) # core utils
|
|
|
|
|
|
|
|
# Other used by app
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWDIR_LIBRARY OPTIONAL wwwdir) # file
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWINIT_LIBRARY OPTIONAL wwwinit) # app cache core file html utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWMUX_LIBRARY OPTIONAL wwwmux) # core stream trans utils
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY OPTIONAL wwwxml) # core utils xmlparse
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY OPTIONAL wwwzip) # core utils
|
|
|
|
FIND_WWW_LIBRARY(LIBXMLPARSE_LIBRARY OPTIONAL xmlparse) # xmltok
|
|
|
|
|
|
|
|
# Other used by other
|
|
|
|
FIND_WWW_LIBRARY(LIBXMLTOK_LIBRARY OPTIONAL xmltok)
|
|
|
|
FIND_WWW_LIBRARY(LIBWWWSSL_LIBRARY OPTIONAL wwwssl)
|
|
|
|
FIND_WWW_LIBRARY(LIBMD5_LIBRARY OPTIONAL md5)
|
|
|
|
FIND_WWW_LIBRARY(LIBPICS_LIBRARY OPTIONAL pics)
|
|
|
|
|
|
|
|
# Other external libraries
|
|
|
|
FIND_PACKAGE(EXPAT QUIET)
|
|
|
|
FIND_PACKAGE(OpenSSL QUIET)
|
|
|
|
FIND_WWW_LIBRARY(LIBREGEX_LIBRARY OPTIONAL gnu_regex)
|
|
|
|
|
|
|
|
# Now link all libs together
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTLoadCache)
|
2010-10-14 18:14:35 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWCACHE_LIBRARY HTCacheAppend)
|
2010-10-03 09:39:04 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWFTP_LIBRARY HTLoadFTP)
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWGOPHER_LIBRARY HTLoadGopher)
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWNEWS_LIBRARY HTLoadNews)
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWTELNET_LIBRARY HTLoadTelnet)
|
|
|
|
|
2010-10-04 19:09:38 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTStreamToChunk)
|
2010-11-02 08:57:52 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWSTREAM_LIBRARY HTGuess_new)
|
2010-10-10 21:04:39 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWFILE_LIBRARY LIBWWWDIR_LIBRARY HTDir_new)
|
2010-10-04 19:09:38 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWINIT_LIBRARY HTProtocolInit)
|
2010-10-03 09:39:04 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWXML_LIBRARY HTXML_new)
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBWWWZIP_LIBRARY HTZLib_inflate)
|
|
|
|
|
|
|
|
# libwwwxml can be linked to xmlparse or expat
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY LIBXMLPARSE_LIBRARY XML_ParserCreate)
|
|
|
|
|
2010-11-02 12:36:12 +00:00
|
|
|
IF(LIBXMLPARSE_LIBRARY_LINKED)
|
|
|
|
LINK_WWW_LIBRARY(LIBXMLPARSE_LIBRARY EXPAT_LIBRARY XmlInitEncoding)
|
|
|
|
ELSE(LIBXMLPARSE_LIBRARY_LINKED)
|
2010-10-03 09:39:04 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWXML_LIBRARY EXPAT_LIBRARY XML_ParserCreate)
|
2010-11-02 12:36:12 +00:00
|
|
|
ENDIF(LIBXMLPARSE_LIBRARY_LINKED)
|
2010-09-03 20:48:53 +00:00
|
|
|
|
2010-10-03 09:39:04 +00:00
|
|
|
LINK_WWW_LIBRARY(LIBWWWHTTP_LIBRARY LIBMD5_LIBRARY MD5Init)
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY LIBREGEX_LIBRARY regexec)
|
|
|
|
LINK_WWW_LIBRARY(LIBWWWAPP_LIBRARY OPENSSL_LIBRARIES SSL_new)
|
2010-09-25 13:41:37 +00:00
|
|
|
|
|
|
|
INCLUDE(FindPackageHandleStandardArgs)
|
2013-09-08 10:53:35 +00:00
|
|
|
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Libwww DEFAULT_MSG
|
2010-09-25 13:41:37 +00:00
|
|
|
LIBWWW_LIBRARIES
|
|
|
|
LIBWWW_INCLUDE_DIR
|
|
|
|
)
|