X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=CMakeLists.txt;h=f7220c5734a71523795c26e64c95c0d61df51a5e;hb=2bb24f43fbacaa198a2dafbe2ed5acb298231b4e;hp=067f57ad5077a2b999251e8c817375522b60fd62;hpb=5676f96fbfdbe20ebad966a6865c005f9a308921;p=simgear.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 067f57ad..f7220c57 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -116,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) @@ -173,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 @@ -203,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) @@ -368,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) @@ -396,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) @@ -419,5 +432,3 @@ CONFIGURE_FILE( IMMEDIATE @ONLY) ADD_CUSTOM_TARGET(uninstall "${CMAKE_COMMAND}" -P "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake") - -