CMakeLists.txt
1.06 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
cmake_minimum_required(VERSION 2.8)
project(AD9915-library)
option(AD9915_DEBUG "Activate debug build" ON)
# CFLAGS
set(CMAKE_C_FLAGS "-O2")
set(CMAKE_C_FLAGS_DEBUG "-Wall -Wextra -g")
# Depends (memo, currently nothing here)
#set(CMAKE_MODULE_PATH
# ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/modules")
#find_package(FFTW REQUIRED)
# Include GNUInstallDirs
include(GNUInstallDirs)
# Include header
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include)
# Create library dynamic
add_library(ad9915 SHARED
src/ad9915.c
src/ddsFreq.c
src/spi.c
)
if (AD9915_DEBUG)
message(STATUS "Debug enable")
set(CMAKE_BUILD_TYPE Debug)
endif()
set_target_properties(ad9915
PROPERTIES SOVERSION 1.0
)
# Rules for install
install(TARGETS ad9915
EXPORT ad9915Config
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
)
install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/include/
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/ad9915
FILES_MATCHING
PATTERN "*.h"
PATTERN ".swp" EXCLUDE
)
install(
EXPORT ad9915Config
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/ad9915"
)