-
Notifications
You must be signed in to change notification settings - Fork 2
/
CMakeLists.txt
41 lines (35 loc) · 1.47 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
# initialize the project
cmake_minimum_required(VERSION 3.16)
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
project(ActorDemo
VERSION 0.1
DESCRIPTION "A demonstrator for C++ Actor Framework")
option(DOCKER "Set if project is built with the provided Dockerfile" OFF)
# The following code snippet is taken from
# https://cliutils.gitlab.io/modern-cmake/chapters/projects/submodule.html
# It downloads all the git submodules
if(NOT DOCKER)
find_package(Git QUIET)
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
# Update submodules as needed
option(GIT_SUBMODULE "Check submodules during build" ON)
if(GIT_SUBMODULE)
message(STATUS "Submodule update")
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
RESULT_VARIABLE GIT_SUBMOD_RESULT)
if(NOT GIT_SUBMOD_RESULT EQUAL "0")
message(FATAL_ERROR "git submodule update --init --recursive failed with ${GIT_SUBMOD_RESULT}.")
endif()
endif()
endif()
# use one example file to validate wether the git submodules are present now
if(NOT EXISTS "${PROJECT_SOURCE_DIR}/external/caf/actor-framework/CMakeLists.txt")
message(FATAL_ERROR "The submodules were not downloaded! GIT_SUBMODULE was "
"turned off or failed. Please update submodules and try again.")
endif()
endif()
set(CMAKE_VERBOSE_MAKEFILE ON)
add_subdirectory(external)
add_subdirectory(doc)
add_subdirectory(app)