From 60ba9387948b117b630a089b09ec6271692b2917 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 10 Sep 2011 18:45:54 +0200 Subject: [PATCH] Changed: Allow to use external under Linux and Mac OS X --- code/CMakeModules/FindExternal.cmake | 14 +++++++------- code/CMakeModules/nel.cmake | 16 +++++++++++----- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/code/CMakeModules/FindExternal.cmake b/code/CMakeModules/FindExternal.cmake index 1ca01bd99..5d6086bc6 100644 --- a/code/CMakeModules/FindExternal.cmake +++ b/code/CMakeModules/FindExternal.cmake @@ -8,7 +8,7 @@ # EXTERNAL_FOUND - True if the external libraries are available SET(EXTERNAL_TEMP_PATH ${CMAKE_CURRENT_SOURCE_DIR}/external ${CMAKE_CURRENT_SOURCE_DIR}/../external ${CMAKE_CURRENT_SOURCE_DIR}/3rdParty ${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty ${EXTERNAL_PATH}) -SET(EXTERNAL_TEMP_FILE "include/zlib.h") +SET(EXTERNAL_TEMP_FILE "include/wwwconf.h") SET(EXTERNAL_NAME "external") # If using STLport preprend external_stlport @@ -36,18 +36,18 @@ IF(EXTERNAL_PATH) SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include") # Using 32 or 64 bits binaries - IF(TARGET_X64) + IF(TARGET_X64 AND WIN32) SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin64") - ELSE(TARGET_X64) + ELSE(TARGET_X64 AND WIN32) SET(EXTERNAL_BINARY_PATH "${EXTERNAL_PATH}/bin") - ENDIF(TARGET_X64) + ENDIF(TARGET_X64 AND WIN32) # Using 32 or 64 bits libraries - IF(TARGET_X64) + IF(TARGET_X64 AND WIN32) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib64") - ELSE(TARGET_X64) + ELSE(TARGET_X64 AND WIN32) SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib") - ENDIF(TARGET_X64) + ENDIF(TARGET_X64 AND WIN32) SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake diff --git a/code/CMakeModules/nel.cmake b/code/CMakeModules/nel.cmake index 19e0ea5c0..64e3e7275 100644 --- a/code/CMakeModules/nel.cmake +++ b/code/CMakeModules/nel.cmake @@ -178,6 +178,11 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(WITH_STATIC "With static libraries." OFF) ENDIF(WIN32) OPTION(WITH_STATIC_DRIVERS "With static drivers." OFF) + IF(WIN32) + OPTION(WITH_EXTERNAL "With provided external." ON ) + ELSE(WIN32) + OPTION(WITH_EXTERNAL "With provided external." OFF) + ENDIF(WIN32) OPTION(WITH_STATIC_EXTERNAL "With static external libraries" OFF) ### @@ -203,9 +208,9 @@ MACRO(NL_SETUP_DEFAULT_OPTIONS) OPTION(BUILD_DASHBOARD "Build to the CDash dashboard" OFF) - OPTION(WITH_NEL "Build NeL (nearly always required)." ON ) - OPTION(WITH_NELNS "Build NeL Network Services." OFF) - OPTION(WITH_RYZOM "Build Ryzom Core." ON ) + OPTION(WITH_NEL "Build NeL (nearly always required)." ON ) + OPTION(WITH_NELNS "Build NeL Network Services." OFF) + OPTION(WITH_RYZOM "Build Ryzom Core." ON ) OPTION(WITH_SNOWBALLS "Build Snowballs." OFF) ENDMACRO(NL_SETUP_DEFAULT_OPTIONS) @@ -518,9 +523,11 @@ MACRO(RYZOM_SETUP_PREFIX_PATHS) ENDMACRO(RYZOM_SETUP_PREFIX_PATHS) MACRO(SETUP_EXTERNAL) - IF(WIN32) + IF(WITH_EXTERNAL) FIND_PACKAGE(External REQUIRED) + ENDIF(WITH_EXTERNAL) + IF(WIN32) INCLUDE(${CMAKE_ROOT}/Modules/Platform/Windows-cl.cmake) IF(MSVC10) IF(NOT MSVC10_REDIST_DIR) @@ -567,5 +574,4 @@ MACRO(SETUP_EXTERNAL) INCLUDE_DIRECTORIES(${VC_INCLUDE_DIR} ${WINSDK_INCLUDE_DIR}) ENDIF(WIN32) ENDIF(WITH_STLPORT) - ENDMACRO(SETUP_EXTERNAL)