]> git.mxchange.org Git - simgear.git/blobdiff - CMakeLists.txt
use the proper namespace
[simgear.git] / CMakeLists.txt
index 74056eeae2cf7e53205a9e045f3fcd1ad3a8cb52..f7220c5734a71523795c26e64c95c0d61df51a5e 100644 (file)
@@ -1,4 +1,4 @@
-cmake_minimum_required (VERSION 2.6.4)
+cmake_minimum_required (VERSION 2.8.11)
 
 if(COMMAND cmake_policy)
    if(POLICY CMP0054)
@@ -17,7 +17,6 @@ include (CheckCXXCompilerFlag)
 
 # using 10.7 because boost requires libc++ and 10.6 doesn't include it
 set(CMAKE_OSX_DEPLOYMENT_TARGET 10.7)
-set(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
 
 # only relevant for building shared libs but let's set it regardless
 set(CMAKE_OSX_RPATH 1)
@@ -80,12 +79,7 @@ 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)
+include(GNUInstallDirs)
 message(STATUS "Library installation directory: ${CMAKE_INSTALL_LIBDIR}")
 
 #####################################################################################
@@ -122,6 +116,7 @@ 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)
 option(ENABLE_SOUND     "Set to OFF to disable building SimGear's sound support" ON)
 option(ENABLE_PKGUTIL   "Set to ON to build the sg_pkgutil application (default)" ON)
+option(ENABLE_CURL      "Set to ON to use libCurl as the HTTP client backend" OFF)
 
 if (MSVC)
   GET_FILENAME_COMPONENT(PARENT_DIR ${PROJECT_BINARY_DIR} PATH)
@@ -179,6 +174,11 @@ endif (MSVC AND MSVC_3RDPARTY_ROOT)
 
 if(APPLE)
   find_library(COCOA_LIBRARY Cocoa)
+
+# this should be handled by setting CMAKE_OSX_DEPLOYMENT_TARGET
+# but it's not working reliably, so forcing it for now
+  SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mmacosx-version-min=10.7")
+  SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mmacosx-version-min=10.7")
 endif()
 
 if(${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR
@@ -209,6 +209,11 @@ endif(SIMGEAR_HEADLESS)
 
 find_package(ZLIB REQUIRED)
 
+if (ENABLE_CURL)
+  find_package(CURL REQUIRED)
+  message(STATUS "Curl HTTP client: ENABLED")
+endif()
+
 if (SYSTEM_EXPAT)
     message(STATUS "Requested to use system Expat library, forcing SIMGEAR_SHARED to true")
     set(SIMGEAR_SHARED ON)
@@ -374,6 +379,7 @@ include_directories(${OPENSCENEGRAPH_INCLUDE_DIRS}
     ${Boost_INCLUDE_DIRS}
     ${ZLIB_INCLUDE_DIR}
     ${OPENAL_INCLUDE_DIR}
+    ${CURL_INCLUDE_DIRS}
 )
 
 add_definitions(-DHAVE_CONFIG_H)
@@ -402,7 +408,8 @@ set(TEST_LIBS_INTERNAL_CORE
     ${WINSOCK_LIBRARY}
     ${RT_LIBRARY}
     ${DL_LIBRARY}
-    ${COCOA_LIBRARY})
+    ${COCOA_LIBRARY}
+    ${CURL_LIBRARIES})
 set(TEST_LIBS SimGearCore ${TEST_LIBS_INTERNAL_CORE})
 
 if(NOT SIMGEAR_HEADLESS)
@@ -425,5 +432,3 @@ CONFIGURE_FILE(
   IMMEDIATE @ONLY)
 ADD_CUSTOM_TARGET(uninstall
   "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake")
-
-