-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
55 lines (48 loc) · 1.66 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
cmake_minimum_required(VERSION 3.10)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project("xrif")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O3 -std=c11") # -march=skylake")
find_package(OpenMP)
if(OPENMP_FOUND)
message("Found OpenMP")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}")
endif()
find_library(LIBRT rt)
if(LIBRT_FOUND)
message("Explicitly requiring -lrt")
endif()
find_library(LIBM m)
if(LIBM_FOUND)
message("Explicitly requiring -lm")
endif()
find_library(LIBPTHREAD pthread)
if(LIBPTHREAD_FOUND)
message("Explicitly requiring -lpthread")
endif()
include(FindPkgConfig)
if(PKG_CONFIG_FOUND)
pkg_check_modules(SUBUNIT libsubunit)
pkg_check_modules(CHECK check)
endif()
#######################################################################
#
# Source
#
#######################################################################
add_subdirectory(src)
#######################################################################
#
# Tests
#
#######################################################################
if(CHECK_FOUND AND SUBUNIT_FOUND)
add_subdirectory(tests)
enable_testing()
add_test(xrif_test_init tests/xrif_test_init)
add_test(xrif_test_difference_previous_whitenoise tests/xrif_test_difference_previous_whitenoise)
add_test(xrif_test_difference_first_whitenoise tests/xrif_test_difference_first_whitenoise)
add_test(xrif_test_difference_pixel_whitenoise tests/xrif_test_difference_pixel_whitenoise)
add_test(xrif_test_increment tests/xrif_test_increment)
add_test(xrif_test_whitenoise tests/xrif_test_whitenoise)
endif()