forked from fawques/behaviours
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
88 lines (69 loc) · 4.12 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
86
87
88
cmake_minimum_required (VERSION 2.8)
cmake_policy(VERSION 2.8)
project(behaviours)
if (${ARM})
message(STATUS "Compiling for ARM")
SET(EXTRALIBS pthread)
SET(INCLUDEDIR ${CMAKE_FIND_ROOT_PATH}/usr/include)
SET(INCLUDEMULTIARCH ${CMAKE_FIND_ROOT_PATH}/usr/include/arm-linux-gnueabihf)
SET(LIBPATH ${CMAKE_FIND_ROOT_PATH}/usr/lib)
SET(CMAKE_INCLUDE_PATH ${CMAKE_FIND_ROOT_PATH}/usr/include)
find_path(ONION_HEADERS onion/log.h ${INCLUDEDIR} ${CMAKE_FIND_ROOT_PATH}/usr/local/include)
message(STATUS "ONION: ${ONION_HEADERS}")
else (${ARM})
SET(EXTRALIBS pthread)
SET(INCLUDEDIR /usr/include)
SET(LIBPATH /usr/lib /usr/local/lib /usr/share/lintian/overrides/ /usr/share/doc/ /usr/lib/python2.7/config/ )
endif (${ARM})
#SET(USE_ACAPELLA true)
SET(ONION_LIBS onioncpp onion_handlers_static onion_static)
SET(OPENCV_LIBS opencv_legacy opencv_ml opencv_core opencv_imgproc opencv_features2d opencv_calib3d opencv_highgui opencv_video opencv_flann opencv_objdetect)
find_library(ONIONCPP_LIB NAMES onioncpp PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
message(STATUS "LIBPATH PYTHON2 <${CMAKE_FIND_ROOT_PATH}> and <${LIBPATH}>")
find_library(ONIONHANDLERS_STATIC_LIB NAMES onion_handlers_static PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf /usr/local/lib /usr/lib)
find_library(ONION_STATIC_LIB NAMES onion_static PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf /usr/local/lib /usr/lib)
find_library(CURL_LIB NAMES curl PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
find_library(GNUTLS_LIB NAMES gnutls PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
find_library(GCRYPT_LIB NAMES gcrypt PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
find_library(Z_LIB NAMES z PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
find_library(JSON_LIB NAMES json-c json PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf /usr/share/doc/libjson0 /usr/lib /usr/lib/i386-linux-gnu )
find_library(XML2_LIB NAMES xml2 PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
message("-- Search for XML2 headers")
find_path(XML2_HEADERS libxml/xmlwriter.h ${INCLUDEDIR}/libxml2)
message("-- Search for LUA headers")
find_path(LUA_HEADERS lua.h ${INCLUDEDIR}/lua5.2)
message("-- Search for LUA lib")
include_directories(${LUA_HEADERS})
if (${ARM})
SET(LUA_LIB lua)
else (${ARM})
find_library(LUA_LIB NAMES lua5.2 lua liblua PATHS ${LIBPATH} ${LIBPATH}/arm-linux-gnueabihf ${CMAKE_FIND_ROOT_PATH}/lib ${CMAKE_FIND_ROOT_PATH}/lib/arm-linux-gnueabihf)
endif (${ARM})
find_library(JSON NAMES json)
##
if (${ARM})
include_directories (${AISOY1API_BUILD}/../include/)
include_directories (${AISOY1API_BUILD}/../src/real/)
endif(${ARM})
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/lib)
IF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_definitions(-D__DEBUG__)
SET(CMAKE_CXX_FLAGS "-Wall -Werror -O0 -g -fPIC -std=c++0x")
MESSAGE(STATUS "Using debug mode")
ELSE (${CMAKE_BUILD_TYPE} MATCHES "Debug")
SET(CMAKE_CXX_FLAGS "-Wall -Werror -O0 -fPIC -std=c++0x")
ENDIF (${CMAKE_BUILD_TYPE} MATCHES "Debug")
add_definitions(-DAB_PREFIX=\"${CMAKE_INSTALL_PREFIX}\")
find_library(LIBAISOY1 NAMES aisoy1 PATH /usr/lib /usr/local/lib )
add_subdirectory(lib)
add_subdirectory(plugins)
add_subdirectory(server)
add_subdirectory(ab)
#add_subdirectory(test)
# uninstall target
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in"
"${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake"
IMMEDIATE @ONLY)
add_custom_target(uninstall
COMMAND ${CMAKE_COMMAND} -P ${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake)