aboutsummaryrefslogtreecommitdiffstats
path: root/lib/CMakeLists.txt
blob: 378e40b6aae62b2d34bcbabe339c5d7fc18d2775 (plain) (blame)
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
project(fshift)
set(SOURCE_FFT_LIB src/fft/pffft/pffft.c)
#add_library(fft_impl STATIC ${SOURCE_FFT_LIB})
add_library(fshift)
add_library(fshift::fshift ALIAS fshift)
target_sources(fshift PRIVATE "src/dsp.c" ${SOURCE_FFT_LIB})
set_target_properties(fshift PROPERTIES PUBLIC_HEADER "include/libfshift.h")
target_include_directories(fshift
	PUBLIC
		"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
		"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
		"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
	PRIVATE
		"${CMAKE_CURRENT_SOURCE_DIR}/src")
target_link_libraries(fshift m)

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -fsanitize=address -fno-omit-frame-pointer")

set(fshift_ut
	tests/ut.c
)

set(LIBFSHIFT_BUILD_PUB_HEADER ${CMAKE_CURRENT_SOURCE_DIR}/include PARENT_SCOPE)
set(LIBFSHIFT_BUILD_LIB_PATH "${CMAKE_CURRENT_BINARY_DIR}/libfshift.a" PARENT_SCOPE)

add_executable(fshift_ut ${fshift_ut})

target_link_libraries(fshift_ut
	fshift
)

enable_testing()
add_test(ut fshift_ut)