Skip to content

Commit 9b5f9c3

Browse files
author
timlinux
committed
Added the possibility to use these libs from non default locations by specifying them in LIB_DIR. Before this change, the presence of the lib in /usr or /usr/local would override command line specified paths
git-svn-id: http://svn.osgeo.org/qgis/trunk@8203 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent 7e2bfcf commit 9b5f9c3

File tree

2 files changed

+21
-7
lines changed

2 files changed

+21
-7
lines changed

cmake/FindGEOS.cmake

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,22 +7,28 @@
77
# GEOS_LIBRARY
88

99

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
1016
FIND_PATH(GEOS_INCLUDE_DIR geos.h
17+
"$ENV{LIB_DIR}/include"
1118
/usr/local/include
1219
/usr/include
13-
#MSVC
14-
"$ENV{LIB_DIR}/include"
1520
#mingw
1621
c:/msys/local/include
22+
NO_DEFAULT_PATH
1723
)
1824

1925
FIND_LIBRARY(GEOS_LIBRARY NAMES geos PATHS
26+
"$ENV{LIB_DIR}/lib"
2027
/usr/local/lib
2128
/usr/lib
22-
#MSVC
23-
"$ENV{LIB_DIR}/lib"
2429
#mingw
2530
c:/msys/local/lib
31+
NO_DEFAULT_PATH
2632
)
2733

2834
IF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)

cmake/FindProj.cmake

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,28 @@
77
# PROJ_LIBRARY
88

99

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
1016
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
17+
"$ENV{LIB_DIR}/include/proj"
18+
"$ENV{LIB_DIR}/include"
1119
/usr/local/include
1220
/usr/include
13-
#msvc
14-
"$ENV{LIB_DIR}/include/proj"
1521
#mingw
1622
c:/msys/local/include
23+
NO_DEFAULT_PATH
1724
)
1825

1926
FIND_LIBRARY(PROJ_LIBRARY NAMES proj PATHS
27+
"$ENV{LIB_DIR}/lib"
2028
/usr/local/lib
2129
/usr/lib
22-
"$ENV{LIB_DIR}/lib"
2330
c:/msys/local/lib
31+
NO_DEFAULT_PATH
2432
)
2533

2634
IF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)

0 commit comments

Comments
 (0)