FindEXPAT: use hints from PkgConfig
This commit is contained in:
parent
e3a4c2e02c
commit
fc695a776b
|
@ -25,11 +25,15 @@
|
||||||
# (To distribute this file outside of CMake, substitute the full
|
# (To distribute this file outside of CMake, substitute the full
|
||||||
# License text for the above reference.)
|
# License text for the above reference.)
|
||||||
|
|
||||||
|
find_package(PkgConfig QUIET)
|
||||||
|
|
||||||
|
pkg_check_modules(PC_EXPAT QUIET expat)
|
||||||
|
|
||||||
# Look for the header file.
|
# Look for the header file.
|
||||||
find_path(EXPAT_INCLUDE_DIR NAMES expat.h)
|
find_path(EXPAT_INCLUDE_DIR NAMES expat.h HINTS ${PC_EXPAT_INCLUDE_DIRS})
|
||||||
|
|
||||||
# Look for the library.
|
# Look for the library.
|
||||||
find_library(EXPAT_LIBRARY NAMES expat libexpat)
|
find_library(EXPAT_LIBRARY NAMES expat libexpat HINTS ${PC_EXPAT_LIBRARY_DIRS})
|
||||||
|
|
||||||
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
|
if (EXPAT_INCLUDE_DIR AND EXISTS "${EXPAT_INCLUDE_DIR}/expat.h")
|
||||||
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
|
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str
|
||||||
|
|
Loading…
Reference in New Issue