|  | @@ -298,8 +298,23 @@ ELSE (EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  |    MESSAGE("-- Did not find SuiteSparse_config header")
 | 
	
		
			
				|  |  |  ENDIF (EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  | -IF (NOT EXISTS ${SUITESPARSE_CONFIG_LIB} OR
 | 
	
		
			
				|  |  | -    NOT EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  | +IF (EXISTS ${SUITESPARSE_CONFIG_LIB} AND
 | 
	
		
			
				|  |  | +    EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  | +  # SuiteSparse_config (SuiteSparse version >= 4) requires librt library for
 | 
	
		
			
				|  |  | +  # timing by default when compiled on Linux or Unix, but not on OSX (which
 | 
	
		
			
				|  |  | +  # does not have librt).
 | 
	
		
			
				|  |  | +  IF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR UNIX AND NOT APPLE)
 | 
	
		
			
				|  |  | +    FIND_LIBRARY(LIBRT_LIB NAMES rt)
 | 
	
		
			
				|  |  | +    IF (LIBRT_LIB)
 | 
	
		
			
				|  |  | +      MESSAGE("-- Adding librt: ${LIBRT_LIB} to SuiteSparse_config libraries.")
 | 
	
		
			
				|  |  | +    ELSE (LIBRT_LIB)
 | 
	
		
			
				|  |  | +      MESSAGE("-- Could not find librt, but found SuiteSparse_config, "
 | 
	
		
			
				|  |  | +        "assuming that SuiteSparse was compiled without timing.")
 | 
	
		
			
				|  |  | +    ENDIF (LIBRT_LIB)
 | 
	
		
			
				|  |  | +    LIST(APPEND SUITESPARSE_CONFIG_LIB ${LIBRT_LIB})
 | 
	
		
			
				|  |  | +  ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux" OR UNIX AND NOT APPLE)
 | 
	
		
			
				|  |  | +ELSE (EXISTS ${SUITESPARSE_CONFIG_LIB} AND
 | 
	
		
			
				|  |  | +      EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  |    SET(SUITESPARSE_CONFIG_FOUND FALSE)
 | 
	
		
			
				|  |  |    FIND_PATH(UFCONFIG_INCLUDE NAMES UFconfig.h)
 | 
	
		
			
				|  |  |    IF (EXISTS ${UFCONFIG_INCLUDE})
 | 
	
	
		
			
				|  | @@ -308,8 +323,8 @@ IF (NOT EXISTS ${SUITESPARSE_CONFIG_LIB} OR
 | 
	
		
			
				|  |  |      MESSAGE("-- Did not find UFconfig header")
 | 
	
		
			
				|  |  |      SET(UFCONFIG_FOUND FALSE)
 | 
	
		
			
				|  |  |    ENDIF (EXISTS ${UFCONFIG_INCLUDE})
 | 
	
		
			
				|  |  | -ENDIF (NOT EXISTS ${SUITESPARSE_CONFIG_LIB} OR
 | 
	
		
			
				|  |  | -       NOT EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  | +ENDIF (EXISTS ${SUITESPARSE_CONFIG_LIB} AND
 | 
	
		
			
				|  |  | +       EXISTS ${SUITESPARSE_CONFIG_INCLUDE})
 | 
	
		
			
				|  |  |  
 | 
	
		
			
				|  |  |  FIND_LIBRARY(METIS_LIB NAMES metis)
 | 
	
		
			
				|  |  |  IF (EXISTS ${METIS_LIB})
 |