Don't set a default search path; use CMake's default

If we set a default search path ourself, then this will be used if we
specify a SuiteSparse_ROOT with error! Instead, we should just leave
our SuiteSparse_SEARCH_PATH variable empty and then let CMake fill in
its defaults. If there is a directory specified on the other hand
(indicating that we want exactly that location), only use that and
turn all the default paths completely off.
This commit is contained in:
Roland Kaufmann 2013-09-12 09:38:25 +02:00 committed by Bård Skaflestad
parent 39a98783af
commit d00cff8549

View File

@ -72,37 +72,36 @@ endif (NOT LAPACK_FOUND)
find_library (MATH_LIBRARY NAMES "m")
set (SuiteSparse_EXTRA_LIBS ${LAPACK_LIBRARIES} ${BLAS_LIBRARIES} ${MATH_LIBRARY})
# search paths for the library outside of standard system paths. these are the
# paths in which the package managers on various distros put the files
list (APPEND SuiteSparse_SEARCH_PATH "/usr") # Linux
list (APPEND SuiteSparse_SEARCH_PATH "/opt/local") # MacOS X
# if we don't get any further clues about where to look, then start
# roaming around the system
set (_no_default_path "")
# search system directories by default
set (SuiteSparse_SEARCH_PATH)
# pick up paths from the environment if specified there; these replace the
# pre-defined paths so that we don't accidentially pick up old stuff
if (NOT $ENV{SuiteSparse_DIR} STREQUAL "")
set (SuiteSparse_SEARCH_PATH "$ENV{SuiteSparse_DIR}")
set (_no_default_path "NO_DEFAULT_PATH")
endif (NOT $ENV{SuiteSparse_DIR} STREQUAL "")
if (SuiteSparse_DIR)
set (SuiteSparse_SEARCH_PATH "${SuiteSparse_DIR}")
set (_no_default_path "NO_DEFAULT_PATH")
endif (SuiteSparse_DIR)
# CMake uses _DIR suffix as default for config-mode files; it is unlikely
# that we are building SuiteSparse ourselves; use _ROOT suffix to specify
# location to pre-canned binaries
if (NOT $ENV{SuiteSparse_ROOT} STREQUAL "")
set (SuiteSparse_SEARCH_PATH "$ENV{SuiteSparse_ROOT}")
set (_no_default_path "NO_DEFAULT_PATH")
endif (NOT $ENV{SuiteSparse_ROOT} STREQUAL "")
if (SuiteSparse_ROOT)
set (SuiteSparse_SEARCH_PATH "${SuiteSparse_ROOT}")
set (_no_default_path "NO_DEFAULT_PATH")
endif (SuiteSparse_ROOT)
# if we have specified a search path, then confine ourselves to that
if (SuiteSparse_SEARCH_PATH)
set (_no_default_path "NO_DEFAULT_PATH")
endif (SuiteSparse_SEARCH_PATH)
# transitive closure of dependencies; after this SuiteSparse_MODULES is the
# full list of modules that must be found to satisfy the user's link demands
set (SuiteSparse_MODULES ${SuiteSparse_FIND_COMPONENTS})