-
Notifications
You must be signed in to change notification settings - Fork 0
/
CmDaB.cmake
58 lines (45 loc) · 1.5 KB
/
CmDaB.cmake
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
# This file is part of the CmDab Project.
#
# Copyright (c) 2021 Vollstrecker ([email protected])
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License Version 3as published by
# the Free Software Foundation; of the License
#
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, check
# https://github.com/Vollstrecker/CmDaB/blob/main/LICENSE
#[=======================================================================[.rst:
CmDaB.cmake
------------------
.. only:: html
.. contents::
Overview
^^^^^^^^
This module adds an option called DOWNLOAD_AND_BUILD_DEPS to your project.
If this option is activated by the user, this module will download and
include the main project files to be used within your project.
#]=======================================================================]
include (CMakeDependentOption)
Find_Package (Git)
cmake_dependent_option (DOWNLOAD_AND_BUILD_DEPS "Get all missing stuff" OFF ${Git_FOUND} OFF)
if (DOWNLOAD_AND_BUILD_DEPS)
include (FetchContent)
FetchContent_Declare (
CmDaB
GIT_REPOSITORY https://github.com/Vollstrecker/CmDaB.git
GIT_TAG main
)
FetchContent_GetProperties(CmDaB)
if (NOT cmdab_POPULATED)
if (CMAKE_VERSION VERSION_GREATER_EQUAL 3.14)
FetchContent_MakeAvailable (CmDaB)
else()
FetchContent_Populate (CmDaB)
add_subdirectory (${cmdab_SOURCE_DIR}
${cmdab_BINARY_DIR}
)
endif()
endif()
endif()