-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathCMakeLists.txt
123 lines (87 loc) · 4.69 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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
######################################################################################
## ##
## AUTHOR : Aby Louw ##
## DATE : 7 June 2010 ##
## ##
######################################################################################
## ##
## Main CMakeList for Speect ##
## ##
## ##
######################################################################################
#------------------------------------------------------------------------------------#
# Build directory check #
#------------------------------------------------------------------------------------#
if(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
message(FATAL_ERROR "Speect cannot be build in the source directory. See the INSTALL file for more information.")
endif(${CMAKE_CURRENT_SOURCE_DIR} STREQUAL ${CMAKE_CURRENT_BINARY_DIR})
#------------------------------------------------------------------------------------#
# Build type #
#------------------------------------------------------------------------------------#
#if(NOT CMAKE_BUILD_TYPE)
# set(CMAKE_BUILD_TYPE Debug CACHE STRING # set(CMAKE_BUILD_TYPE RelWithDebInfo CACHE STRING
# "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel Profile."
# FORCE)
#endif()
# Restrict configuration types to the selected build type.
# Note: This needs to be done before the project command
#set(CMAKE_CONFIGURATION_TYPES "${CMAKE_BUILD_TYPE}" CACHE INTERNAL "internal")
#------------------------------------------------------------------------------------#
# Project name #
#------------------------------------------------------------------------------------#
message(STATUS "cmake for project \"Speect\"")
project(speect C)
set(CMAKE_SPEECT_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
set(CMAKE_SPEECT_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
#------------------------------------------------------------------------------------#
# CMake minimum version #
#------------------------------------------------------------------------------------#
cmake_minimum_required(VERSION 2.8 FATAL_ERROR)
#------------------------------------------------------------------------------------#
# Get all CMake modules #
#------------------------------------------------------------------------------------#
list(APPEND CMAKE_MODULE_PATH ${CMAKE_SPEECT_SOURCE_DIR}/cmake)
# CMake compatibility functions
include(cmakeCompat)
#------------------------------------------------------------------------------------#
# Top level system checks and options #
#------------------------------------------------------------------------------------#
# Custom CMake functions
include(spctFunctions)
# Version information
include(spctVersion)
# Build options
include(spctOptions)
# System tests/checks
include(spctSystem)
# Compiler options/tests
include(spctCompilers)
# Operating system checks
include(spctOS)
# Build options
include(spctBuild)
# Speect settings
include(spctSettings)
# "dist" target for make
include(spctArchive)
#------------------------------------------------------------------------------------#
# Include subdirectories #
#------------------------------------------------------------------------------------#
# Speect Engine
add_subdirectory(engine)
# Speect Plug-ins
if(SPCT_ADD_PLUGINS) # controlled by NO_PLUGINS in speect/cmake/spctSettings.cmake
add_subdirectory(plugins)
endif(SPCT_ADD_PLUGINS)
# Speect SWIG interface
if(NOT NO_SWIG)
add_subdirectory(swig)
endif(NOT NO_SWIG)
# Speect documentation, see docs/CMakeLists.txt for generation of documentation.
# Not included in general build as doc generating software and versions are
# too specific and fragile.
if(WANT_DOCS)
add_subdirectory(docs)
endif(WANT_DOCS)
enable_testing()
add_subdirectory(tests)