source: pacpussensors/trunk/CMakeLists.txt@ 1

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

ajout des capteurs CanGateway et Alasca

File size: 5.0 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)
31
32# ========================================
33# Configure CMake
34# ========================================
35if(PACPUS_ROOT)
36 set(CMAKE_MODULE_PATH ${PACPUS_ROOT}/cmake)
37 string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
38 message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
39elseif( NOT $ENV{PACPUS_ROOT} STREQUAL "")
40 set(CMAKE_MODULE_PATH $ENV{PACPUS_ROOT}/cmake)
41 string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
42 message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
43else()
44 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")
45endif()
46
47
48# ========================================
49# Pre-configuration of the compiler
50# ========================================
51find_package(Pacpus REQUIRED)
52# Includes directories
53if(PACPUS_FOUND)
54include_directories(
55 ${PACPUS_DEPENDENCIES_INC}
56 ${PACPUS_INCLUDE_DIR}
57)
58# Compiler flags coming from PacpusDependencies and PacpusPlatforms
59add_definitions(${PACPUS_DEFINITIONS})
60endif(PACPUS_FOUND)
61
62
63# ========================================
64# Find dependencies
65# ========================================
66find_package(Qt4 REQUIRED)
67if(QT4_FOUND)
68 set(QT_USE_QTNETWORK TRUE)
69 set(QT_USE_QTOPENGL TRUE)
70 set(QT_USE_QTXML TRUE)
71 include(${QT_USE_FILE})
72 add_definitions( ${QT_DEFINITIONS} )
73 add_definitions( -DQT_PLUGIN )
74endif(QT4_FOUND)
75
76
77# ========================================
78# Build the PacpusSensors' modules
79# ========================================
80add_subdirectory(Alasca)
81add_subdirectory(CanGateway)
82
83# ========================================
84# Summary
85# ========================================
86pacpus_info("")
87pacpus_info("=====================================================================")
88pacpus_info("Configuration for PacpusSensors ${PacpusSensors_VERSION}")
89pacpus_info("=====================================================================")
90pacpus_info("")
91pacpus_info(" Platform:")
92pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
93if(CMAKE_CROSS_COMPILING)
94 pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
95endif()
96pacpus_info(" CMake:" ${CMAKE_VERSION})
97pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
98pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
99if(MSVC)
100 pacpus_info(" MSVC:" ${MSVC_VERSION})
101else()
102 pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
103endif()
104pacpus_info("")
105pacpus_info(" Compiler:")
106pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
107pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
108pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
109pacpus_info("")
110pacpus_info(" Pacpus:")
111pacpus_info(" PacpusFramework path:" ${PACPUS_ROOT})
112pacpus_info(" Log4cxx logging enabled:" ${PACPUS_USE_LOG})
113pacpus_info("")
114if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
115 message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
116endif()
Note: See TracBrowser for help on using the repository browser.