source: pacpussensors/trunk/CMakeLists.txt@ 16

Last change on this file since 16 was 16, checked in by DHERBOMEZ Gérald, 11 years ago

add standards replay components for some sensors that has to be used with DBITEPlayer application: StdDbtPlayerComponents

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