-
Notifications
You must be signed in to change notification settings - Fork 40
/
CMakeLists.txt
115 lines (98 loc) · 3.83 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
##======================================================================## PIXHAWK Micro Air Vehicle Flying Robotics Toolkit# Please see our website at <http://pixhawk.ethz.ch># ## Original Authors:# @author Reto Grieder <www.orxonox.net># @author Fabian Landau <www.orxonox.net># Contributing Authors (in alphabetical order):# # Todo:### (c) 2009 PIXHAWK PROJECT <http://pixhawk.ethz.ch># # This file is part of the PIXHAWK project# # PIXHAWK is free software: you can redistribute it and/or modify# it under the terms of the GNU General Public License as published by# the Free Software Foundation, either version 3 of the License, or# (at your option) any later version.# # PIXHAWK is distributed in the hope that it will be useful,# but WITHOUT ANY WARRANTY; without even the implied warranty of# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the# GNU General Public License for more details.# # You should have received a copy of the GNU General Public License# along with PIXHAWK. If not, see <http://www.gnu.org/licenses/>.# ##========================================================================
CMAKE_MINIMUM_REQUIRED(VERSION 2.6 FATAL_ERROR)
# Keep devs from using the root directory as binary directory (messes up the source tree)
IF(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
MESSAGE(FATAL_ERROR "Please do not use the root directory as CMake output directory!
mkdir build; cd build; cmake ..
And you will have to clean the source directory by deleting CMakeCache.txt and the folder CMakeFiles")
ENDIF()
PROJECT(Pixhawk C CXX)
# If this is set to true, CMake shows the compiler and linker commands
#SET(CMAKE_VERBOSE_MAKEFILE true)
# This sets where to look for modules (e.g. "Find*.cmake" files)
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake)
# Library finding
INCLUDE(LibraryConfig)
# General build and compiler options and configurations
INCLUDE(BuildConfig)
# PRINT macro
MACRO(PRINT)
MESSAGE(STATUS ${ARGN})
ENDMACRO(PRINT)
# Create the actual project
ADD_SUBDIRECTORY(src)
# Configure the binary output directory. Do this after src!
ADD_SUBDIRECTORY(cmake/bin)
# Configure the media file directory
ADD_SUBDIRECTORY(cmake/media)
# Configure the config file directory
ADD_SUBDIRECTORY(cmake/config)
# Last but not least: Try to make doxygen target
ADD_SUBDIRECTORY(cmake/doc)
# Output
SET(_output_blanks " ")
MESSAGE(STATUS "")
MESSAGE(STATUS "---------------------------------------------------")
MESSAGE(STATUS "Executable: Build: Condition:")
MESSAGE(STATUS "---------------------------------------------------")
FOREACH(_name ${__executables})
STRING(TOUPPER ${_name} _name_upper)
STRING(LENGTH ${_name} _name_length)
MATH(EXPR _name_length "30 - ${_name_length}")
STRING(SUBSTRING ${_output_blanks} 0 ${_name_length} _blanks)
IF (NOT ${_name_upper}_BUILD)
SET(_condition ${${_name_upper}_CONDITION})
ELSE ()
SET(_condition " (satisfied)")
ENDIF ()
MESSAGE(STATUS "${_name}${_blanks}${${_name_upper}_BUILD} ${_condition}")
ENDFOREACH(_name)
MESSAGE(STATUS "")
MESSAGE(STATUS "---------------------------------------------------")
MESSAGE(STATUS "Library: Build: Condition:")
MESSAGE(STATUS "---------------------------------------------------")
FOREACH(_name ${__libraries})
STRING(TOUPPER ${_name} _name_upper)
STRING(TOUPPER ${_name} _name_upper)
STRING(LENGTH ${_name} _name_length)
MATH(EXPR _name_length "30 - ${_name_length}")
STRING(SUBSTRING ${_output_blanks} 0 ${_name_length} _blanks)
IF (NOT ${_name_upper}_BUILD)
SET(_condition ${${_name_upper}_CONDITION})
ELSE ()
SET(_condition " (satisfied)")
ENDIF ()
MESSAGE(STATUS "${_name}${_blanks}${${_name_upper}_BUILD} ${_condition}")
ENDFOREACH(_name)
MESSAGE(STATUS "")