From 8581bd7415448911fe1afcb88c57014811805375 Mon Sep 17 00:00:00 2001 From: kervala Date: Sun, 8 Sep 2013 12:52:00 +0200 Subject: [PATCH] Changed: Moved lua, luabind and curl FIND_PACKAGE in root CMakeLists.txt --- code/CMakeLists.txt | 32 ++++++++++++++++++++++++++++++- code/nel/src/gui/CMakeLists.txt | 7 ++----- code/ryzom/CMakeLists.txt | 34 --------------------------------- 3 files changed, 33 insertions(+), 40 deletions(-) diff --git a/code/CMakeLists.txt b/code/CMakeLists.txt index 0cd9afd54..97feb494c 100644 --- a/code/CMakeLists.txt +++ b/code/CMakeLists.txt @@ -106,7 +106,6 @@ IF(WIN32) ENDIF(WITH_MFC) ENDIF(WIN32) -FIND_PACKAGE(Threads REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(Jpeg) @@ -114,6 +113,7 @@ FIND_PACKAGE(Jpeg) IF(WITH_STATIC_LIBXML2) SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) ENDIF(WITH_STATIC_LIBXML2) + IF(WITH_STATIC) # libxml2 could need winsock2 library SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) @@ -144,6 +144,36 @@ IF(WITH_NEL) IF(WITH_GUI) FIND_PACKAGE(Libwww REQUIRED) + IF(WITH_LUA51) + FIND_PACKAGE(Lua51 REQUIRED) + ELSE(WITH_LUA51) + FIND_PACKAGE(Lua50 REQUIRED) + ENDIF(WITH_LUA51) + FIND_PACKAGE(Luabind REQUIRED) + FIND_PACKAGE(CURL REQUIRED) + + IF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + SET(CURL_STATIC ON) + ENDIF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") + + IF(CURL_STATIC) + SET(CURL_DEFINITIONS -DCURL_STATICLIB) + + FIND_PACKAGE(OpenSSL QUIET) + + IF(OPENSSL_FOUND) + SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) + SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) + ENDIF(OPENSSL_FOUND) + + # CURL Macports version depends on libidn, libintl and libiconv too + IF(APPLE) + FIND_LIBRARY(IDN_LIBRARY idn) + FIND_LIBRARY(INTL_LIBRARY intl) + + SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY} ${INTL_LIBRARY}) + ENDIF(APPLE) + ENDIF(CURL_STATIC) ENDIF(WITH_GUI) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR}) diff --git a/code/nel/src/gui/CMakeLists.txt b/code/nel/src/gui/CMakeLists.txt index 3f183a2ff..e6a943594 100644 --- a/code/nel/src/gui/CMakeLists.txt +++ b/code/nel/src/gui/CMakeLists.txt @@ -1,8 +1,3 @@ -FIND_PACKAGE( Libwww REQUIRED ) -FIND_PACKAGE( CURL REQUIRED ) -FIND_PACKAGE( Lua51 REQUIRED ) -FIND_PACKAGE( Luabind REQUIRED ) - FILE(GLOB SRC *.cpp *.h) FILE(GLOB HEADERS ../../include/nel/gui/*.h) @@ -31,6 +26,8 @@ TARGET_LINK_LIBRARIES( nelgui ${CURL_LIBRARIES} ) +ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS}) + IF(WITH_PCH) ADD_NATIVE_PRECOMPILED_HEADER(nelgui ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ENDIF(WITH_PCH) diff --git a/code/ryzom/CMakeLists.txt b/code/ryzom/CMakeLists.txt index 95ed56c46..6e0747350 100644 --- a/code/ryzom/CMakeLists.txt +++ b/code/ryzom/CMakeLists.txt @@ -14,44 +14,10 @@ IF(WITH_RYZOM_CLIENT) MESSAGE( FATAL_ERROR "The client cannot be built without the NeL GUI Library (WITH_GUI)") ENDIF(NOT WITH_GUI) - IF(WITH_LUA51) - FIND_PACKAGE(Lua51 REQUIRED) - ELSE(WITH_LUA51) - FIND_PACKAGE(Lua50 REQUIRED) - ENDIF(WITH_LUA51) - FIND_PACKAGE(Luabind REQUIRED) - FIND_PACKAGE(CURL REQUIRED) - - IF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") - SET(CURL_STATIC ON) - ENDIF(WIN32 OR CURL_LIBRARIES MATCHES "\\.a") - - IF(CURL_STATIC) - SET(CURL_DEFINITIONS -DCURL_STATICLIB) - - FIND_PACKAGE(OpenSSL QUIET) - - IF(OPENSSL_FOUND) - SET(CURL_INCLUDE_DIRS ${CURL_INCLUDE_DIRS} ${OPENSSL_INCLUDE_DIR}) - SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${OPENSSL_LIBRARIES}) - ENDIF(OPENSSL_FOUND) - - # CURL Macports version depends on libidn, libintl and libiconv too - IF(APPLE) - FIND_LIBRARY(IDN_LIBRARY idn) - FIND_LIBRARY(INTL_LIBRARY intl) - - SET(CURL_LIBRARIES ${CURL_LIBRARIES} ${IDN_LIBRARY} ${INTL_LIBRARY}) - ENDIF(APPLE) - ENDIF(CURL_STATIC) - ADD_SUBDIRECTORY(client) - ELSEIF(WITH_RYZOM_TOOLS) - # Need clientsheets lib for sheets packer tool ADD_SUBDIRECTORY(client) - ENDIF(WITH_RYZOM_CLIENT) IF(WITH_RYZOM_TOOLS)