@@ -22,9 +22,11 @@ if (NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
22
22
set (CMAKE_CUDA_ARCHITECTURES 75 )
23
23
endif (NOT DEFINED CMAKE_CUDA_ARCHITECTURES )
24
24
25
- project (SuiteSparse LANGUAGES C CXX VERSION 5.12.0
25
+ project (SuiteSparse
26
26
DESCRIPTION "A suite of sparse matrix packages"
27
27
HOMEPAGE_URL http://faculty.cse.tamu.edu/davis/suitesparse.html
28
+ LANGUAGES C
29
+ VERSION 5.12.0
28
30
)
29
31
30
32
set (CMAKE_DEBUG_POSTFIX _debug )
@@ -57,9 +59,7 @@ include (InstallRequiredSystemLibraries)
57
59
include (SuiteSparseBase )
58
60
59
61
option (BUILD_CXSPARSE "Build CXSparse" ON )
60
- option (WITH_CUDA "Enable CUDA support" ON )
61
62
option (WITH_DEMOS "Build demos" ON )
62
- option (WITH_FORTRAN "Enables Fortran support" ON )
63
63
option (WITH_METIS "Enables METIS support" ON )
64
64
option (WITH_OPENMP "Enable OpenMP support" ON )
65
65
option (WITH_PRINT "Print diagnostic messages" OFF )
@@ -68,8 +68,15 @@ option (WITH_TBB "Enables Intel Threading Building Blocks support" ON)
68
68
set (WITH_LICENSE "GPL" CACHE STRING "Software license the binary distribution should adhere" )
69
69
set_property (CACHE WITH_LICENSE PROPERTY STRINGS "Minimal;GPL;LGPL" )
70
70
71
+ check_language (CUDA )
72
+ check_language (CXX )
73
+ check_language (Fortran )
74
+
71
75
cmake_dependent_option (BUILD_SHARED_LIBS "Build shared libraires" OFF "WITH_LICENSE STREQUAL \" GPL\" " ON )
72
76
77
+ cmake_dependent_option (WITH_CUDA "Enable CUDA support" ON "CMAKE_CXX_COMPILER AND CMAKE_CUDA_COMPILER" OFF )
78
+ cmake_dependent_option (WITH_FORTRAN "Enables Fortran support" ON "CMAKE_Fortran_COMPILER" OFF )
79
+
73
80
cmake_dependent_option (WITH_LGPL "Enable GNU LGPL modules" ON "WITH_LICENSE MATCHES \" GPL\" " OFF )
74
81
cmake_dependent_option (WITH_GPL "Enable GNU GPL modules" ON "WITH_LICENSE STREQUAL \" GPL\" " OFF )
75
82
@@ -80,24 +87,21 @@ cmake_dependent_option (WITH_CAMD "Enable interfaces to CAMD, CCOLAMD, CSYMAMD i
80
87
cmake_dependent_option (WITH_CHECK "Enable the Check module" ON "WITH_LGPL" OFF )
81
88
cmake_dependent_option (WITH_MATRIXOPS "Enable the MatrixOps module" ON "WITH_GPL AND WITH_CHOLMOD" OFF )
82
89
cmake_dependent_option (WITH_MODIFY "Enable the Modify module" ON "WITH_GPL AND WITH_CHOLMOD" OFF )
83
- cmake_dependent_option (WITH_SUPERNODAL "Enable the Supernodal module" ON "WITH_GPL" OFF )
90
+ cmake_dependent_option (WITH_SUPERNODAL "Enable the Supernodal module" ON "CMAKE_CXX_COMPILER AND WITH_GPL" OFF )
84
91
85
92
if (WITH_CUDA )
86
- check_language (CUDA )
87
-
88
- if (CMAKE_CUDA_COMPILER )
89
- enable_language (CUDA )
90
- endif (CMAKE_CUDA_COMPILER )
93
+ enable_language (CUDA )
91
94
else (WITH_CUDA )
92
95
set (CMAKE_FIND_PACKAGE_DISABLE_CUDAToolkit ON )
93
96
endif (WITH_CUDA )
94
97
95
- if (WITH_FORTRAN )
96
- check_language (Fortran )
98
+ # CUDA and SPQR require a C++ compiler
99
+ if (WITH_SUPERNODAL OR WITH_CUDA )
100
+ enable_language (CXX )
101
+ endif (WITH_SUPERNODAL OR WITH_CUDA )
97
102
98
- if (CMAKE_Fortran_COMPILER )
99
- enable_language (Fortran )
100
- endif (CMAKE_Fortran_COMPILER )
103
+ if (WITH_FORTRAN )
104
+ enable_language (Fortran )
101
105
endif (WITH_FORTRAN )
102
106
103
107
check_c_compiler_flag (-Qstd=c99 HAVE_QSTD_C99 )
0 commit comments