From: Frederic Bouvier Date: Mon, 12 Sep 2011 08:53:18 +0000 (+0200) Subject: Auto detect 3rd Party root for Windows X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=cad21935d6157e91f26a427bc2b751ac780e494e;p=simgear.git Auto detect 3rd Party root for Windows --- diff --git a/CMakeLists.txt b/CMakeLists.txt index 68d8e059..63384bf6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,7 +42,21 @@ option(JPEG_FACTORY "Enable JPEG-factory support" OFF) option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" ON) option(ENABLE_RTI "Set to ON to build SimGear with RTI support" OFF) -set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted") +if (MSVC) + GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_SOURCE_DIR} PATH) + if (CMAKE_CL_64) + SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty.x64") + else (CMAKE_CL_64) + SET(TEST_3RDPARTY_DIR "${PARENT_DIR}/3rdparty") + endif (CMAKE_CL_64) + if (EXISTS ${TEST_3RDPARTY_DIR}) + set(MSVC_3RDPARTY_ROOT ${PARENT_DIR} CACHE PATH "Location where the third-party dependencies are extracted") + else (EXISTS ${TEST_3RDPARTY_DIR}) + set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted") + endif (EXISTS ${TEST_3RDPARTY_DIR}) +else (MSVC) + set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted") +endif (MSVC) if (MSVC AND MSVC_3RDPARTY_ROOT) message(STATUS "3rdparty files located in ${MSVC_3RDPARTY_ROOT}") @@ -62,6 +76,7 @@ if (MSVC AND MSVC_3RDPARTY_ROOT) set (CMAKE_LIBRARY_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/lib ) set (CMAKE_INCLUDE_PATH ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include ${MSVC_3RDPARTY_ROOT}/install/${OSG_MSVC}/OpenScenegraph/include) set (BOOST_ROOT ${MSVC_3RDPARTY_ROOT}/boost_1_44_0) + message(STATUS "BOOST_ROOT is ${BOOST_ROOT}") set (OPENAL_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include) set (ALUT_INCLUDE_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/include) set (OPENAL_LIBRARY_DIR ${MSVC_3RDPARTY_ROOT}/${MSVC_3RDPARTY_DIR}/lib)