2022-06-29 10:25:32 +00:00
|
|
|
cmake_minimum_required (VERSION 3.16)
|
2019-12-28 20:33:14 +00:00
|
|
|
|
2022-07-25 20:29:42 +00:00
|
|
|
project(LASP LANGUAGES C CXX)
|
2022-07-20 12:58:48 +00:00
|
|
|
|
2020-10-04 20:29:54 +00:00
|
|
|
# To allow linking to static libs from other directories
|
|
|
|
cmake_policy(SET CMP0079 NEW)
|
2022-07-20 12:58:48 +00:00
|
|
|
|
|
|
|
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")
|
2021-09-14 18:05:42 +00:00
|
|
|
include("BuildType")
|
2022-07-20 12:58:48 +00:00
|
|
|
include("QueryPythonForPybind11")
|
|
|
|
|
|
|
|
|
|
|
|
# Find the pybind11 package
|
|
|
|
find_pybind11_python_first()
|
2021-09-14 18:05:42 +00:00
|
|
|
|
2019-12-28 20:33:14 +00:00
|
|
|
# This is used for code completion in vim
|
2022-06-29 10:25:32 +00:00
|
|
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
2018-01-29 15:14:50 +00:00
|
|
|
|
2022-05-23 15:26:29 +00:00
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
2022-06-29 10:25:32 +00:00
|
|
|
set(CMAKE_CXX_STANDARD_REQUIRED)
|
2022-05-23 15:26:29 +00:00
|
|
|
|
2021-09-14 18:05:42 +00:00
|
|
|
option(LASP_DOUBLE_PRECISION "Compile as double precision floating point" ON)
|
|
|
|
option(LASP_HAS_RTAUDIO "Compile with RtAudio Daq backend" ON)
|
|
|
|
option(LASP_HAS_ULDAQ "Compile with UlDaq backend" ON)
|
2021-12-27 11:08:53 +00:00
|
|
|
|
2021-09-14 18:05:42 +00:00
|
|
|
set(LASP_FFT_BACKEND "FFTW" CACHE STRING "FFT Library backend")
|
|
|
|
set_property(CACHE LASP_FFT_BACKEND PROPERTY STRINGS "FFTW" "FFTPack" "None")
|
|
|
|
|
2022-07-20 12:58:48 +00:00
|
|
|
set(PY_FULL_VERSION ${PROJECT_VERSION}${PY_VERSION_SUFFIX})
|
2022-06-29 10:25:32 +00:00
|
|
|
|
2022-05-23 15:26:29 +00:00
|
|
|
# Required for PYBIND11
|
2022-07-20 12:58:48 +00:00
|
|
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
2022-05-23 15:26:29 +00:00
|
|
|
|
2021-09-14 18:05:42 +00:00
|
|
|
if(CMAKE_BUILD_TYPE STREQUAL Debug)
|
2022-07-20 12:58:48 +00:00
|
|
|
add_definitions(-DDEBUG=1)
|
2021-09-14 18:05:42 +00:00
|
|
|
set(LASP_DEBUG True)
|
|
|
|
else()
|
|
|
|
set(LASP_DEBUG False)
|
|
|
|
endif()
|
2020-10-14 07:42:19 +00:00
|
|
|
|
2022-06-29 10:25:32 +00:00
|
|
|
# link openblas
|
|
|
|
set(BLA_VENDOR OpenBLAS)
|
|
|
|
find_package(BLAS REQUIRED)
|
|
|
|
|
2020-10-14 07:42:19 +00:00
|
|
|
# Reasonable maximum to the nfft size, at 48kHz this is 700s of data...
|
2018-02-23 19:40:45 +00:00
|
|
|
add_definitions(-DLASP_MAX_NFFT=33554432) # 2**25
|
2018-02-06 11:01:27 +00:00
|
|
|
|
2018-01-29 15:14:50 +00:00
|
|
|
# ####################################### End of user-adjustable variables section
|
2022-07-20 12:58:48 +00:00
|
|
|
include(OSSpecific)
|
2021-09-14 18:05:42 +00:00
|
|
|
|
2018-01-29 15:14:50 +00:00
|
|
|
|
2022-05-23 15:26:29 +00:00
|
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wno-type-limits")
|
2020-04-03 09:12:49 +00:00
|
|
|
|
2022-07-20 12:58:48 +00:00
|
|
|
set(CMAKE_C_FLAGS_RELEASE "-O3 -mfpmath=sse -march=x86-64 -mtune=native \
|
2019-12-29 21:07:27 +00:00
|
|
|
-fdata-sections -ffunction-sections -fomit-frame-pointer -finline-functions")
|
2018-01-29 15:14:50 +00:00
|
|
|
|
2018-04-01 08:27:27 +00:00
|
|
|
# ############################# End compilation flags
|
|
|
|
|
2022-07-20 12:58:48 +00:00
|
|
|
add_subdirectory(third_party)
|
|
|
|
add_subdirectory(src/lasp)
|