CURLConfig.cmake 1.2 KB

1234567891011121314151617181920212223242526272829303132333435
  1. # wget https://curl.se/windows/dl-7.85.0_9/curl-7.85.0_9-win64-mingw.zip
  2. # you might need to write correct version here...
  3. set (CURL_VERSION_STRING "7.85.0")
  4. set (_CURL_VER "${CURL_VERSION_STRING}_9")
  5. if ("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.5)
  6. message (FATAL_ERROR "CMake >= 2.6.0 required")
  7. endif ()
  8. cmake_policy (PUSH)
  9. cmake_policy (VERSION 2.6...3.18)
  10. # Compute the installation prefix relative to this file.
  11. get_filename_component (_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH)
  12. if (CMAKE_EXE_LINKER_FLAGS MATCHES "x64")
  13. set (_IMPORT_PREFIX "${_IMPORT_PREFIX}/curl-${_CURL_VER}-win64-mingw")
  14. else()
  15. message (FATAL_ERROR "Only x64 arch supported for CURL")
  16. endif ()
  17. # Create imported target ZSTD::ZSTD
  18. add_library ( CURL::libcurl SHARED IMPORTED)
  19. set_target_properties ( CURL::libcurl PROPERTIES
  20. INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include"
  21. IMPORTED_IMPLIB "${_IMPORT_PREFIX}/lib/libcurl.dll.a"
  22. IMPORTED_LOCATION "${_IMPORT_PREFIX}/bin/libcurl-x64.dll"
  23. )
  24. if (CMAKE_VERSION VERSION_LESS 3.1.0)
  25. message (FATAL_ERROR "This file relies on consumers using CMake 3.1.0 or greater.")
  26. endif ()
  27. # Cleanup temporary variables.
  28. set (_IMPORT_PREFIX)
  29. cmake_policy (POP)