mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-13 07:34:45 +00:00
HTTPObject with CURL
This commit is contained in:
parent
9b783784b1
commit
20eb0a911a
296 changed files with 131348 additions and 343 deletions
57
Tools/CMake/modules/module_curl.cmake
Normal file
57
Tools/CMake/modules/module_curl.cmake
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
# -----------------------------------------------------------------------------
|
||||
# Copyright (c) 2015 GarageGames, LLC
|
||||
#
|
||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
# of this software and associated documentation files (the "Software"), to
|
||||
# deal in the Software without restriction, including without limitation the
|
||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
# sell copies of the Software, and to permit persons to whom the Software is
|
||||
# furnished to do so, subject to the following conditions:
|
||||
#
|
||||
# The above copyright notice and this permission notice shall be included in
|
||||
# all copies or substantial portions of the Software.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
# -----------------------------------------------------------------------------
|
||||
|
||||
option(TORQUE_NET_CURL "Use CURL and enable HTTPObject" ON)
|
||||
|
||||
if( NOT TORQUE_NET_CURL )
|
||||
return()
|
||||
endif()
|
||||
|
||||
addDef( "TORQUE_NET_CURL" )
|
||||
|
||||
# curl
|
||||
set(BUILD_CURL_EXE OFF CACHE INTERNAL "" FORCE)
|
||||
set(CURL_CA_PATH "none" CACHE INTERNAL "" FORCE)
|
||||
set(BUILD_TESTING OFF CACHE INTERNAL "" FORCE)
|
||||
set(CMAKE_USE_LIBSSH2 OFF CACHE INTERNAL "" FORCE)
|
||||
set(CURL_STATICLIB ON CACHE INTERNAL "" FORCE)
|
||||
set(ENABLE_MANUAL OFF CACHE INTERNAL "" FORCE)
|
||||
set(ENABLE_UNIX_SOCKETS OFF CACHE INTERNAL "" FORCE)
|
||||
set(HTTP_ONLY ON CACHE INTERNAL "" FORCE)
|
||||
set(PICKY_COMPILER ON CACHE INTERNAL "" FORCE)
|
||||
if(WIN32)
|
||||
set(CMAKE_USE_WINSSL ON CACHE INTERNAL "" FORCE)
|
||||
set(CURL_STATIC_CRT ${USE_STATIC_CRT} CACHE INTERNAL "" FORCE)
|
||||
set(ENABLE_INET_PTON ON CACHE INTERNAL "" FORCE)
|
||||
elseif(APPLE)
|
||||
set(CMAKE_USE_DARWINSSL ON CACHE INTERNAL "" FORCE)
|
||||
endif()
|
||||
add_subdirectory( ${libDir}/curl ${CMAKE_CURRENT_BINARY_DIR}/curl)
|
||||
link_directories( ${libDir}/curl ${CMAKE_CURRENT_BINARY_DIR}/curl)
|
||||
|
||||
set(CURL_LIBRARIES libcurl)
|
||||
set(CURL_INCLUDE_DIRS "${libDir}/curl/include")
|
||||
set_property(TARGET libcurl APPEND PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CURL_INCLUDE_DIRS})
|
||||
set_property(TARGET libcurl APPEND PROPERTY INTERFACE_COMPILE_DEFINITIONS CURL_STATICLIB)
|
||||
|
||||
addLib(${CURL_LIBRARIES})
|
||||
addInclude(${CURL_INCLUDE_DIRS})
|
||||
Loading…
Add table
Add a link
Reference in a new issue