source: pacpusframework/trunk/CMakeLists.txt@ 256

Last change on this file since 256 was 250, checked in by Marek Kurdej, 11 years ago

Update: version augmented to 0.2.0.

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