From d7c300a1f118602eac79e379118ab18b0b856772 Mon Sep 17 00:00:00 2001 From: kervala Date: Sat, 28 Aug 2010 14:44:24 +0200 Subject: [PATCH] Changed: Allow user to specify externals location for CMake --- code/nel/CMakeLists.txt | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/code/nel/CMakeLists.txt b/code/nel/CMakeLists.txt index 94b0bf05e..12398e297 100644 --- a/code/nel/CMakeLists.txt +++ b/code/nel/CMakeLists.txt @@ -11,6 +11,8 @@ # * NL_SHARE_PREFIX (default: $CMAKE_INSTALL_PREFIX/share) # * NL_BIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/bin) # * NL_SBIN_PREFIX (default: $CMAKE_INSTALL_PREFIX/sbin) +# * NL_LIB_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib) +# * NL_DRIVER_PREFIX (default: $CMAKE_INSTALL_PREFIX/lib (windows) or $CMAKE_INSTALL_PREFIX/lib/nel) # * Enable building of documentation: add -DBUILD_DOCUMENTATION:BOOL=ON - new make target: DoxygenDoc # * Updating version: update header (above) but also update NL_VERSION below. # * To build binary archive, use the 'package' target. @@ -38,10 +40,23 @@ INCLUDE(${CMAKE_ROOT}/Modules/Documentation.cmake OPTIONAL) CHECK_OUT_OF_SOURCE() IF(WIN32) - SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/include;${CMAKE_INCLUDE_PATH}") + IF(NOT EXTERNAL_PATH) + SET(EXTERNAL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty" CACHE PATH "3rd party libraries root path.") + ENDIF(NOT EXTERNAL_PATH) + + IF(NOT EXTERNAL_INCLUDE_PATH) + SET(EXTERNAL_INCLUDE_PATH "${EXTERNAL_PATH}/include" CACHE PATH "3rd party libraries include path.") + ENDIF(NOT EXTERNAL_INCLUDE_PATH) + + IF(NOT EXTERNAL_LIBRARY_PATH) + SET(EXTERNAL_LIBRARY_PATH "${EXTERNAL_PATH}/lib" CACHE PATH "3rd party libraries lib path.") + ENDIF(NOT EXTERNAL_LIBRARY_PATH) + + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_INCLUDE_PATH};${CMAKE_INCLUDE_PATH}") # Stupid hack for FindOpenAL.cmake - SET(CMAKE_INCLUDE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty;${CMAKE_INCLUDE_PATH}") - SET(CMAKE_LIBRARY_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../3rdParty/lib;${CMAKE_LIBRARY_PATH}") + SET(CMAKE_INCLUDE_PATH "${EXTERNAL_PATH};${CMAKE_INCLUDE_PATH}") + SET(CMAKE_LIBRARY_PATH "${EXTERNAL_LIBRARY_PATH};${CMAKE_LIBRARY_PATH}") + IF(NOT DEFINED ENV{QTDIR}) SET(ENV{QTDIR} "c:/qt/4.5.0") ENDIF(NOT DEFINED ENV{QTDIR})