forked from LimitPointSystems/SheafSystemTest
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
123 lines (105 loc) · 3.96 KB
/
CMakeLists.txt
File metadata and controls
123 lines (105 loc) · 3.96 KB
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
123
#
# Copyright (c) 2014 Limit Point Systems, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Information omitted from CMake documentation and discussion regarding CTest and CDash:
#
# 1. CTestConfig.cmake must be in the top level of your project.
#
# 1.1 DROP_SITE value must be a FQDN sans "http://". Numerical IP will not work!
#
# 1.2 If the system is multi-component, then the vars in CTestConfig.cmake
# must be cached so they are placed in the cmake global namespace and
# therefore visible to all components.
#
# 2. The prerequisite for all ctest targets e.g. "Experimental" is ALL.
# If you plan to submit tests to a dashboard, it might be a good idea
# to carefully review what constitutes "ALL" in your system to avoid
# uneccessary time consuming tasks.
#
# 3. It is only neccessary to include CTest at the top level of the System.
# enable_testing() is implied by the inclusion of the CTest modules and
# therefore an explicit reference to it is redundant and perhaps problematic
# under certain conditions.
# 2016-5-23: If Ctest is only included at top level, component check targets
# complain they can't find the configuration file DartConfiguration.tcl.
# Moved include(CTest) to component CMakeLists.txt files.
#
# Specify the minimum cmake version.
#
cmake_minimum_required(VERSION 3.5.0)
#
# Make sure if() treats constants like TRUE as constants
# rather than implicitly treating them as variables and trying to dereference them.
cmake_policy(SET CMP0012 NEW)
# Setting CMAKE_CONFIGURATION_TYPES prior to the project function call
# will eliminate the default configuration types (debug,release,RelWithDebugInfo, et al.) --
# or at least stop them from appearing in the VS configuration list.
# It does NOT stop cmake from setting all the cache variables associated with those same
# configurations however.
if(WIN32)
set(CMAKE_CONFIGURATION_TYPES Debug_contracts RelWithDebInfo_no_contracts
CACHE STRING "Supported configuration types" FORCE)
mark_as_advanced(FORCE CMAKE_CONFIGURATION_TYPES)
else()
set(CMAKE_CONFIGURATION_TYPES Debug_contracts Release_no_contracts
CACHE STRING "Supported configuration types" FORCE)
mark_as_advanced(FORCE CMAKE_CONFIGURATION_TYPES)
endif()
#
# Establish the project name
#
project(SheafSystemTest)
#
# Enable testing support, must be called after project command.
#
include(CTest)
# CTest defines several variables, mark them advanced to keep user interface clean.
mark_as_advanced(FORCE BUILD_TESTING)
mark_as_advanced(FORCE CTEST_DROP_SITE)
mark_as_advanced(FORCE CTEST_NIGHTLY_START_TIME)
#
# Set the cmake module path.
#
set(SHFSYSTST_CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake_modules"
CACHE STRING "Location of SheafSystemTest Cmake modules")
mark_as_advanced(FORCE SHFSYSTST_CMAKE_MODULE_PATH)
# Make the requires and ensures functions available.
include(${SHFSYSTST_CMAKE_MODULE_PATH}/design_by_contract.cmake)
#
# Include variable definitions and functions
# unique to and/or required at the system level.
#
include(system_definitions.cmake)
ShfSysTst_make_system_definitions()
#
# Set up output directories
#
ShfSysTst_create_output_dirs()
#
# Add components to the system
#
ShfSysTst_add_components()
#
# Add all the system level targets.
#
include(${SHFSYSTST_CMAKE_MODULE_PATH}/target_declarations.cmake)
ShfSysTst_add_system_targets()
#
# Configure the environment variable scripts.
#
if(SHFSYSTST_LINUX)
ShfSysTst_configure_set_env_var_scripts()
endif()