From 14fb839c4453d6be8fe32e8acabe6f43573e17ae Mon Sep 17 00:00:00 2001 From: Frederic Bouvier Date: Mon, 12 Sep 2011 11:07:31 +0200 Subject: [PATCH] Auto detect 3rd Party root for Windows --- CMakeLists.txt | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8dd8107df..4a6d8232f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -72,7 +72,21 @@ option(ENABLE_LIBSVN "Set to ON to build FlightGear/terrasync with libsvnclient option(ENABLE_RTI "Set to ON to build SimGear with RTI support" OFF) option(WITH_FGPANEL "Set to ON to build the fgpanel application" ON) -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(LOGGING) # nothing -- 2.39.5