-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
149 lines (114 loc) · 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
# Minimum cmake verison 3.9 required for Monarch
cmake_minimum_required (VERSION 3.12)
# Define the project
cmake_policy( SET CMP0048 NEW ) # version in project()
project( Psyllid VERSION 2.2.1 )
list( APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/sandfly/cmake )
include( sandfly )
#########
# flags #
#########
set( default__fpa_flag FALSE )
if( UNIX AND NOT APPLE )
set( default__fpa_flag TRUE )
endif( UNIX AND NOT APPLE )
set( CMAKE_CXX_STANDARD 17 )
option( Psyllid_ENABLE_ITERATOR_TIMING "Flag to enable iterator time profiling" FALSE )
option( Psyllid_ENABLE_FPA "Flag to enable the fast-packet-acquisition interface (requires root)" ${default__fpa_flag} )
option( Psyllid_ENABLE_STREAMED_FREQUENCY_OUTPUT "Flag to enable building node for streaming frequency data (inproper monarch usage)" FALSE )
option( Psyllid_ENABLE_FFTW "Flag to enable FFTW features" TRUE )
option( Psyllid_ENABLE_EXAMPLES "Flag to enable building of examples" FALSE )
# add an option to perform iterator time profiling
if( Psyllid_ENABLE_ITERATOR_TIMING )
add_definitions( -DENABLE_ITERATOR_TIMING )
else( Psyllid_ENABLE_ITERATOR_TIMING )
remove_definitions( -DENABLE_ITERATOR_TIMING )
endif( Psyllid_ENABLE_ITERATOR_TIMING )
# FPA should only be available for a linux machine, and not apple
if( Psyllid_ENABLE_FPA AND UNIX AND NOT APPLE )
set( Psyllid_BUILD_FPA TRUE )
add_definitions( -DBUILD_FPA )
else( Psyllid_ENABLE_FPA AND UNIX AND NOT APPLE )
set( Psyllid_BUILD_FPA FALSE )
remove_definitions( -DBUILD_FPA )
endif( Psyllid_ENABLE_FPA AND UNIX AND NOT APPLE )
# Control executable build
set_option( Midge_ENABLE_EXECUTABLES FALSE )
set_option( Sandfly_ENABLE_EXECUTABLES FALSE )
# We don't need Python bindings
set_option( Scarab_BUILD_PYTHON FALSE )
################
# dependencies #
################
set( PUBLIC_EXT_LIBS )
set( PRIVATE_EXT_LIBS )
# FFTW
if( Psyllid_ENABLE_FFTW)
find_package( FFTW REQUIRED MODULE )
else ( Psyllid_ENABLE_FFTW )
set( FFTW_FOUND FALSE )
endif( Psyllid_ENABLE_FFTW )
if ( FFTW_FOUND )
#include_directories( ${FFTW_INCLUDE_DIR} )
add_definitions( -DFFTW_FOUND )
list( APPEND PUBLIC_EXT_LIBS ${FFTW_LIBRARIES} )
if( FFTW_THREADS_FOUND )
set( FFTW_NTHREADS 1 CACHE STRING "Number of threads to use for FFTW processes" )
add_definitions( -DFFTW_NTHREADS=${FFTW_NTHREADS} )
list( APPEND PUBLIC_EXT_LIBS ${FFTW_THREADS_LIBRARIES} )
message( STATUS "FFTW configured to use up to ${FFTW_NTHREADS} threads." )
else( FFTW_THREADS_FOUND )
remove_definitions( -DFFTW_NTHREADS=${FFTW_NTHREADS} )
endif( FFTW_THREADS_FOUND )
else( FFTW_FOUND )
message( STATUS "Building without FFTW" )
set( Psyllid_ENABLE_FFTW FALSE )
remove_definitions( -DFFTW_FOUND )
remove_definitions( -DFFTW_NTHREADS=${FFTW_NTHREADS} )
endif( FFTW_FOUND )
# Boost
# Boost (1.48 required for container; scarab minimum is 1.46)
#find_package( Boost 1.48.0 REQUIRED )
# Sandfly
add_definitions( -DDRIPLINE_AUTH_FILE=~/.project8_authentications.json )
# Included external dependencies
# Including: tk_spline
add_subdirectory( external )
list( APPEND PRIVATE_EXT_LIBS TKSpline )
#####################
# prepare for build #
#####################
pbuilder_prepare_project()
##############
# submodules #
##############
# Sandfly
pbuilder_add_submodule( Sandfly sandfly )
# Monarch
pbuilder_add_submodule( Monarch monarch )
###########
# psyllid #
###########
# add include directories
include_directories( BEFORE
source/control
source/daq
source/data
source/utility
)
# build this project
add_subdirectory( source )
if( Psyllid_ENABLE_EXECUTABLES )
add_subdirectory( source/applications )
endif()
if( Psyllid_ENABLE_TESTING )
#add_subdirectory( source/test )
endif()
if( Psyllid_ENABLE_EXAMPLES )
add_subdirectory( examples )
endif()
##################
# package config #
##################
configure_file( ${PROJECT_SOURCE_DIR}/PsyllidConfig.cmake.in ${CMAKE_CURRENT_BINARY_DIR}/PsyllidConfig.cmake @ONLY )
pbuilder_do_package_config()