diff options
author | Jan200101 <sentrycraft123@gmail.com> | 2020-10-11 18:17:01 +0200 |
---|---|---|
committer | Jan200101 <sentrycraft123@gmail.com> | 2020-10-11 18:17:01 +0200 |
commit | 7d4e2f33a619b1f46a8f2ba00afa22edca6579e8 (patch) | |
tree | c4af21c3d2c727929d9489b3c931cc4b64898bf2 /cmake/FindLibcurl.cmake | |
parent | 26b0417ced82ad849e08db8e8aed0d5529c2b433 (diff) | |
download | polecat-7d4e2f33a619b1f46a8f2ba00afa22edca6579e8.tar.gz polecat-7d4e2f33a619b1f46a8f2ba00afa22edca6579e8.zip |
replace meson with cmake
meson is nice but its completly foreign to me and leaves targets to compile to (e.g Makefile)
might revisit in the future but now right now
Diffstat (limited to 'cmake/FindLibcurl.cmake')
-rw-r--r-- | cmake/FindLibcurl.cmake | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/cmake/FindLibcurl.cmake b/cmake/FindLibcurl.cmake new file mode 100644 index 0000000..9be1b9d --- /dev/null +++ b/cmake/FindLibcurl.cmake @@ -0,0 +1,41 @@ +# +# LIBCURL_INCLUDE_DIRS +# LIBCURL_LIBRARIES + +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_INC + NAMES curl/curl.h + HINTS + ENV curlPath${_lib_suffix} + ENV curlPath + ${_CURL_INCLUDE_DIRS} + PATHS + /usr/include /usr/local/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) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libcurl DEFAULT_MSG CURL_LIB CURL_INC) +mark_as_advanced(CURL_INC CURL_LIB) + +if(LIBCURL_FOUND) + set(LIBCURL_INCLUDE_DIRS ${CURL_INC}) + set(LIBCURL_LIBRARIES ${CURL_LIB}) +endif()
\ No newline at end of file |