Skip to content

Commit fe1562b

Browse files
author
telwertowski
committed
Search CMake default standard locations rather than explicitly encoding standard locations into files. On a Mac, the standard locations may also include framework paths and the frameworks need to be searched either first or last depending upon other CMake settings.
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8404 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent e3e628d commit fe1562b

File tree

4 files changed

+40
-47
lines changed

4 files changed

+40
-47
lines changed

cmake/FindExpat.cmake

+9-12
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,26 @@
77
# EXPAT_INCLUDE_DIR
88
# EXPAT_LIBRARY
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
16-
FIND_PATH(EXPAT_INCLUDE_DIR expat.h
10+
# FIND_PATH and FIND_LIBRARY normally search standard locations
11+
# before the specified paths. To search non-standard paths first,
12+
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
13+
# and then again with no specified paths to search the default
14+
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
15+
# searching for the same item do nothing.
16+
FIND_PATH(EXPAT_INCLUDE_DIR expat.h
1717
"$ENV{LIB_DIR}/include/"
1818
"$ENV{LIB_DIR}/include/expat"
19-
/Users/tim/dev/universal_libs/include
20-
/usr/local/include
21-
/usr/include
2219
c:/msys/local/include
2320
NO_DEFAULT_PATH
2421
)
22+
FIND_PATH(EXPAT_INCLUDE_DIR expat.h)
2523
#libexpat needed for msvc version
2624
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat PATHS
2725
"$ENV{LIB_DIR}/lib"
28-
/usr/local/lib
29-
/usr/lib
3026
c:/msys/local/lib
3127
NO_DEFAULT_PATH
3228
)
29+
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
3330

3431
IF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
3532
SET(EXPAT_FOUND TRUE)

cmake/FindGEOS.cmake

+9-11
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,27 @@
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
16-
FIND_PATH(GEOS_INCLUDE_DIR geos.h
10+
# FIND_PATH and FIND_LIBRARY normally search standard locations
11+
# before the specified paths. To search non-standard paths first,
12+
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
13+
# and then again with no specified paths to search the default
14+
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
15+
# searching for the same item do nothing.
16+
FIND_PATH(GEOS_INCLUDE_DIR geos.h
1717
"$ENV{LIB_DIR}/include"
18-
/usr/local/include
19-
/usr/include
2018
#mingw
2119
c:/msys/local/include
2220
NO_DEFAULT_PATH
2321
)
22+
FIND_PATH(GEOS_INCLUDE_DIR geos.h)
2423

2524
FIND_LIBRARY(GEOS_LIBRARY NAMES geos PATHS
2625
"$ENV{LIB_DIR}/lib"
27-
/usr/local/lib
28-
/usr/lib
2926
#mingw
3027
c:/msys/local/lib
3128
NO_DEFAULT_PATH
3229
)
30+
FIND_LIBRARY(GEOS_LIBRARY NAMES geos)
3331

3432
IF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)
3533
SET(GEOS_FOUND TRUE)

cmake/FindProj.cmake

+11-12
Original file line numberDiff line numberDiff line change
@@ -7,29 +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
16-
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
10+
# FIND_PATH and FIND_LIBRARY normally search standard locations
11+
# before the specified paths. To search non-standard paths first,
12+
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
13+
# and then again with no specified paths to search the default
14+
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
15+
# searching for the same item do nothing.
16+
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
1717
"$ENV{LIB_DIR}/include/proj"
1818
"$ENV{LIB_DIR}/include"
19-
/usr/local/include
20-
/usr/include
2119
#mingw
2220
c:/msys/local/include
2321
NO_DEFAULT_PATH
2422
)
23+
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h)
2524

26-
FIND_LIBRARY(PROJ_LIBRARY NAMES proj PATHS
25+
FIND_LIBRARY(PROJ_LIBRARY NAMES proj PATHS
2726
"$ENV{LIB_DIR}/lib"
28-
/usr/local/lib
29-
/usr/lib
27+
#mingw
3028
c:/msys/local/lib
3129
NO_DEFAULT_PATH
3230
)
31+
FIND_LIBRARY(PROJ_LIBRARY NAMES proj)
3332

3433
IF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
3534
SET(PROJ_FOUND TRUE)

cmake/FindSqlite3.cmake

+11-12
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,28 @@
77
# SQLITE3_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
16-
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
10+
# FIND_PATH and FIND_LIBRARY normally search standard locations
11+
# before the specified paths. To search non-standard paths first,
12+
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
13+
# and then again with no specified paths to search the default
14+
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
15+
# searching for the same item do nothing.
16+
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
1717
"$ENV{LIB_DIR}/include"
1818
"$ENV{LIB_DIR}/include/sqlite"
19-
/usr/local/include
20-
/usr/include
2119
#mingw
2220
c:/msys/local/include
2321
NO_DEFAULT_PATH
2422
)
23+
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h)
2524

26-
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 PATHS
25+
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 PATHS
2726
"$ENV{LIB_DIR}/lib"
28-
/usr/local/lib
29-
/usr/lib
27+
#mingw
3028
c:/msys/local/lib
3129
NO_DEFAULT_PATH
3230
)
31+
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)
3332

3433
IF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
3534
SET(SQLITE3_FOUND TRUE)

0 commit comments

Comments
 (0)