-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
63 lines (53 loc) · 1.91 KB
/
Copy pathCMakeLists.txt
File metadata and controls
63 lines (53 loc) · 1.91 KB
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
# Minimum CMake version required
cmake_minimum_required(VERSION 3.10)
# Project name and languages
project(SavitzkyGolayFilter LANGUAGES C CXX)
# Set C and C++ standards
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# =============================================================================
# BUILD OPTIONS
# =============================================================================
option(USE_PARALLEL_SAVGOL "Build parallel (OpenMP) version of Savitzky-Golay filter" OFF)
# Print selected build mode
if(USE_PARALLEL_SAVGOL)
message(STATUS "Building PARALLEL Savitzky-Golay implementation (with OpenMP)")
else()
message(STATUS "Building SEQUENTIAL Savitzky-Golay implementation")
endif()
# Ensure Cygwin runtime linkage for all targets
if (CYGWIN)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lc -lcygwin")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lc -lcygwin")
set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} -lc -lcygwin")
endif()
# Fetch GoogleTest
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.12.1
)
FetchContent_MakeAvailable(googletest)
# Fetch FFF (Fake Function Framework)
FetchContent_Declare(
fff
GIT_REPOSITORY https://github.com/meekrosoft/fff.git
GIT_TAG master
)
FetchContent_MakeAvailable(fff)
# =============================================================================
# INCLUDE SUBDIRECTORIES
# =============================================================================
# Conditionally include the appropriate implementation
if(USE_PARALLEL_SAVGOL)
#add_subdirectory(src/parallel)
else()
add_subdirectory(src)
endif()
# Always include tests (they should work with either implementation)
add_subdirectory(test/iterative)
# Enable testing
enable_testing()