-
Notifications
You must be signed in to change notification settings - Fork 38
/
CMakeLists.txt
85 lines (61 loc) · 2.94 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
project(ecg-analyzer)
cmake_minimum_required(VERSION 2.6)
INCLUDE(CheckLibraryExists)
# Additional CMake modules for 3rd party library checks reside here
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_admin")
set(Boost_USE_MULTITHREADED ON)
find_package(Boost 1.48 REQUIRED COMPONENTS thread system)
find_package(Qt4 4.8 REQUIRED)
find_package(Qwt 6 REQUIRED)
find_package(gsl REQUIRED)
find_package(fftw 3.3 REQUIRED)
find_package(Threads REQUIRED)
#check if some platform-specific libraries are needed for linking client and server
CHECK_LIBRARY_EXISTS(rt shm_open "" HAVE_RT_LIB)
if(HAVE_RT_LIB)
set(RT_LIB -lrt)
endif()
CHECK_LIBRARY_EXISTS(dl dlopen "" HAVE_DL_LIB)
if(HAVE_DL_LIB)
set(DL_LIB -ldl)
endif()
if(CMAKE_CXX_COMPILER MATCHES ".*clang")
set(CMAKE_COMPILER_IS_CLANGXX ON)
endif()
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_COMPILER_IS_CLANGXX)
set(CMAKE_CXX_FLAGS "-std=c++0x -Wall -Wextra -Wpointer-arith -Wno-switch -Wno-sign-compare -Wno-unused-parameter -Wno-overloaded-virtual -fpermissive")
endif()
FILE(GLOB ecg-analyzer_HEADERS *.h *.hpp)
FILE(GLOB ecg-analyzer_SOURCES *.cpp)
FILE(GLOB matrix_HEADERS matrix/*.h)
FILE(GLOB matrix_SOURCES matrix/*.cpp)
FILE(GLOB plots_HEADERS plots/*.h)
FILE(GLOB plots_SOURCES plots/*.cpp)
SET(ecg-analyzer_Q_OBJECTS_HEADERS ecganalyzer.h AboutWindow.h)
SET(ecg-analyzer_FORMS ecganalyzer.ui)
SET(ecg-analyzer_AboutWindow_FORMS AboutWindow.ui)
SET(ecg-analyzer_RESOURCES ecganalyzer.qrc)
QT4_WRAP_CPP(ecg-analyzer_HEADERS_MOC ${ecg-analyzer_Q_OBJECTS_HEADERS} ${plots_HEADERS})
QT4_WRAP_UI(ecg-analyzer_FORMS_HEADERS ${ecg-analyzer_FORMS})
QT4_WRAP_UI(ecg-analyzer_AboutWindow_FORMS_HEADERS ${ecg-analyzer_AboutWindow_FORMS})
QT4_ADD_RESOURCES(ecg-analyzer_RESOURCES_RCC ${ecg-analyzer_RESOURCES})
INCLUDE(${QT_USE_FILE})
ADD_DEFINITIONS(${QT_DEFINITIONS})
# Controls behaviour of logger - possible values: -DCLEANTLOG, -DFTLOG, -DETLOG, -DTLOG
ADD_DEFINITIONS("-DFTLOG=log")
# ADD_DEFINITIONS("-DDEVELOPMENT")
include_directories(${GSL_INCLUDE_DIRS} ${GSLCBLAS_INCLUDE_DIRS})
set(LIBS ${LIBS} ${GSL_LIBRARIES} ${GSLCBLAS_LIBRARIES})
add_subdirectory(wfdb)
add_subdirectory(fft)
add_subdirectory(spline)
include_directories(${CMAKE_HOME_DIRECTORY} ${CMAKE_CURRENT_SOURCE_DIR})
include_directories(${Boost_INCLUDE_DIRS})
include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${QWT_INCLUDE_DIR})
include_directories(plots)
ADD_EXECUTABLE(ecg-analyzer ${ecg-analyzer_SOURCES} ${plots_SOURCES} ${matrix_SOURCES}
${ecg-analyzer_HEADERS_MOC} ${ecg-analyzer_FORMS_HEADERS} ${ecg-analyzer_AboutWindow_FORMS_HEADERS} ${ecg-analyzer_RESOURCES_RCC} )
# TARGET_LINK_LIBRARIES(ecg-analyzer ${QT_LIBRARIES} ${QWT_LIBRARY} ${LIBS} ${FFTW_LIBRARIES} wfdb kissfft alglib)
TARGET_LINK_LIBRARIES(ecg-analyzer ${QT_LIBRARIES} ${QWT_LIBRARY} ${LIBS}
${FFTW_LIBRARIES} ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT} wfdb kissfft alglib)