source: pacpustutorials/template/project_template/CMakeLists.txt@ 1

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

add first tutorials exercises

File size: 4.2 KB
Line 
1######################################################################################################
2#
3# created: 2015/09/18
4# filename: CMakeLists.txt
5#
6# author: Gerald Dherbomez
7# Copyright Heudiasyc (c) UMR UTC/CNRS 7253
8#
9# license: CECILL-C
10#
11# version: $Id: $
12#
13# brief: Pacpus project template
14#
15######################################################################################################
16
17project(ProjectTemplate)
18cmake_minimum_required(VERSION 2.8)
19
20# ========================================
21# ProjectTemplate version
22# ========================================
23set(ProjectTemplate_MAJOR_VERSION 0)
24set(ProjectTemplate_MINOR_VERSION 0)
25set(ProjectTemplate_PATCH_VERSION 1)
26set(ProjectTemplate_VERSION
27 "${ProjectTemplate_MAJOR_VERSION}.${ProjectTemplate_MINOR_VERSION}.${ProjectTemplate_PATCH_VERSION}")
28
29# ========================================
30# Configure CMake
31# ========================================
32if(NOT ${PACPUS_ROOT} STREQUAL "")
33 set(CMAKE_MODULE_PATH ${PACPUS_ROOT}/cmake)
34 string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
35 message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
36elseif( NOT $ENV{PACPUS_ROOT} STREQUAL "")
37 set(PACPUS_ROOT $ENV{PACPUS_ROOT})
38 set(CMAKE_MODULE_PATH $ENV{PACPUS_ROOT}/cmake)
39 string (REPLACE "\\" "/" CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH})
40 message (STATUS "setting CMAKE_MODULE_PATH to: " ${CMAKE_MODULE_PATH})
41 message (STATUS "PACPUS_ROOT is: " ${PACPUS_ROOT})
42else()
43 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")
44endif()
45
46include(${CMAKE_MODULE_PATH}/PacpusUtilities.cmake)
47include(${CMAKE_MODULE_PATH}/PacpusConfiguration.cmake)
48include(${CMAKE_MODULE_PATH}/PacpusDependencies.cmake)
49include(${CMAKE_MODULE_PATH}/PacpusPlatforms.cmake)
50
51# ========================================
52# Pre-configuration of the compiler
53# ========================================
54find_package(Pacpus REQUIRED)
55# Includes directories
56if(PACPUS_FOUND)
57include_directories(
58 ${PACPUS_DEPENDENCIES_INC}
59 ${PACPUS_INCLUDE_DIR}
60)
61# Compiler flags coming from PacpusDependencies and PacpusPlatforms
62add_definitions(${PACPUS_DEFINITIONS})
63endif(PACPUS_FOUND)
64
65
66# ========================================
67# Build the ProjectTemplate' modules
68# ========================================
69#
70# In the following list add the plugin you want to build.
71# Paths are relative to the root of the project.
72#
73# add_subdirectory(plugin_A)
74# add_subdirectory(plugin_B)
75
76# ========================================
77# Summary
78# ========================================
79pacpus_info("")
80pacpus_info("=====================================================================")
81pacpus_info("Configuration for ProjectTemplate ${ProjectTemplate_VERSION}")
82pacpus_info("=====================================================================")
83pacpus_info("")
84pacpus_info(" Platform:")
85pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
86if(CMAKE_CROSS_COMPILING)
87 pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
88endif()
89pacpus_info(" CMake:" ${CMAKE_VERSION})
90pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
91pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
92if(MSVC)
93 pacpus_info(" MSVC:" ${MSVC_VERSION})
94else()
95 pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
96endif()
97pacpus_info("")
98pacpus_info(" Compiler:")
99pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
100pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
101pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
102pacpus_info("")
103pacpus_info(" Pacpus:")
104pacpus_info(" PacpusFramework path:" ${PACPUS_ROOT})
105pacpus_info(" Log4cxx logging enabled:" ${PACPUS_USE_LOG})
106pacpus_info("")
107if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
108 message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
109endif()
110
Note: See TracBrowser for help on using the repository browser.