source: pacpusframework/branches/0.1.x/CMakeLists.txt@ 362

Last change on this file since 362 was 336, checked in by phudelai, 10 years ago

CMakeLists.txt and PacpusSensor's comment updated

  • Property svn:executable set to *
File size: 5.0 KB
RevLine 
[89]1#################################################
2# ___________ ____ ______ __ __ _____ #
3# \____ \__ \ _/ ___\\____ \| | \/ ___/ #
4# | |_> > __ \\ \___| |_> > | /\___ \ #
5# | __(____ /\___ > __/|____//____ > #
6# |__| \/ \/|__| \/ #
7# #
8#################################################
9
10project(Pacpus)
11cmake_minimum_required(VERSION 2.8)
[124]12
[128]13if(POLICY CMP0020)
14 cmake_policy(SET CMP0020 NEW) # for QT5.1 on windows / not work on linux
15endif()
[124]16
[89]17# ========================================
18# Pacpus version
19# ========================================
20set(PACPUS_MAJOR_VERSION 0)
21set(PACPUS_MINOR_VERSION 1)
[307]22set(PACPUS_PATCH_VERSION 1)
[89]23set(PACPUS_VERSION
24 "${PACPUS_MAJOR_VERSION}.${PACPUS_MINOR_VERSION}.${PACPUS_PATCH_VERSION}")
25
26# ========================================
27# CMake variables
28# ========================================
29set(PACPUS_ROOT_DIR ${CMAKE_SOURCE_DIR})
30set(PACPUS_3RD_PARTY_DIR ${PACPUS_ROOT_DIR}/3rd)
31set(PACPUS_CMAKE_DIR ${PACPUS_ROOT_DIR}/cmake)
32set(PACPUS_DOC_DIR ${PACPUS_ROOT_DIR}/doc)
[333]33set(PACPUS_INCLUDE_DIR ${PACPUS_ROOT_DIR}/include/)
[89]34set(PACPUS_SCRIPTS_DIR ${PACPUS_ROOT_DIR}/scripts)
35set(PACPUS_SOURCE_DIR ${PACPUS_ROOT_DIR}/src)
36set(IS_BUILDING_PACPUS TRUE)
37
38# ========================================
39# Configure CMake
40# ========================================
41list(APPEND CMAKE_MODULE_PATH ${PACPUS_CMAKE_DIR})
42
43# ========================================
44# Import some functions
45# ========================================
46include(${PACPUS_CMAKE_DIR}/PacpusUtilities.cmake)
47
48# ========================================
49# Configure Pacpus
50# ========================================
51include(${PACPUS_CMAKE_DIR}/PacpusConfiguration.cmake)
52
53# ========================================
54# Find dependencies
55# ========================================
56include(${PACPUS_CMAKE_DIR}/PacpusDependencies.cmake)
57
58# ========================================
[140]59# Handle platform-specific behaviour
[89]60# ========================================
61include(${PACPUS_CMAKE_DIR}/PacpusPlatforms.cmake)
62
63# ========================================
[140]64# Compiler flags coming from PacpusDependencies and PacpusPlatforms
65# ========================================
66#message(STATUS "\${PACPUS_DEFINITIONS} = ${PACPUS_DEFINITIONS}")
67add_definitions(${PACPUS_DEFINITIONS})
68
69# ========================================
[89]70# Pre-configuration of the compiler
71# ========================================
72# Includes directories
73include_directories(
[140]74 ${PACPUS_DEPENDENCIES_INC}
75 ${PACPUS_INCLUDE_DIR}
[89]76)
77
78# ========================================
79# Build the Pacpus' modules
80# ========================================
81add_subdirectory(${PACPUS_SOURCE_DIR})
[163]82if(PACPUS_BUILD_EXAMPLES)
83 add_subdirectory(examples)
84endif()
[89]85
86# ========================================
87# Build the documentation if enabled
88# ========================================
89if(PACPUS_BUILD_DOC)
90 add_subdirectory(${PACPUS_DOC_DIR})
91endif()
92
93# ========================================
94# Pacpus Installation
95# ========================================
96include(${PACPUS_CMAKE_DIR}/PacpusInstall.cmake)
[336]97set(ENV{PACPUS_ROOT} ${PACPUS_INSTALL_DIR})
[89]98
99# ========================================
100# Summary
101# ========================================
102pacpus_info("")
103pacpus_info("=====================================================================")
104pacpus_info("Configuration for Pacpus ${PACPUS_VERSION}")
105pacpus_info("=====================================================================")
106pacpus_info("")
107pacpus_info(" Platform:")
108pacpus_info(" Host:" ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_HOST_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR})
109if(CMAKE_CROSS_COMPILING)
110 pacpus_info(" Target:" ${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_SYSTEM_PROCESSOR})
111endif()
112pacpus_info(" CMake:" ${CMAKE_VERSION})
113pacpus_info(" CMake generator:" ${CMAKE_GENERATOR})
114pacpus_info(" CMake build tool:" ${CMAKE_BUILD_TOOL})
115if(MSVC)
116 pacpus_info(" MSVC:" ${MSVC_VERSION})
117else()
118 pacpus_info(" Configuration:" ${CMAKE_BUILD_TYPE})
119endif()
120pacpus_info("")
121pacpus_info(" Compiler:")
122pacpus_info(" C++ Compiler:" ${CMAKE_CXX_COMPILER})
123pacpus_info(" C++ flags (release):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_RELEASE})
124pacpus_info(" C++ flags (debug):" ${CMAKE_CXX_FLAGS} ${CMAKE_CXX_FLAGS_DEBUG})
125pacpus_info("")
126pacpus_info(" Result:")
127pacpus_info(" Install directory:" ${PACPUS_INSTALL_DIR})
[162]128pacpus_info(" Install with version number:" ${PACPUS_INSTALL_WITH_VERSION_NUMBER})
[89]129pacpus_info("")
130pacpus_info(" Options:")
131pacpus_info(" Logging enabled:" ${PACPUS_USE_LOG})
132pacpus_info(" Installation of 3rd party:" ${PACPUS_INSTALL_3RD})
133pacpus_info(" Documentation enabled:" ${PACPUS_BUILD_DOC})
134pacpus_info("")
135if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_CURRENT_BINARY_DIR}")
[162]136 message(WARNING "The source directory is the same as build directory. \"make clean\" may damage the source tree")
[89]137endif()
Note: See TracBrowser for help on using the repository browser.