Skip to content

Commit

Permalink
Search CMake default standard locations rather than explicitly encodi…
Browse files Browse the repository at this point in the history
…ng 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@8404 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
telwertowski committed May 7, 2008
1 parent 6594e7e commit cd2c6b0
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 47 deletions.
21 changes: 9 additions & 12 deletions cmake/FindExpat.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,26 @@
# EXPAT_INCLUDE_DIR
# EXPAT_LIBRARY

# Normally there is no need to specify /usr/... paths because
# cmake will look there automatically. However the NO_DEFAULT_PATH
# prevents this behaviour allowing you to use no standard file
# locations in preference over standard ones. Note in this case
# you then need to explicitly add /usr and /usr/local prefixes
# to the search list. This applies both to FIND_PATH and FIND_LIBRARY
FIND_PATH(EXPAT_INCLUDE_DIR expat.h
# FIND_PATH and FIND_LIBRARY normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
FIND_PATH(EXPAT_INCLUDE_DIR expat.h
"$ENV{LIB_DIR}/include/"
"$ENV{LIB_DIR}/include/expat"
/Users/tim/dev/universal_libs/include
/usr/local/include
/usr/include
c:/msys/local/include
NO_DEFAULT_PATH
)
FIND_PATH(EXPAT_INCLUDE_DIR expat.h)
#libexpat needed for msvc version
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat PATHS
"$ENV{LIB_DIR}/lib"
/usr/local/lib
/usr/lib
c:/msys/local/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)

IF (EXPAT_INCLUDE_DIR AND EXPAT_LIBRARY)
SET(EXPAT_FOUND TRUE)
Expand Down
20 changes: 9 additions & 11 deletions cmake/FindGEOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,27 @@
# GEOS_LIBRARY


# Normally there is no need to specify /usr/... paths because
# cmake will look there automatically. However the NO_DEFAULT_PATH
# prevents this behaviour allowing you to use no standard file
# locations in preference over standard ones. Note in this case
# you then need to explicitly add /usr and /usr/local prefixes
# to the search list. This applies both to FIND_PATH and FIND_LIBRARY
FIND_PATH(GEOS_INCLUDE_DIR geos.h
# FIND_PATH and FIND_LIBRARY normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
FIND_PATH(GEOS_INCLUDE_DIR geos.h
"$ENV{LIB_DIR}/include"
/usr/local/include
/usr/include
#mingw
c:/msys/local/include
NO_DEFAULT_PATH
)
FIND_PATH(GEOS_INCLUDE_DIR geos.h)

FIND_LIBRARY(GEOS_LIBRARY NAMES geos PATHS
"$ENV{LIB_DIR}/lib"
/usr/local/lib
/usr/lib
#mingw
c:/msys/local/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY(GEOS_LIBRARY NAMES geos)

IF (GEOS_INCLUDE_DIR AND GEOS_LIBRARY)
SET(GEOS_FOUND TRUE)
Expand Down
23 changes: 11 additions & 12 deletions cmake/FindProj.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,28 @@
# PROJ_LIBRARY


# Normally there is no need to specify /usr/... paths because
# cmake will look there automatically. However the NO_DEFAULT_PATH
# prevents this behaviour allowing you to use no standard file
# locations in preference over standard ones. Note in this case
# you then need to explicitly add /usr and /usr/local prefixes
# to the search list. This applies both to FIND_PATH and FIND_LIBRARY
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
# FIND_PATH and FIND_LIBRARY normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
"$ENV{LIB_DIR}/include/proj"
"$ENV{LIB_DIR}/include"
/usr/local/include
/usr/include
#mingw
c:/msys/local/include
NO_DEFAULT_PATH
)
FIND_PATH(PROJ_INCLUDE_DIR proj_api.h)

FIND_LIBRARY(PROJ_LIBRARY NAMES proj PATHS
FIND_LIBRARY(PROJ_LIBRARY NAMES proj PATHS
"$ENV{LIB_DIR}/lib"
/usr/local/lib
/usr/lib
#mingw
c:/msys/local/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY(PROJ_LIBRARY NAMES proj)

IF (PROJ_INCLUDE_DIR AND PROJ_LIBRARY)
SET(PROJ_FOUND TRUE)
Expand Down
23 changes: 11 additions & 12 deletions cmake/FindSqlite3.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,28 @@
# SQLITE3_LIBRARY


# Normally there is no need to specify /usr/... paths because
# cmake will look there automatically. However the NO_DEFAULT_PATH
# prevents this behaviour allowing you to use no standard file
# locations in preference over standard ones. Note in this case
# you then need to explicitly add /usr and /usr/local prefixes
# to the search list. This applies both to FIND_PATH and FIND_LIBRARY
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
# FIND_PATH and FIND_LIBRARY normally search standard locations
# before the specified paths. To search non-standard paths first,
# FIND_* is invoked first with specified paths and NO_DEFAULT_PATH
# and then again with no specified paths to search the default
# locations. When an earlier FIND_* succeeds, subsequent FIND_*s
# searching for the same item do nothing.
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h
"$ENV{LIB_DIR}/include"
"$ENV{LIB_DIR}/include/sqlite"
/usr/local/include
/usr/include
#mingw
c:/msys/local/include
NO_DEFAULT_PATH
)
FIND_PATH(SQLITE3_INCLUDE_DIR sqlite3.h)

FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 PATHS
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3 PATHS
"$ENV{LIB_DIR}/lib"
/usr/local/lib
/usr/lib
#mingw
c:/msys/local/lib
NO_DEFAULT_PATH
)
FIND_LIBRARY(SQLITE3_LIBRARY NAMES sqlite3)

IF (SQLITE3_INCLUDE_DIR AND SQLITE3_LIBRARY)
SET(SQLITE3_FOUND TRUE)
Expand Down

0 comments on commit cd2c6b0

Please sign in to comment.