]> git.mxchange.org Git - flightgear.git/blobdiff - CMakeLists.txt
Issue #809, restructure position init code.
[flightgear.git] / CMakeLists.txt
index c99783b7555404f26dbe54ea0d4f690e65b0b26b..20f367733f6a55f3b3212e6a21d9c22ed8b6c9ac 100644 (file)
@@ -69,6 +69,39 @@ else()
     set(HUDSON_BUILD_ID "none")
 endif()
 
+#####################################################################################
+# Configure library search paths
+#####################################################################################
+
+if(APPLE)
+    # Custom library directories for Mac, which should have precedence over any other
+    list(APPEND ADDITIONAL_LIBRARY_PATHS
+         ~/Library/Frameworks
+         /Library/Frameworks)
+endif(APPLE)
+
+if(NOT "${CMAKE_LIBRARY_ARCHITECTURE}" STREQUAL "")
+    # Workaround for Ubuntu/Debian which introduced the "multiarch" library
+    # directory structure, which is unsupported by CMake < 2.8.10, so we need to
+    # add paths manually
+    # see http://www.cmake.org/Bug/view.php?id=12049 and
+    # http://www.cmake.org/Bug/view.php?id=12037
+    list(APPEND ADDITIONAL_LIBRARY_PATHS
+         /usr/local/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+         /usr/lib/${CMAKE_LIBRARY_ARCHITECTURE}
+         /lib/${CMAKE_LIBRARY_ARCHITECTURE})
+    message(STATUS "additional library directories: ${ADDITIONAL_LIBRARY_PATHS}")
+endif()
+
+if(NOT MSVC)
+    # TBD: are these really necessary? Aren't they considered by cmake automatically?
+    list(APPEND ADDITIONAL_LIBRARY_PATHS
+         /opt/local
+         /usr/local
+         /usr)
+endif()
+#####################################################################################
+
 IF(APPLE)
     set(EVENT_INPUT_DEFAULT 1)
 
@@ -105,7 +138,7 @@ option(ENABLE_JSBSIM     "Set to ON to build FlightGear with JSBSim FDM (default
 option(EVENT_INPUT       "Set to ON to build FlightGear with event-based Input support" ${EVENT_INPUT_DEFAULT})
 option(ENABLE_LIBSVN     "Set to ON to build FlightGear/terrasync with libsvnclient support (default)" ON)
 option(ENABLE_RTI        "Set to ON to build FlightGear with RTI support" OFF)
-option(ENABLE_PROFILE    "Set to ON to build FlightGear with gperftools profiling support" ON)
+option(ENABLE_PROFILE    "Set to ON to build FlightGear with gperftools profiling support" OFF)
 option(JPEG_FACTORY      "Set to ON to build FlightGear with JPEG-factory support" OFF)
 option(SYSTEM_SQLITE     "Set to ON to build FlightGear with the system's SQLite3 library" OFF)
 
@@ -225,10 +258,9 @@ check_include_file(sys/time.h HAVE_SYS_TIME_H)
 check_include_file(windows.h  HAVE_WINDOWS_H)
 
 if(ENABLE_PROFILE)
-    find_package(GooglePerfTools)
-    if(GOOGLE_PERFTOOLS_FOUND)
-        set(FG_HAVE_GPERFTOOLS 1)
-    endif()
+    find_package(GooglePerfTools REQUIRED)
+    set(FG_HAVE_GPERFTOOLS 1)
+    message(STATUS "Built-in profiler using gperftools available")
 endif()
 
 if(ENABLE_RTI)