Skip to content

Commit

Permalink
Use official cmake target for libcurl (#123)
Browse files Browse the repository at this point in the history
Signed-off-by: Uilian Ries <[email protected]>
  • Loading branch information
uilianries authored Apr 20, 2024
1 parent 07b8f0e commit 31acd77
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,6 @@ option(LINK_CURL "Link curl library for vault" OFF)
option(BUILD_SHARED_LIBS "Build vault as a shared library" ON)
option(INSTALL "Run install targets" ON)

find_package(CURL)
if(CURL_FOUND)
include_directories(${CURL_INCLUDE_DIR})
else(CURL_FOUND)
message(FATAL_ERROR "CURL not found")
endif(CURL_FOUND)

include(GNUInstallDirs)
include_directories("${PROJECT_SOURCE_DIR}/lib")

Expand Down Expand Up @@ -130,7 +123,8 @@ set_target_properties(
target_include_directories(vault PRIVATE src)

if(LINK_CURL)
target_link_libraries(vault curl)
find_package(CURL CONFIG REQUIRED)
target_link_libraries(vault PUBLIC CURL::libcurl)
endif(LINK_CURL)

if(ENABLE_COVERAGE)
Expand Down

0 comments on commit 31acd77

Please sign in to comment.