Skip to content

Commit

Permalink
Use pkg-config for httplib when not found
Browse files Browse the repository at this point in the history
  • Loading branch information
Kicer86 committed Dec 9, 2023
1 parent 561c9e9 commit aa429f7
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

find_package(GTest REQUIRED CONFIG)
find_package(httplib REQUIRED)
find_package(httplib QUIET)

if(httplib_FOUND)
set(httplib_LIBRARIES httplib::httplib)
else()
find_package(PkgConfig REQUIRED)

pkg_check_modules(httplib REQUIRED cpp-httplib)
endif()

add_executable(api_tests
connection_tests.cpp
Expand All @@ -12,7 +20,7 @@ target_link_libraries(api_tests
PRIVATE
GTest::gtest
GTest::gmock
httplib::httplib
${httplib_LIBRARIES}

github_api
)
Expand Down

0 comments on commit aa429f7

Please sign in to comment.