cmake-pkgconfig-find-deps.patch 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. diff --git a/CMakeLists.txt b/CMakeLists.txt
  2. index c2610db..abee1c8 100644
  3. --- a/CMakeLists.txt
  4. +++ b/CMakeLists.txt
  5. @@ -57,15 +57,16 @@ endif()
  6. # ------------
  7. find_package(OpenSSL REQUIRED)
  8. -find_package(unofficial-curlpp CONFIG REQUIRED)
  9. -find_package(unofficial-inih CONFIG REQUIRED)
  10. +find_package(CURL REQUIRED)
  11. +include(FindPkgConfig)
  12. +pkg_search_module(curlpp REQUIRED IMPORTED_TARGET curlpp)
  13. +pkg_search_module(inih REQUIRED IMPORTED_TARGET inih)
  14. find_package(nlohmann_json CONFIG REQUIRED)
  15. find_package(pugixml CONFIG REQUIRED)
  16. find_package(ZLIB REQUIRED)
  17. list(APPEND MINIO_CPP_LIBS
  18. - unofficial::curlpp::curlpp
  19. - unofficial::inih::inireader
  20. + PkgConfig::curlpp CURL::libcurl PkgConfig::inih
  21. nlohmann_json::nlohmann_json
  22. pugixml
  23. OpenSSL::SSL OpenSSL::Crypto
  24. @@ -115,7 +116,7 @@ set(MINIO_CPP_HEADERS
  25. include/miniocpp/utils.h
  26. )
  27. -add_library(miniocpp STATIC ${MINIO_CPP_SOURCES} ${MINIO_CPP_HEADERS})
  28. +add_library(miniocpp ${MINIO_CPP_SOURCES} ${MINIO_CPP_HEADERS})
  29. target_compile_options(miniocpp PRIVATE ${MINIO_CPP_CFLAGS})
  30. target_compile_features(miniocpp PUBLIC cxx_std_${MINIO_CPP_STD})
  31. target_include_directories(miniocpp PUBLIC
  32. @@ -124,7 +125,6 @@ target_include_directories(miniocpp PUBLIC
  33. )
  34. target_link_libraries(miniocpp PUBLIC ${MINIO_CPP_LIBS})
  35. set_target_properties(miniocpp PROPERTIES VERSION "${MINIO_CPP_VERSION_STRING}")
  36. -set_target_properties(miniocpp PROPERTIES POSITION_INDEPENDENT_CODE ON)
  37. # Add a cmake alias - this is how users should use minio-cpp in their cmake projects.
  38. add_library(miniocpp::miniocpp ALIAS miniocpp)