source: pacpussensors/trunk/CMakeLists.txt@ 30

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

Update of the root CMakeLists.txt

File size: 5.7 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 1)
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
50include(${CMAKE_MODULE_PATH}/PacpusUtilities.cmake)
51include(${CMAKE_MODULE_PATH}/PacpusConfiguration.cmake)
52include(${CMAKE_MODULE_PATH}/PacpusDependencies.cmake)
53include(${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#add_subdirectory(Dualshock)
98#add_subdirectory(Wifibot)
99#add_subdirectory(PacpusSocket)
100#add_subdirectory(OpencvVideo)
101#add_subdirectory(ShMemInterface)
102
103# ========================================
104# Summary
105# ========================================
106pacpus_info("")
107pacpus_info("=====================================================================")
108pacpus_info("Configuration for PacpusSensors ${PacpusSensors_VERSION}")
109pacpus_info("=====================================================================")
110pacpus_info("")
111pacpus_info(" Platform:")
112pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
113if(CMAKE_CROSS_COMPILING)
114 pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
115endif()
116pacpus_info(" CMake:" ${CMAKE_VERSION})
117pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
118pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
119if(MSVC)
120 pacpus_info(" MSVC:" ${MSVC_VERSION})
121else()
122 pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
123endif()
124pacpus_info("")
125pacpus_info(" Compiler:")
126pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
127pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
128pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
129pacpus_info("")
130pacpus_info(" Pacpus:")
131pacpus_info(" PacpusFramework path:" ${PACPUS_ROOT})
132pacpus_info(" Log4cxx logging enabled:" ${PACPUS_USE_LOG})
133pacpus_info("")
134if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
135 message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
136endif()
Note: See TracBrowser for help on using the repository browser.