-option(SIMGEAR_SHARED "Set to ON to build SimGear as a shared library/framework" OFF)
-option(SIMGEAR_HEADLESS "Set to ON to build SimGear with GUI/graphics support" OFF)
-option(JPEG_FACTORY "Enable JPEG-factory support" OFF)
-option(ENABLE_LIBSVN "Set to ON to build SimGear with libsvnclient support" OFF)
-
-set(MSVC_3RDPARTY_ROOT NOT_FOUND CACHE PATH "Location where the third-party dependencies are extracted")
+# Change the default build type to something fast
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE Release CACHE STRING
+ "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel."
+ FORCE)
+endif(NOT CMAKE_BUILD_TYPE)
+
+# Determine name of library installation directory, i.e. "lib" vs "lib64", which
+# differs between all Debian-based vs all other Linux distros.
+# See cmake bug #11964, http://cmake.org/gitweb?p=cmake.git;a=commit;h=126c993d
+# GNUInstallDirs requires CMake >= 2.8.5, use own file for older cmake
+if(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
+ include(GNUInstallDirs)
+else(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
+ include(OldGNUInstallDirs)
+endif(${CMAKE_VERSION} VERSION_GREATER 2.8.4)
+message(STATUS "Library installation directory: ${CMAKE_INSTALL_LIBDIR}")
+
+option(SIMGEAR_SHARED "Set to ON to build SimGear as a shared library/framework" OFF)
+option(SIMGEAR_HEADLESS "Set to ON to build SimGear without GUI/graphics support" OFF)
+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)
+option(ENABLE_TESTS "Set to OFF to disable building SimGear's test applications" ON)
+
+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)