1 | ######################################################################################################
|
---|
2 | # #
|
---|
3 | # __________ _________ #
|
---|
4 | # \______ \_____ ____ ______ __ __ ______/ _____/ ____ ____ _________________ ______ #
|
---|
5 | # | ___/\__ \ _/ ___\\____ \| | \/ ___/\_____ \_/ __ \ / \ / ___/ _ \_ __ \/ ___/ #
|
---|
6 | # | | / __ \\ \___| |_> > | /\___ \ / \ ___/| | \\___ ( <_> ) | \/\___ \ #
|
---|
7 | # |____| (____ /\___ > __/|____//____ >_______ /\___ >___| /____ >____/|__| /____ > #
|
---|
8 | # \/ \/|__| \/ \/ \/ \/ \/ \/ #
|
---|
9 | # #
|
---|
10 | ######################################################################################################
|
---|
11 |
|
---|
12 | project(PacpusSensors)
|
---|
13 | cmake_minimum_required(VERSION 2.8)
|
---|
14 |
|
---|
15 | # ========================================
|
---|
16 | # PacpusSensors version
|
---|
17 | # ========================================
|
---|
18 | set(PacpusSensors_MAJOR_VERSION 0)
|
---|
19 | set(PacpusSensors_MINOR_VERSION 1)
|
---|
20 | set(PacpusSensors_PATCH_VERSION 1)
|
---|
21 | set(PacpusSensors_VERSION
|
---|
22 | "${PacpusSensors_MAJOR_VERSION}.${PacpusSensors_MINOR_VERSION}.${PacpusSensors_PATCH_VERSION}")
|
---|
23 |
|
---|
24 | # ========================================
|
---|
25 | # Configure CMake
|
---|
26 | # ========================================
|
---|
27 | if(NOT ${PACPUS_ROOT} STREQUAL "")
|
---|
28 | set(CMAKE_MODULE_PATH ${PACPUS_ROOT}/cmake)
|
---|
29 | string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
---|
30 | message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
|
---|
31 | elseif( NOT $ENV{PACPUS_ROOT} STREQUAL "")
|
---|
32 | set(PACPUS_ROOT $ENV{PACPUS_ROOT})
|
---|
33 | set(CMAKE_MODULE_PATH $ENV{PACPUS_ROOT}/cmake)
|
---|
34 | string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
|
---|
35 | message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
|
---|
36 | message (STATUS "PACPUS_ROOT is: " ${PACPUS_ROOT})
|
---|
37 | else()
|
---|
38 | 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")
|
---|
39 | endif()
|
---|
40 |
|
---|
41 | include(${CMAKE_MODULE_PATH}/PacpusUtilities.cmake)
|
---|
42 | include(${CMAKE_MODULE_PATH}/PacpusConfiguration.cmake)
|
---|
43 | include(${CMAKE_MODULE_PATH}/PacpusDependencies.cmake)
|
---|
44 | include(${CMAKE_MODULE_PATH}/PacpusPlatforms.cmake)
|
---|
45 |
|
---|
46 | # ========================================
|
---|
47 | # Pre-configuration of the compiler
|
---|
48 | # ========================================
|
---|
49 | find_package(Pacpus REQUIRED)
|
---|
50 | # Includes directories
|
---|
51 | if(PACPUS_FOUND)
|
---|
52 | include_directories(
|
---|
53 | ${PACPUS_DEPENDENCIES_INC}
|
---|
54 | ${PACPUS_INCLUDE_DIR}
|
---|
55 | )
|
---|
56 | # Compiler flags coming from PacpusDependencies and PacpusPlatforms
|
---|
57 | add_definitions(${PACPUS_DEFINITIONS})
|
---|
58 | endif(PACPUS_FOUND)
|
---|
59 |
|
---|
60 |
|
---|
61 | # ========================================
|
---|
62 | # Find dependencies
|
---|
63 | # ========================================
|
---|
64 | find_package(Qt4 REQUIRED)
|
---|
65 | if(QT4_FOUND)
|
---|
66 | set(QT_USE_QTNETWORK TRUE)
|
---|
67 | set(QT_USE_QTOPENGL TRUE)
|
---|
68 | set(QT_USE_QTXML TRUE)
|
---|
69 | include(${QT_USE_FILE})
|
---|
70 | add_definitions( ${QT_DEFINITIONS} )
|
---|
71 | add_definitions( -DQT_PLUGIN )
|
---|
72 | endif(QT4_FOUND)
|
---|
73 |
|
---|
74 | include_directories(
|
---|
75 | ${PACPUS_DEPENDENCIES_INC}
|
---|
76 | ${PACPUS_INCLUDE_DIR}
|
---|
77 | ${PACPUS_INCLUDE_HINT}
|
---|
78 | ${PACPUS_INCLUDE_HINT}/Pacpus
|
---|
79 | ./PACPUS/include
|
---|
80 | )
|
---|
81 |
|
---|
82 | # ========================================
|
---|
83 | # Build the PacpusSensors' modules
|
---|
84 | # ========================================
|
---|
85 | # add_subdirectory(Alasca)
|
---|
86 | #add_subdirectory(CanGateway)
|
---|
87 | #add_subdirectory(PtGreyCameras)
|
---|
88 | # add_subdirectory(Dualshock)
|
---|
89 | # add_subdirectory(PacpusSocket)
|
---|
90 | #add_subdirectory(Sick)
|
---|
91 | #add_subdirectory(StereoVisionDisparity)
|
---|
92 | #add_subdirectory(SensorsApplication)
|
---|
93 | add_subdirectory(StdDbtPlayerComponents)
|
---|
94 | # add_subdirectory(Wifibot)
|
---|
95 | #add_subdirectory(Gps)
|
---|
96 | #add_subdirectory(OpencvVideo)
|
---|
97 | #add_subdirectory(SpanCPTComponent)
|
---|
98 | #add_subdirectory(NMEA0183)
|
---|
99 | #add_subdirectory(VelodyneComponent)
|
---|
100 | # ========================================
|
---|
101 | # Summary
|
---|
102 | # ========================================
|
---|
103 | pacpus_info("")
|
---|
104 | pacpus_info("=====================================================================")
|
---|
105 | pacpus_info("Configuration for PacpusSensors ${PacpusSensors_VERSION}")
|
---|
106 | pacpus_info("=====================================================================")
|
---|
107 | pacpus_info("")
|
---|
108 | pacpus_info(" Platform:")
|
---|
109 | pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
|
---|
110 | if(CMAKE_CROSS_COMPILING)
|
---|
111 | pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
|
---|
112 | endif()
|
---|
113 | pacpus_info(" CMake:" ${CMAKE_VERSION})
|
---|
114 | pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
|
---|
115 | pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
|
---|
116 | if(MSVC)
|
---|
117 | pacpus_info(" MSVC:" ${MSVC_VERSION})
|
---|
118 | else()
|
---|
119 | pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
|
---|
120 | endif()
|
---|
121 | pacpus_info("")
|
---|
122 | pacpus_info(" Compiler:")
|
---|
123 | pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
|
---|
124 | pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
|
---|
125 | pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
|
---|
126 | pacpus_info("")
|
---|
127 | pacpus_info(" Pacpus:")
|
---|
128 | pacpus_info(" PacpusFramework path:" ${PACPUS_ROOT})
|
---|
129 | pacpus_info(" Log4cxx logging enabled:" ${PACPUS_USE_LOG})
|
---|
130 | pacpus_info("")
|
---|
131 | if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
|
---|
132 | message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
|
---|
133 | endif()
|
---|