-
Notifications
You must be signed in to change notification settings - Fork 91
/
CMakeLists.txt
63 lines (56 loc) · 2.4 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
58
59
60
61
62
63
cmake_minimum_required(VERSION 3.15)
project(saf_head)
# Project options/defaults
option(BUILD_SHARED_LIBS "Build shared instead of static libraries." OFF)
option(SAF_BUILD_TESTS "Build SAF unit tests." ON)
option(SAF_BUILD_EXAMPLES "Build SAF examples." ON)
option(SAF_BUILD_EXTRAS "Build SAF extras." OFF)
option(SAF_ENABLE_SOFA_READER_MODULE "Enable the SAF SOFA READER module" OFF)
option(SAF_ENABLE_TRACKER_MODULE "Enable the SAF TRACKER module" OFF)
option(SAF_ENABLE_HADES_MODULE "Enable the SAF HADES module" OFF)
option(SAF_USE_INTEL_IPP "Use Intel IPP for the FFT, resampler, etc." OFF)
option(SAF_USE_FFTW "Use FFTW3 for the FFT." OFF)
option(SAF_ENABLE_SIMD "Enable the use of SSE3, AVX2, AVX512" OFF)
option(SAF_ENABLE_NETCDF "Enable netcdf for the sofa reader module" OFF)
option(SAF_USE_FAST_MATH_FLAG "Enable -ffast-math compiler flag" ON)
if (NOT SAF_PERFORMANCE_LIB)
set(SAF_PERFORMANCE_LIB "SAF_USE_INTEL_MKL_LP64" CACHE STRING "Performance library for SAF to use.")
endif()
#message(STATUS "PERFORMACE LIB is ${SAF_PERFORMANCE_LIB}")
if (NOT CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "Release" CACHE STRING "" FORCE)
endif()
# Configure CMake
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED OFF)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_EXPORT_COMPILE_COMMANDS true)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
# Platform specific flags and definitions
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /MP")
elseif(APPLE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -stdlib=libc++")
elseif(UNIX AND NOT APPLE AND NOT ANDROID)
add_definitions(
#-std=c++11
-DLINUX=1
)
endif()
# add subdirectory for SAF
add_subdirectory(framework)
# Optionally, also add the SAF examples and/or unit testing program
set(example_prefix "saf_example_")
if(SAF_BUILD_EXAMPLES)
add_subdirectory(examples)
endif()
if(SAF_BUILD_EXTRAS)
add_subdirectory(extras)
endif()
if(SAF_BUILD_TESTS)
add_subdirectory(test)
endif()