source: pacpusframework/trunk/CMakeLists.txt@ 26

Last change on this file since 26 was 26, checked in by sgosseli, 11 years ago

Add the generation of the documentation in the build system.
To build the documentation on Windows:

cmake .. -DPACPUS_INSTALL_DIR=C:\Foo -DPACPUS_BUILD_DOC=TRUE
msbuild doc\documentation.vcxproj
msbuild INSTALL.vcxproj /p:Configuration=Release

Note: doxygen is required, of course.

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