cmake: Add libcurl support
This commit is contained in:
parent
a14d003955
commit
e3fe26d73d
@ -98,6 +98,18 @@ file(GLOB LIBFDK_BIN_FILES
|
||||
"${Libfdk_INCLUDE_DIR}/bin/libfdk*-*.dll"
|
||||
"${Libfdk_INCLUDE_DIR}/bin${_bin_suffix}/libfdk*-*.dll")
|
||||
|
||||
file(GLOB CURL_BIN_FILES
|
||||
"${CURL_INCLUDE_DIR}/../build/Win${_bin_suffix}/VC12/DLL Release - DLL Windows SSPI/libcurl.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin${_bin_suffix}/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/../bin/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin${_bin_suffix}/curl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin/libcurl*.dll"
|
||||
"${CURL_INCLUDE_DIR}/bin/curl*.dll"
|
||||
)
|
||||
|
||||
if (CMAKE_CONFIGURATION_TYPES MATCHES "Debug")
|
||||
file(GLOB QT_DEBUG_BIN_FILES
|
||||
"${Qt5Core_DIR}/../../../bin/Qt5Cored.dll"
|
||||
@ -128,6 +140,7 @@ file(GLOB QT_ICU_BIN_FILES
|
||||
set(ALL_BASE_BIN_FILES
|
||||
${FFMPEG_BIN_FILES}
|
||||
${X264_BIN_FILES}
|
||||
${CURL_BIN_FILES}
|
||||
${LIBFDK_BIN_FILES}
|
||||
${FREETYPE_BIN_FILES}
|
||||
${QT_ICU_BIN_FILES})
|
||||
@ -158,6 +171,7 @@ message(STATUS "FFmpeg files: ${FFMPEG_BIN_FILES}")
|
||||
message(STATUS "x264 files: ${X264_BIN_FILES}")
|
||||
message(STATUS "Libfdk files: ${LIBFDK_BIN_FILES}")
|
||||
message(STATUS "Freetype files: ${FREETYPE_BIN_FILES}")
|
||||
message(STATUS "curl files: ${CURL_BIN_FILES}")
|
||||
message(STATUS "QT Debug files: ${QT_DEBUG_BIN_FILES}")
|
||||
message(STATUS "QT Debug Platform files: ${QT_DEBUG_PLAT_BIN_FILES}")
|
||||
message(STATUS "QT Release files: ${QT_BIN_FILES}")
|
||||
|
58
cmake/Modules/FindLibcurl.cmake
Normal file
58
cmake/Modules/FindLibcurl.cmake
Normal file
@ -0,0 +1,58 @@
|
||||
# Once done these will be defined:
|
||||
#
|
||||
# LIBCURL_FOUND
|
||||
# LIBCURL_INCLUDE_DIRS
|
||||
# LIBCURL_LIBRARIES
|
||||
#
|
||||
# For use in OBS:
|
||||
#
|
||||
# CURL_INCLUDE_DIR
|
||||
|
||||
find_package(PkgConfig QUIET)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(_CURL QUIET curl)
|
||||
endif()
|
||||
|
||||
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(_lib_suffix 64)
|
||||
else()
|
||||
set(_lib_suffix 32)
|
||||
endif()
|
||||
|
||||
find_path(CURL_INCLUDE_DIR
|
||||
NAMES curl/curl.h
|
||||
HINTS
|
||||
ENV curlPath${_lib_suffix}
|
||||
ENV curlPath
|
||||
${_CURL_INCLUDE_DIRS}
|
||||
PATHS
|
||||
/usr/include /usr/local/include /opt/local/include /sw/include
|
||||
PATH_SUFFIXES
|
||||
include)
|
||||
|
||||
find_library(CURL_LIB
|
||||
NAMES ${_CURL_LIBRARIES} curl libcurl
|
||||
HINTS
|
||||
ENV curlPath${_lib_suffix}
|
||||
ENV curlPath
|
||||
${_CURL_LIBRARY_DIRS}
|
||||
PATHS
|
||||
/usr/lib /usr/local/lib /opt/local/lib /sw/lib
|
||||
PATH_SUFFIXES
|
||||
lib${_lib_suffix} lib
|
||||
libs${_lib_suffix} libs
|
||||
bin${_lib_suffix} bin
|
||||
../lib${_lib_suffix} ../lib
|
||||
../libs${_lib_suffix} ../libs
|
||||
../bin${_lib_suffix} ../bin
|
||||
"build/Win${_lib_suffix}/VC12/DLL Release - DLL Windows SSPI"
|
||||
"../build/Win${_lib_suffix}/VC12/DLL Release - DLL Windows SSPI")
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(Libcurl DEFAULT_MSG CURL_LIB CURL_INCLUDE_DIR)
|
||||
mark_as_advanced(CURL_INCLUDE_DIR CURL_LIB)
|
||||
|
||||
if(LIBCURL_FOUND)
|
||||
set(LIBCURL_INCLUDE_DIRS ${CURL_INCLUDE_DIR})
|
||||
set(LIBCURL_LIBRARIES ${CURL_LIB})
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user