-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
executable file
·30 lines (22 loc) · 983 Bytes
/
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
cmake_minimum_required(VERSION 3.1)
project (blockCG)
set(CMAKE_VERBOSE_MAKEFILE ON)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra -std=c++11")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -fprofile-arcs -ftest-coverage -g")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -march=native -DEIGEN_NO_DEBUG")
# make Catch2 unit testing library
add_library(Catch INTERFACE)
target_include_directories(Catch INTERFACE catch)
# set header files
include_directories(inc)
# set common source files
set (SRCS ${SRCS} src/standard_solvers.cpp)
# make benchmark executable
add_executable(benchmark benchmark.cpp ${SRCS})
# make unit test executable
set (TEST_SRCS ${SRCS} test/solvers.cpp)
add_executable(tests test/main.cpp ${TEST_SRCS})
target_link_libraries(tests Catch)
# make running the test executable part of the build, so failed test = failed build
add_custom_command(TARGET tests POST_BUILD COMMAND tests -s -d yes)