CMakeLists.txt 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. cmake_minimum_required(VERSION 3.15)
  2. target_include_directories(cpr PUBLIC
  3. $<INSTALL_INTERFACE:include>
  4. $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
  5. $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/cpr_generated_includes/>)
  6. target_sources(cpr PRIVATE
  7. # Header files (useful in IDEs)
  8. cpr/accept_encoding.h
  9. cpr/api.h
  10. cpr/async.h
  11. cpr/auth.h
  12. cpr/bearer.h
  13. cpr/body.h
  14. cpr/buffer.h
  15. cpr/cert_info.h
  16. cpr/cookies.h
  17. cpr/cpr.h
  18. cpr/cprtypes.h
  19. cpr/curlholder.h
  20. cpr/curlholder.h
  21. cpr/error.h
  22. cpr/file.h
  23. cpr/limit_rate.h
  24. cpr/local_port.h
  25. cpr/local_port_range.h
  26. cpr/multipart.h
  27. cpr/parameters.h
  28. cpr/payload.h
  29. cpr/proxies.h
  30. cpr/proxyauth.h
  31. cpr/response.h
  32. cpr/session.h
  33. cpr/singleton.h
  34. cpr/ssl_ctx.h
  35. cpr/ssl_options.h
  36. cpr/threadpool.h
  37. cpr/timeout.h
  38. cpr/unix_socket.h
  39. cpr/util.h
  40. cpr/verbose.h
  41. cpr/interface.h
  42. cpr/redirect.h
  43. cpr/http_version.h
  44. cpr/interceptor.h
  45. cpr/filesystem.h
  46. cpr/curlmultiholder.h
  47. cpr/multiperform.h
  48. cpr/resolve.h
  49. ${PROJECT_BINARY_DIR}/cpr_generated_includes/cpr/cprver.h
  50. )
  51. # Filesystem
  52. if(CPR_USE_BOOST_FILESYSTEM)
  53. find_package(Boost 1.44 REQUIRED COMPONENTS filesystem)
  54. if(Boost_FOUND)
  55. target_link_libraries(cpr PUBLIC Boost::filesystem)
  56. endif()
  57. endif()
  58. if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 9.1) OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND NOT CPR_USE_BOOST_FILESYSTEM)
  59. target_link_libraries(cpr PUBLIC stdc++fs)
  60. endif()
  61. install(DIRECTORY cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
  62. install(DIRECTORY ${PROJECT_BINARY_DIR}/cpr_generated_includes/cpr DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})