| 1 |
# Options |
| 2 |
|
| 3 |
# Option to utilize Conan 1.x |
| 4 |
option(MATIO_USE_CONAN "Use Conan 1.x to resolve library dependencies" OFF) |
| 5 |
|
| 6 |
# Option to enable extended sparse matrix data types not supported in MATLAB |
| 7 |
option(MATIO_EXTENDED_SPARSE "Enable extended sparse matrix data types not supported in MATLAB" ON) |
| 8 |
set(EXTENDED_SPARSE ${MATIO_EXTENDED_SPARSE}) |
| 9 |
|
| 10 |
# Option to enable MAT v7.3 file support |
| 11 |
option(MATIO_MAT73 "Enable support for version 7.3 MAT files" ON) |
| 12 |
set(MAT73 ${MATIO_MAT73}) |
| 13 |
|
| 14 |
# Option to build static or shared |
| 15 |
option(MATIO_SHARED "Build shared matio library, disable for static library" ON) |
| 16 |
|
| 17 |
# Option to enable position-independent code (PIC) |
| 18 |
option(MATIO_PIC "Enable position-independent code (PIC), i.e., compilation with the -fPIC flag" ON) |
| 19 |
|
| 20 |
# Build with hdf5 support |
| 21 |
option(MATIO_WITH_HDF5 "Check for hdf5 library" ON) |
| 22 |
|
| 23 |
# Build with zlib support |
| 24 |
option(MATIO_WITH_ZLIB "Check for zlib library" ON) |
| 25 |
|
| 26 |
# Select what MAT file format version is used by default |
| 27 |
set(MATIO_DEFAULT_FILE_VERSION "5" CACHE STRING "Default MAT file version") |
| 28 |
set_property(CACHE MATIO_DEFAULT_FILE_VERSION PROPERTY STRINGS 4 5 7.3) |
| 29 |
|
| 30 |
if(MATIO_DEFAULT_FILE_VERSION STREQUAL "4") |
| 31 |
set(MAT_FT_DEFAULT MAT_FT_MAT4) |
| 32 |
elseif(MATIO_DEFAULT_FILE_VERSION STREQUAL "5") |
| 33 |
set(MAT_FT_DEFAULT MAT_FT_MAT5) |
| 34 |
elseif(MATIO_DEFAULT_FILE_VERSION STREQUAL "7.3") |
| 35 |
set(MAT_FT_DEFAULT MAT_FT_MAT73) |
| 36 |
else() |
| 37 |
message(ERROR "Unrecognized MAT file version") |
| 38 |
endif() |
| 39 |
|
| 40 |
if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.10") |
| 41 |
option(MATIO_ENABLE_CPPCHECK "Enable static analysis with Cppcheck." OFF) |
| 42 |
endif() |
| 43 |
|
| 44 |
# Option to enable matio testsuite |
| 45 |
option(MATIO_BUILD_TESTING "Build matio testing" ON) |
| 46 |
|
| 47 |
set(BUILD_TESTING OFF) |
| 48 |
if(MATIO_BUILD_TESTING) |
| 49 |
set(BUILD_TESTING ON) |
| 50 |
endif() |