From cf8109e469fcf3c58248da023b2004ac13148fe7 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 3 Sep 2010 22:48:53 +0200 Subject: [PATCH] Fixed: libwww GNU Regex, libcurl OpenSSL dependencies under Windows --- code/CMakeModules/FindLibwww.cmake | 23 ++++++++++++++++++++++- code/ryzom/CMakeLists.txt | 3 +++ code/ryzom/client/src/CMakeLists.txt | 7 ++++++- 3 files changed, 31 insertions(+), 2 deletions(-) diff --git a/code/CMakeModules/FindLibwww.cmake b/code/CMakeModules/FindLibwww.cmake index d715fa139..dd2e9621a 100644 --- a/code/CMakeModules/FindLibwww.cmake +++ b/code/CMakeModules/FindLibwww.cmake @@ -84,12 +84,33 @@ FIND_WWW_LIBRARY(LIBWWWXML_LIBRARY wwwxml) FIND_WWW_LIBRARY(LIBWWWZIP_LIBRARY wwwzip) # combine all the libraries into one variable -SET(LIBWWW_LIBRARY +SET(LIBWWW_LIBRARIES ${LIBWWWAPP_LIBRARY} ${LIBWWWCORE_LIBRARY} ${LIBWWWDIR_LIBRARY} ${LIBWWWHTML_LIBRARY} ${LIBWWWHTTP_LIBRARY} ${LIBWWWINIT_LIBRARY} ${LIBWWWMIME_LIBRARY} ${LIBWWWMUX_LIBRARY} ${LIBWWWSTREAM_LIBRARY} ${LIBWWWCACHE_LIBRARY} ${LIBWWWFILE_LIBRARY} ${LIBWWWTRANS_LIBRARY} ${LIBWWWUTILS_LIBRARY} ) +# Windows libwww version needs GNU Regex +IF(WIN32) + FIND_PATH(LIBWWW_REGEX_INCLUDE_DIR + regex.h + PATHS + /usr/local/include + /usr/include + /sw/include + /opt/local/include + /opt/csw/include + /opt/include + ) + + # combine both include directories into one variable + IF(LIBWWW_REGEX_INCLUDE_DIR) + SET(LIBWWW_INCLUDE_DIR ${LIBWWW_INCLUDE_DIR} ${LIBWWW_REGEX_INCLUDE_DIR}) + FIND_WWW_LIBRARY(LIBREGEX_LIBRARY gnu_regex) + SET(LIBWWW_LIBRARIES ${LIBWWW_LIBRARIES} ${LIBREGEX_LIBRARY}) + ENDIF(LIBWWW_REGEX_INCLUDE_DIR) +ENDIF(WIN32) + IF(LIBWWW_LIBRARY AND LIBWWW_INCLUDE_DIR) SET(LIBWWW_FOUND "YES") IF(NOT LIBWWW_FIND_QUIETLY) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index 149861d31..dd6355c2d 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -8,6 +8,7 @@ ELSE(WITH_LUA51) ENDIF(WITH_LUA51) FIND_PACKAGE(Luabind REQUIRED) FIND_PACKAGE(CURL REQUIRED) +FIND_PACKAGE(OpenSSL REQUIRED) FIND_PACKAGE(Libwww) FIND_PACKAGE(ZLIB) IF(NOT WIN32 AND NOT APPLE) @@ -17,6 +18,8 @@ ENDIF(NOT WIN32 AND NOT APPLE) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common/src ) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/common ) +NL_CONFIGURE_CHECKS() + ADD_SUBDIRECTORY(common) IF(WITH_RYZOM_CLIENT) diff --git a/code/ryzom/client/src/CMakeLists.txt b/code/ryzom/client/src/CMakeLists.txt index 996263e2f..8bfc9e424 100644 --- a/code/ryzom/client/src/CMakeLists.txt +++ b/code/ryzom/client/src/CMakeLists.txt @@ -81,7 +81,8 @@ TARGET_LINK_LIBRARIES(ryzom_client ${PLATFORM_LINKFLAGS} ${LUA_LIBRARIES} ${LUABIND_LIBRARY} ${CURL_LIBRARIES} - ${LIBWWW_LIBRARY} + ${OPENSSL_LIBRARIES} + ${LIBWWW_LIBRARIES} ${SEVENZIP_LIBRARY} expat) # TODO: find expat cleanly using a find script @@ -91,6 +92,10 @@ ENDIF(NOT APPLE AND NOT WIN32) ADD_DEFINITIONS(${LIBXML2_DEFINITIONS}) +IF(WITH_STATIC) + ADD_DEFINITIONS(-DCURL_STATICLIB -DLIBXML_STATIC) +ENDIF(WITH_STATIC) + NL_DEFAULT_PROPS(ryzom_client "Ryzom, Client: Ryzom Core Client") NL_ADD_RUNTIME_FLAGS(ryzom_client)