-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
45 lines (33 loc) · 1.19 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
cmake_minimum_required(VERSION 3.16)
project(mmio)
include(cmake/CPM.cmake)
set(CMAKE_EXPORT_COMPILE_COMMANDS
TRUE
CACHE BOOL "Export compile commands to build directory" FORCE)
set(COMMON_FLAGS "-Wall -O3 -march=native -fPIC")
set(CMAKE_C_FLAGS "-std=c11 ${CMAKE_C_FLAGS} ${COMMON_FLAGS}")
set(CMAKE_CXX_FLAGS "-std=c++17 ${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")
set(CMAKE_EXPORT_COMPILE_COMMANDS
TRUE
CACHE BOOL "Export compile commands" FORCE)
find_package(OpenMP REQUIRED)
# Primary project
add_library(mtxio src/mtxio.c)
set_property(TARGET mtxio PROPERTY C_STANDARD 11)
target_include_directories(mtxio PUBLIC include)
target_link_libraries(mtxio OpenMP::OpenMP_C m)
# target_compile_options(mtxio PRIVATE -fanalyzer)
# Reference NIST project
add_library(mmio src/mmio.c)
set_property(TARGET mmio PROPERTY C_STANDARD 11)
target_include_directories(mmio PUBLIC include)
# Get and install fast_matrix_market
cpmaddpackage("gh:alugowski/[email protected]")
cpmaddpackage("gh:GT-TDAlab/[email protected]")
add_subdirectory(bench)
option(BUILD_TESTING "Build tests for MTXIO" ON)
if(${BUILD_TESTING})
enable_testing()
cpmaddpackage("gh:jasmcaus/tau#bde8709")
add_subdirectory(test)
endif()