forked from aseba-community/aseba
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
90 lines (65 loc) · 2.21 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
89
90
# kate: replace-tabs off; tab-width 4; indent-width 4; tab-indents true; indent-mode normal
# vim: ts=4:sw=4:noexpandtab
cmake_minimum_required(VERSION 2.6)
project(aseba)
enable_testing()
include(ParseVersion.cmake)
add_definitions(-Wall)
add_definitions(-DASEBA_ASSERT)
# Dashel
find_path(DASHEL_INCLUDE_DIR dashel/dashel.h CMAKE_FIND_ROOT_PATH_BOTH)
find_library(DASHEL_LIBRARY dashel CMAKE_FIND_ROOT_PATH_BOTH)
include_directories(${DASHEL_INCLUDE_DIR})
set(EXTRA_LIBS ${DASHEL_LIBRARY})
# libudev
find_path(UDEV_INCLUDE_DIR libudev.h)
find_library(UDEV_LIBS udev)
if (UDEV_INCLUDE_DIR AND UDEV_LIBS)
message(STATUS "libudev found")
set(UDEV_FOUND 1)
endif (UDEV_INCLUDE_DIR AND UDEV_LIBS)
# Dashel dependencies
if (WIN32)
set(EXTRA_LIBS ${EXTRA_LIBS} winspool ws2_32 setupapi)
else (WIN32)
if (APPLE)
find_library(COREFOUNDATION_LIBRARY CoreFoundation)
find_library(IOKIT_LIBRARY IOKit)
mark_as_advanced(COREFOUNDATION_LIBRARY)
mark_as_advanced(IOKIT_LIBRARY)
set(EXTRA_LIBS ${EXTRA_LIBS} ${COREFOUNDATION_LIBRARY} ${IOKIT_LIBRARY} ${EXTRA_LIBS})
else (APPLE)
if (UDEV_FOUND)
include_directories(${UDEV_INCLUDE_DIR})
set(EXTRA_LIBS ${EXTRA_LIBS} ${UDEV_LIBS} ${EXTRA_LIBS})
else (UDEV_FOUND)
find_package(PkgConfig)
pkg_check_modules(HAL hal)
if (${HAL_FOUND})
include_directories(${HAL_INCLUDE_DIRS})
set(EXTRA_LIBS ${EXTRA_LIBS} ${HAL_LIBRARIES} ${EXTRA_LIBS})
endif (${HAL_FOUND})
endif (UDEV_FOUND)
endif (APPLE)
endif (WIN32)
# Enki
find_path(ENKI_INCLUDE_DIR enki/PhysicalEngine.h)
find_library(ENKI_LIBRARY enki)
find_library(ENKI_VIEWER_LIBRARY enkiviewer)
if (ENKI_INCLUDE_DIR AND ENKI_LIBRARY AND ENKI_VIEWER_LIBRARY)
set(ENKI_FOUND 1)
message(STATUS "Enki found")
else (ENKI_INCLUDE_DIR AND ENKI_LIBRARY AND ENKI_VIEWER_LIBRARY)
message(STATUS "Enki *not* found, simulation targets disabled")
endif (ENKI_INCLUDE_DIR AND ENKI_LIBRARY AND ENKI_VIEWER_LIBRARY)
# Aseba itself
add_subdirectory(common)
add_subdirectory(transport)
set(ASEBA_CORE_LIBRARIES asebadashelplugins asebacommon ${EXTRA_LIBS})
add_subdirectory(switches)
add_subdirectory(vm)
add_subdirectory(compiler)
add_subdirectory(clients)
add_subdirectory(targets)
add_subdirectory(examples)
add_subdirectory(tests)