1 | ######################################################################################################
|
---|
2 | # #
|
---|
3 | # __________ _________ #
|
---|
4 | # \______ \_____ ____ ______ __ __ ______/ _____/ ____ ____ _________________ ______ #
|
---|
5 | # | ___/\__ \ _/ ___\\____ \| | \/ ___/\_____ \_/ __ \ / \ / ___/ _ \_ __ \/ ___/ #
|
---|
6 | # | | / __ \\ \___| |_> > | /\___ \ / \ ___/| | \\___ ( <_> ) | \/\___ \ #
|
---|
7 | # |____| (____ /\___ > __/|____//____ >_______ /\___ >___| /____ >____/|__| /____ > #
|
---|
8 | # \/ \/|__| \/ \/ \/ \/ \/ \/ #
|
---|
9 | # #
|
---|
10 | ######################################################################################################
|
---|
11 |
|
---|
12 | project(PacpusSensors)
|
---|
13 | cmake_minimum_required(VERSION 2.8)
|
---|
14 | if(UNIX)
|
---|
15 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++0x -fpermissive") #c++11
|
---|
16 | endif()
|
---|
17 |
|
---|
18 | # ========================================
|
---|
19 | # PacpusSensors version
|
---|
20 | # ========================================
|
---|
21 | set(PacpusSensors_MAJOR_VERSION 0)
|
---|
22 | set(PacpusSensors_MINOR_VERSION 1)
|
---|
23 | set(PacpusSensors_PATCH_VERSION 1)
|
---|
24 | set(PacpusSensors_VERSION
|
---|
25 | "${PacpusSensors_MAJOR_VERSION}.${PacpusSensors_MINOR_VERSION}.${PacpusSensors_PATCH_VERSION}")
|
---|
26 |
|
---|
27 | # ========================================
|
---|
28 | # Configure CMake
|
---|
29 | # ========================================
|
---|
30 | if(NOT ${PACPUS_ROOT} STREQUAL "")
|
---|
31 | set(CMAKE_MODULE_PATH ${PACPUS_ROOT}/cmake)
|
---|
32 | string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
---|
33 | message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
|
---|
34 | elseif( NOT $ENV{PACPUS_ROOT} STREQUAL "")
|
---|
35 | set(PACPUS_ROOT $ENV{PACPUS_ROOT})
|
---|
36 | set(CMAKE_MODULE_PATH $ENV{PACPUS_ROOT}/cmake)
|
---|
37 | string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
---|
38 | message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
|
---|
39 | message (STATUS "PACPUS_ROOT is: " ${PACPUS_ROOT})
|
---|
40 | else()
|
---|
41 | message (FATAL_ERROR "Environment variable PACPUS_ROOT not set, please define it in your operating system or pass it as argument to the cmake command")
|
---|
42 | endif()
|
---|
43 |
|
---|
44 | include(${CMAKE_MODULE_PATH}/PacpusUtilities.cmake)
|
---|
45 | include(${CMAKE_MODULE_PATH}/PacpusConfiguration.cmake)
|
---|
46 | include(${CMAKE_MODULE_PATH}/PacpusDependencies.cmake)
|
---|
47 | include(${CMAKE_MODULE_PATH}/PacpusPlatforms.cmake)
|
---|
48 |
|
---|
49 | # ========================================
|
---|
50 | # Pre-configuration of the compiler
|
---|
51 | # ========================================
|
---|
52 | find_package(Pacpus REQUIRED)
|
---|
53 | # Includes directories
|
---|
54 | if(PACPUS_FOUND)
|
---|
55 | include_directories(
|
---|
56 | ${PACPUS_DEPENDENCIES_INC}
|
---|
57 | ${PACPUS_INCLUDE_DIR}
|
---|
58 | )
|
---|
59 | # Compiler flags coming from PacpusDependencies and PacpusPlatforms
|
---|
60 | add_definitions(${PACPUS_DEFINITIONS})
|
---|
61 | endif(PACPUS_FOUND)
|
---|
62 |
|
---|
63 |
|
---|
64 | # ========================================
|
---|
65 | # Build the ProjectExercise' modules
|
---|
66 | # ========================================
|
---|
67 | #
|
---|
68 | # In the following list add the plugin you want to build.
|
---|
69 | # Paths are relative to the root of the project.
|
---|
70 | #
|
---|
71 |
|
---|
72 | add_subdirectory(Alasca)
|
---|
73 | add_subdirectory(CanGateway) #require kvaser libcan
|
---|
74 | #add_subdirectory(PtGreyCameras)
|
---|
75 | #add_subdirectory(Dualshock)
|
---|
76 | add_subdirectory(NMEA0183)
|
---|
77 | add_subdirectory(Gps) #require NMEA0183
|
---|
78 | add_subdirectory(SpanCPTComponent) #require NMEA0183
|
---|
79 | add_subdirectory(Sick)
|
---|
80 | add_subdirectory(PacpusSocket)
|
---|
81 | #add_subdirectory(OpencvVideo)
|
---|
82 | #add_subdirectory(Wifibot) #depends on PacpusSocket, change PacpusSocket to PacpusUdpSocket
|
---|
83 | #add_subdirectory(Ladybug) #require Ladybug spherical camera's driver, not compiled yet
|
---|
84 | add_subdirectory(StdDbtPlayerComponents)
|
---|
85 | #add_subdirectory(TelnetClient)
|
---|
86 | add_subdirectory(VelodyneComponent)
|
---|
87 |
|
---|
88 | # ========================================
|
---|
89 | # Summary
|
---|
90 | # ========================================
|
---|
91 | pacpus_info("")
|
---|
92 | pacpus_info("=====================================================================")
|
---|
93 | pacpus_info("Configuration for PacpusSensors ${PacpusSensors_VERSION}")
|
---|
94 | pacpus_info("=====================================================================")
|
---|
95 | pacpus_info("")
|
---|
96 | pacpus_info(" Platform:")
|
---|
97 | pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
---|
98 | if(CMAKE_CROSS_COMPILING)
|
---|
99 | pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
|
---|
100 | endif()
|
---|
101 | pacpus_info(" CMake:" ${CMAKE_VERSION})
|
---|
102 | pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
|
---|
103 | pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
|
---|
104 | if(MSVC)
|
---|
105 | pacpus_info(" MSVC:" ${MSVC_VERSION})
|
---|
106 | else()
|
---|
107 | pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
|
---|
108 | endif()
|
---|
109 | pacpus_info("")
|
---|
110 | pacpus_info(" Compiler:")
|
---|
111 | pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
|
---|
112 | pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
|
---|
113 | pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
|
---|
114 | pacpus_info("")
|
---|
115 | pacpus_info(" Pacpus:")
|
---|
116 | pacpus_info(" PacpusFramework path:" ${PACPUS_ROOT})
|
---|
117 | pacpus_info(" Log4cxx logging enabled:" ${PACPUS_USE_LOG})
|
---|
118 | pacpus_info("")
|
---|
119 | if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
---|
120 | message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
|
---|
121 | endif()
|
---|
122 |
|
---|