Changed: Moved lua, luabind and curl FIND_PACKAGE in root CMakeLists.txt

This commit is contained in:
kervala 2013-09-08 12:52:00 +02:00
parent 17ebe78cf6
commit 87ee7fa8d2
3 changed files with 33 additions and 40 deletions

View file

@ -106,7 +106,6 @@ IF(WIN32)
ENDIF(WITH_MFC) ENDIF(WITH_MFC)
ENDIF(WIN32) ENDIF(WIN32)
FIND_PACKAGE(Threads REQUIRED)
FIND_PACKAGE(LibXml2 REQUIRED) FIND_PACKAGE(LibXml2 REQUIRED)
FIND_PACKAGE(PNG REQUIRED) FIND_PACKAGE(PNG REQUIRED)
FIND_PACKAGE(Jpeg) FIND_PACKAGE(Jpeg)
@ -114,6 +113,7 @@ FIND_PACKAGE(Jpeg)
IF(WITH_STATIC_LIBXML2) IF(WITH_STATIC_LIBXML2)
SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC) SET(LIBXML2_DEFINITIONS ${LIBXML2_DEFINITIONS} -DLIBXML_STATIC)
ENDIF(WITH_STATIC_LIBXML2) ENDIF(WITH_STATIC_LIBXML2)
IF(WITH_STATIC) IF(WITH_STATIC)
# libxml2 could need winsock2 library # libxml2 could need winsock2 library
SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB}) SET(LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} ${WINSOCK2_LIB})
@ -144,6 +144,36 @@ IF(WITH_NEL)
IF(WITH_GUI) IF(WITH_GUI)
FIND_PACKAGE(Libwww REQUIRED) 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) ENDIF(WITH_GUI)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR}) INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/nel/include ${LIBXML2_INCLUDE_DIR})

View file

@ -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 SRC *.cpp *.h)
FILE(GLOB HEADERS ../../include/nel/gui/*.h) FILE(GLOB HEADERS ../../include/nel/gui/*.h)
@ -31,6 +26,8 @@ TARGET_LINK_LIBRARIES( nelgui
${CURL_LIBRARIES} ${CURL_LIBRARIES}
) )
ADD_DEFINITIONS(${LIBXML2_DEFINITIONS} ${CURL_DEFINITIONS} ${LUABIND_DEFINITIONS})
IF(WITH_PCH) IF(WITH_PCH)
ADD_NATIVE_PRECOMPILED_HEADER(nelgui ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp) ADD_NATIVE_PRECOMPILED_HEADER(nelgui ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.h ${CMAKE_CURRENT_SOURCE_DIR}/stdpch.cpp)
ENDIF(WITH_PCH) ENDIF(WITH_PCH)

View file

@ -14,44 +14,10 @@ IF(WITH_RYZOM_CLIENT)
MESSAGE( FATAL_ERROR "The client cannot be built without the NeL GUI Library (WITH_GUI)") MESSAGE( FATAL_ERROR "The client cannot be built without the NeL GUI Library (WITH_GUI)")
ENDIF(NOT 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) ADD_SUBDIRECTORY(client)
ELSEIF(WITH_RYZOM_TOOLS) ELSEIF(WITH_RYZOM_TOOLS)
# Need clientsheets lib for sheets packer tool # Need clientsheets lib for sheets packer tool
ADD_SUBDIRECTORY(client) ADD_SUBDIRECTORY(client)
ENDIF(WITH_RYZOM_CLIENT) ENDIF(WITH_RYZOM_CLIENT)
IF(WITH_RYZOM_TOOLS) IF(WITH_RYZOM_TOOLS)