Skip to content

Commit

Permalink
Add the USE_SYSTEM_CURL flag (#377)
Browse files Browse the repository at this point in the history
* Update CMakeLists.txt

* Update CMakeLists.txt
  • Loading branch information
umireon authored Jul 10, 2023
1 parent 9695f81 commit aeab837
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,18 @@ else()
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE OpenCV)
endif()

include(cmake/BuildMyCurl.cmake)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libcurl)
set(USE_SYSTEM_CURL
OFF
CACHE STRING "Use system cURL")

if(USE_SYSTEM_CURL)
find_package(CURL REQUIRED)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE "${CURL_LIBRARIES}")
target_include_directories(${CMAKE_PROJECT_NAME} SYSTEM PUBLIC "${CURL_INCLUDE_DIRS}")
else()
include(cmake/BuildMyCurl.cmake)
target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE libcurl)
endif()

target_sources(
${CMAKE_PROJECT_NAME}
Expand Down

0 comments on commit aeab837

Please sign in to comment.