Skip to content

Commit 193448a

Browse files
author
timlinux
committedMar 8, 2008
Added some logic to allow libs and headers in non default locations to be used with priority over those in default locations (/usr and /usr/local)
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8195 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 36cfbef commit 193448a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎cmake/FindExpat.cmake

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,28 @@
77
# EXPAT_INCLUDE_DIR
88
# EXPAT_LIBRARY
99

10-
10+
# Normally there is no need to specify /usr/... paths because
11+
# cmake will look there automatically. However the NO_DEFAULT_PATH
12+
# prevents this behaviour allowing you to use no standard file
13+
# locations in preference over standard ones. Note in this case
14+
# you then need to explicitly add /usr and /usr/local prefixes
15+
# to the search list. This applies both to FIND_PATH and FIND_LIBRARY
1116
FIND_PATH(EXPAT_INCLUDE_DIR expat.h
17+
"$ENV{LIB_DIR}/include/"
18+
"$ENV{LIB_DIR}/include/expat"
19+
/Users/tim/dev/universal_libs/include
1220
/usr/local/include
1321
/usr/include
14-
"$ENV{LIB_DIR}/include/expat"
1522
c:/msys/local/include
23+
NO_DEFAULT_PATH
1624
)
1725
#libexpat needed for msvc version
1826
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat PATHS
27+
"$ENV{LIB_DIR}/lib"
1928
/usr/local/lib
2029
/usr/lib
21-
"$ENV{LIB_DIR}/lib"
2230
c:/msys/local/lib
31+
NO_DEFAULT_PATH
2332
)
2433

2534
IF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)

0 commit comments

Comments
 (0)
Please sign in to comment.