CMakeLists.txt 4.4 KB
Newer Older
1
2
3
4
cmake_minimum_required(VERSION 2.8.9)
project (rapidmix)

# The version number.
5
6
set (rapidmix_VERSION_MAJOR 2)
set (rapidmix_VERSION_MINOR 2)
7

8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
include(CheckCXXCompilerFlag)
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
if(COMPILER_SUPPORTS_CXX11)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(COMPILER_SUPPORTS_CXX0X)
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
else()
        message(STATUS "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
endif()

# Compiler Flags
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fPIC")
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -DJSON_DEBUG -fPIC")
if (NOT CMAKE_BUILD_TYPE)
    message(STATUS "No build type selected, default to Release")
    set(CMAKE_BUILD_TYPE "Release")
endif()
26

27
28
# Main lib
include_directories(${PROJECT_SOURCE_DIR}/src)
29

30
31
32
33
34
35
# RAPID-MIX dependencies
include_directories(dependencies/RapidLib/src)
include_directories(dependencies/xmm/src)
include_directories(dependencies/GVF)
include_directories(dependencies/Maximilian)
include_directories(dependencies/Maximilian/libs)
36
37
38
39
40
41
42
43
44
45
46
include_directories(dependencies/pipo/sdk/src)
include_directories(dependencies/pipo/sdk/src/host)
include_directories(dependencies/pipo/modules)
include_directories(dependencies/pipo/modules/collection)
include_directories(dependencies/pipo/modules/bayesfilter/src)
include_directories(dependencies/pipo/modules/finitedifferences)
include_directories(dependencies/pipo/modules/rta/src)
include_directories(dependencies/pipo/modules/rta/src/util)
include_directories(dependencies/pipo/modules/rta/src/statistics)
include_directories(dependencies/pipo/modules/rta/src/signal)
include_directories(dependencies/pipo/modules/rta/bindings/lib)
47
48
49
50

# Third party dependencies
include_directories(dependencies/third_party/json)

51
# Source Files
52
53
file(GLOB_RECURSE RAPIDMIX_SRC "${PROJECT_SOURCE_DIR}/src/*.cpp")
file(GLOB GVF_SRC "${PROJECT_SOURCE_DIR}/dependencies/GVF/GVF.cpp")
54
55

# Maximilian
56
file(GLOB MAXI_SRC "${PROJECT_SOURCE_DIR}/dependencies/Maximilian/maximilian.cpp")
57
58
file(GLOB MAXI_SRC ${MAXI_SRC} "${PROJECT_SOURCE_DIR}/dependencies/Maximilian/libs/maxiFFT.cpp")
file(GLOB MAXI_SRC ${MAXI_SRC} "${PROJECT_SOURCE_DIR}/dependencies/Maximilian/libs/fft.cpp")
59

60
#PiPo
61
file(GLOB_RECURSE PIPO_SRC "${PROJECT_SOURCE_DIR}/dependencies/pipo/sdk/src/*")
62
63
64
65
66
67
file(GLOB_RECURSE PIPO_SRC ${PIPO_SRC} "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/bayesfilter/src/*")
file(GLOB_RECURSE PIPO_SRC ${PIPO_SRC} "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/collection/*")
file(GLOB_RECURSE PIPO_SRC ${PIPO_SRC} "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/finitedifferences/*")
file(GLOB_RECURSE PIPO_SRC ${PIPO_SRC} "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/rta/src/util/*")
file(GLOB_RECURSE PIPO_SRC ${PIPO_SRC} "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/rta/src/signal/*")
file(GLOB_RECURSE PIPO_SRC ${PIPO_SRC} "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/rta/src/statistics/*")
68
69
70
list(REMOVE_ITEM PIPO_SRC "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/rta/src/signal/rta_onepole.c")
list(REMOVE_ITEM PIPO_SRC "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/rta/src/signal/rta_resample.c")
list(REMOVE_ITEM PIPO_SRC "${PROJECT_SOURCE_DIR}/dependencies/pipo/modules/rta/src/statistics/rta_cca.c")
71
72

# RapidLib
73
74
file(GLOB RAPIDLIB_SRC "${PROJECT_SOURCE_DIR}/dependencies/RapidLib/src/*.cpp")
file(GLOB RAPIDLIB_DEP "${PROJECT_SOURCE_DIR}/dependencies/RapidLib/dependencies/libsvm/libsvm.cpp")
75

76
77
78
79
# XMM
file(GLOB_RECURSE XMM_SRC "${PROJECT_SOURCE_DIR}/dependencies/xmm/src/*")

file(GLOB JSON_SRC "${PROJECT_SOURCE_DIR}/dependencies/third_party/jsoncpp.cpp")
80

81
# Set the source for the main library, using the groups defined above
82
83
set(RAPIDMIX_FULL_SRC ${RAPIDMIX_SRC}
		      ${GVF_SRC}
84
		      ${MAXI_SRC}
Joseph Larralde's avatar
Joseph Larralde committed
85
		      ${PIPO_SRC}
86
		      ${RAPIDLIB_SRC}
87
		      ${RAPIDLIB_DEP}
88
		      ${XMM_SRC}
89
90
		      ${JSON_SRC}
		      )
91

Michael Zbyszyński's avatar
Michael Zbyszyński committed
92
add_library(RAPID-MIX_API SHARED ${RAPIDMIX_FULL_SRC})
93

94
add_executable(rapidmixTest tests/rapidMixTest.cpp )
95

96
97
98
add_executable(helloRapidMix ${PROJECT_SOURCE_DIR}/examples/HelloRapidMix/HelloRapidMix/main.cpp)


99
100
101
102
if (APPLE)
   find_library(ACCELERATE Accelerate)
   if (NOT ACCELERATE)
      message(FATAL_ERROR "Accelearate not found")
103
104
   endif()
   target_link_libraries(RAPID-MIX_API ${ACCELERATE})
105
endif()
106
107
108

target_link_libraries(rapidmixTest RAPID-MIX_API)
target_link_libraries(helloRapidMix RAPID-MIX_API)