]> git.mxchange.org Git - simgear.git/commitdiff
Auto detect 3rd Party root for Windows
authorFrederic Bouvier <fredfgfs01@free.fr>
Mon, 12 Sep 2011 08:53:18 +0000 (10:53 +0200)
committerFrederic Bouvier <fredfgfs01@free.fr>
Mon, 12 Sep 2011 08:53:18 +0000 (10:53 +0200)
CMakeLists.txt

index 68d8e0597de8267a05096c500ae1605495050cd3..63384bf6b3db61508b40e4dbb4976c421b093182 100644 (file)
@@ -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)