summaryrefslogtreecommitdiff
path: root/Modules/FindEXPAT.cmake
diff options
context:
space:
mode:
authorChristoph Junghans <junghans@votca.org>2016-08-30 15:37:10 -0600
committerChristoph Junghans <junghans@votca.org>2016-08-31 11:52:11 -0600
commitfc695a776b5a4d61c3bfd3253ff9d40c3f30f6b9 (patch)
tree54834bcfabf1e68d67ba4afd63031d008cf65218 /Modules/FindEXPAT.cmake
parente3a4c2e02ceacd302e8bc6a7dc1bc02b29ab2cfc (diff)
downloadcmake-fc695a776b5a4d61c3bfd3253ff9d40c3f30f6b9.tar.gz
FindEXPAT: use hints from PkgConfig
Diffstat (limited to 'Modules/FindEXPAT.cmake')
-rw-r--r--Modules/FindEXPAT.cmake8
1 files changed, 6 insertions, 2 deletions
diff --git a/Modules/FindEXPAT.cmake b/Modules/FindEXPAT.cmake
index 70fc35b929..ea55a735e5 100644
--- a/Modules/FindEXPAT.cmake
+++ b/Modules/FindEXPAT.cmake
@@ -25,11 +25,15 @@
# (To distribute this file outside of CMake, substitute the full
# License text for the above reference.)
+find_package(PkgConfig QUIET)
+
+pkg_check_modules(PC_EXPAT QUIET expat)
+
# 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.
-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")
file(STRINGS "${EXPAT_INCLUDE_DIR}/expat.h" expat_version_str