Created
June 21, 2015 18:07
-
-
Save januswel/15e708d7c2e95a543963 to your computer and use it in GitHub Desktop.
CMake で pkg-config を使う ref: http://qiita.com/janus_wel/items/e70695670c22a0331451
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# load the module to use pkg-config | |
find_package(PkgConfig) | |
# search library with pkg-config and name its results "LIBSAMPLE" | |
pkg_check_modules(LIBSAMPLE REQUIRED libsample) | |
# use the variable <RESULTNAME>_INCLUDE_DIRS to get include paths | |
include_directories(${LIBSAMPLE_INCLUDE_DIRS}) | |
add_executable(sample | |
main.cpp | |
) | |
# use the variable <RESULTNAME>_LIBRARIES to get library paths | |
target_link_libraries(sample | |
${LIBSAMPLE_LIBRARIES} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment