-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
64 lines (52 loc) · 2.11 KB
/
CMakeLists.txt
File metadata and controls
64 lines (52 loc) · 2.11 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
###################################################################################################
# Copyright (c) 2024, Lawrence Livermore National Security, LLC.
# All rights reserved.
# See the LICENSE file for details.
# SPDX-License-Identifier: (BSD-3-Clause)
###################################################################################################
cmake_minimum_required( VERSION 3.23.1 )
# Set version number
set( UNITGUARD_VERSION_MAJOR 0 )
set( UNITGUARD_VERSION_MINOR 1 )
set( UNITGUARD_VERSION_PATCHLEVEL 0 )
# check if UNITGUARD is build as a submodule or a separate project
get_directory_property( parent_dir PARENT_DIRECTORY )
if(parent_dir)
set( is_submodule ON )
else()
set( is_submodule OFF )
endif()
if( NOT is_submodule )
message( STATUS "UnitGuard is not a submodule" )
project( UNITGUARD LANGUAGES CXX C )
set( BLT_CXX_STD "c++17" CACHE STRING "Version of C++ standard" FORCE )
set( ENABLE_WARNINGS_AS_ERRORS "ON" CACHE PATH "" )
option( UNITGUARD_ENABLE_UNIT_TESTS "Builds tests" ON )
option( UNITGUARD_ENABLE_DOCS "Builds documentation" ON )
if( NOT BLT_LOADED )
if( DEFINED BLT_SOURCE_DIR )
if( NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake )
message( FATAL_ERROR "Given BLT_SOURCE_DIR does not contain SetupBLT.cmake" )
endif()
else ()
set( BLT_SOURCE_DIR ${PROJECT_SOURCE_DIR}/cmake/blt CACHE PATH "" )
if( NOT EXISTS ${BLT_SOURCE_DIR}/SetupBLT.cmake )
message( FATAL_ERROR "The BLT submodule is not present. If in git repository run the following two commands:\n \
git submodule init\n \
git submodule update" )
endif ()
endif ()
include( ${BLT_SOURCE_DIR}/SetupBLT.cmake )
endif()
else()
if( NOT BLT_LOADED )
message( FATAL_ERROR "When using UnitGuard as a submodule you must have already loaded BLT." )
endif()
endif()
include( cmake/CMakeBasics.cmake )
include( cmake/Macros.cmake )
include( cmake/Config.cmake )
add_subdirectory( src )
if( UNITGUARD_ENABLE_DOCS )
add_subdirectory( docs )
endif()