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