Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add pkg-config find libs #1063

Merged
merged 1 commit into from
Mar 17, 2022
Merged

Conversation

minhanghuang
Copy link

add pkg_check_modules() find lib

example

...
find_package(PkgConfig REQUIRED) # Ubuntu: sudo apt install pkg-config; macOS: brew install pkg-config
pkg_check_modules(Civetweb REQUIRED civetweb)
pkg_check_modules(Civetweb-cpp REQUIRED civetweb-cpp)
include_directories(
  ${Civetweb_INCLUDE_DIRS} # new, /usr/local/include
  ${Civetweb-cpp_INCLUDE_DIRS} # new, /usr/local/include 
)

link_directories(
  ${Civetweb_LIBRARY_DIRS} # new , /usr/local/lib 
  ${Civetweb-cpp_LIBRARY_DIRS} # new, /usr/local/lib 
)

target_link_libraries(${TARGET_NAME}
  ${Civetweb_LIBRARIES} # new, civetweb 
  ${Civetweb-cpp_LIBRARIES} # new, civetweb-cpp
)
...

@bel2125 bel2125 merged commit 95d8b7c into civetweb:master Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants