From 5a14e481fb809751f401eec682f52709cba3d4f5 Mon Sep 17 00:00:00 2001 From: Roland Kaufmann Date: Wed, 16 Jan 2013 11:24:41 +0100 Subject: [PATCH] Let SuiteSparse path be specified without config mode Use the _ROOT suffix to direct the CMake module to use a particular path to the SuiteSparse installation without also triggering config mode (by convention CMake uses Foo_DIR as the name of the variable which specifies where to look for another *project*). --- cmake/Modules/FindSuiteSparse.cmake | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/cmake/Modules/FindSuiteSparse.cmake b/cmake/Modules/FindSuiteSparse.cmake index c509b49a..6cae218f 100644 --- a/cmake/Modules/FindSuiteSparse.cmake +++ b/cmake/Modules/FindSuiteSparse.cmake @@ -42,6 +42,17 @@ if (${SuiteSparse_DIR}) list (INSERT SuiteSparse_SEARCH_INCS 0 "${SuiteSparse_DIR}") list (INSERT SuiteSparse_SEARCH_LIBS 0 "${SuiteSparse_DIR}") 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 "") + list (INSERT SuiteSparse_SEARCH_INCS 0 "$ENV{SuiteSparse_ROOT}") + list (INSERT SuiteSparse_SEARCH_LIBS 0 "$ENV{SuiteSparse_ROOT}") +endif (NOT $ENV{SuiteSparse_ROOT} STREQUAL "") +if (${SuiteSparse_ROOT}) + list (INSERT SuiteSparse_SEARCH_INCS 0 "${SuiteSparse_ROOT}") + list (INSERT SuiteSparse_SEARCH_LIBS 0 "${SuiteSparse_ROOT}") +endif (${SuiteSparse_ROOT}) # 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