Merge pull request #210 from rolk/210_ifdef

SuiteSparse configuration returns zero instead of blank string when header not found
This commit is contained in:
Atgeirr Flø Rasmussen
2013-03-19 05:35:07 -07:00
2 changed files with 5 additions and 3 deletions

View File

@@ -30,9 +30,9 @@ endif (AGMG_SOURCES)
# set value for config.h
if (AGMG_SOURCES)
set (HAVE_AGMG 1)
set (HAVE_AGMG 1 CACHE INT "Is AGMG present?")
else (AGMG_SOURCES)
set (HAVE_AGMG 0)
set (HAVE_AGMG "" CACHE INT "Is AGMG present?")
endif (AGMG_SOURCES)
# handle REQUIRED and QUIET standard options

View File

@@ -231,7 +231,9 @@ foreach (module IN LISTS SuiteSparse_FIND_COMPONENTS)
endforeach (file)
if (NOT SuiteSparse_${MODULE}_FOUND)
set (SuiteSparse_FOUND FALSE)
set (HAVE_SUITESPARSE_${MODULE}_H 0 CACHE INT "Is ${module} header present?")
# use empty string instead of zero, so it can be tested with #ifdef
# as well as #if in the source code
set (HAVE_SUITESPARSE_${MODULE}_H "" CACHE INT "Is ${module} header present?")
else (NOT SuiteSparse_${MODULE}_FOUND)
set (HAVE_SUITESPARSE_${MODULE}_H 1 CACHE INT "Is ${module} header present?")
list (APPEND SuiteSparse_LIBRARIES "${${MODULE}_LIBRARIES}")