-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathCMakeLists.txt
57 lines (45 loc) · 1.57 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
46
47
48
49
50
51
52
53
54
55
56
57
cmake_minimum_required(VERSION 3.13)
cmake_policy(SET CMP0076 NEW)
# set the project name
project(SpaSM VERSION 1.3
LANGUAGES C CXX
HOMEPAGE_URL https://github.com/cbouilla/spasm)
# if(NOT CMAKE_BUILD_TYPE)
# message(VERBOSE "Setting build type to 'Debug' as none was specified.")
# set(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Choose the type of build." FORCE)
# endif()
#
# message(STATUS "Build type: ${CMAKE_BUILD_TYPE}")
# message(STATUS "Configuration type: ${CMAKE_CONFIGURATION_TYPES}")
if(CMAKE_BUILD_TYPE)
message(WARNING "Non-standard build type: ${CMAKE_BUILD_TYPE}")
string(TOLOWER ${CMAKE_BUILD_TYPE} build_type)
endif()
# specify the C standard
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED True)
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
include(CTest)
find_package(OpenMP REQUIRED)
# pkg-config then libm4ri
find_package(PkgConfig REQUIRED)
pkg_check_modules(GIVARO REQUIRED IMPORTED_TARGET givaro)
pkg_check_modules(FFLAS_FFPACK REQUIRED IMPORTED_TARGET fflas-ffpack)
# set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/config;${CMAKE_MODULE_PATH}")
# find_package(PAPI)
if (build_type STREQUAL cov)
add_compile_options(-Wall -O0 --coverage -Wno-pragmas -fopenmp)
add_link_options(--coverage)
message(WARNING "special coverage options")
else()
# normal
add_compile_options(-Wall -O3 -Wno-pragmas -fopenmp -g)
endif()
add_link_options(-z noexecstack)
########################################################################
add_subdirectory(src)
add_subdirectory(tools)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()