-
Notifications
You must be signed in to change notification settings - Fork 1
/
CMakeLists.txt
32 lines (24 loc) · 862 Bytes
/
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
# Copyright (c) Andreas Fertig.
# SPDX-License-Identifier: MIT
cmake_minimum_required(VERSION 3.16.2 FATAL_ERROR)
project("Auto as NTTP" CXX)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# https://stackoverflow.com/questions/7787823/cmake-how-to-get-the-name-of-all-subdirectories-of-a-directory
macro(SUBDIRLIST result curdir)
file(GLOB children RELATIVE ${curdir} ${curdir}/*)
set(dirlist "")
foreach(child ${children})
if(IS_DIRECTORY ${curdir}/${child})
list(APPEND dirlist ${child})
endif()
endforeach()
set(${result} ${dirlist})
endmacro()
SUBDIRLIST(SUBDIRS ${CMAKE_SOURCE_DIR})
foreach(subdir ${SUBDIRS})
if(EXISTS ${CMAKE_SOURCE_DIR}/${subdir}/CMakeLists.txt)
add_subdirectory(${subdir})
else()
message(DEBUG "Subdirectory ${subdir} does not contain a 'CMakeLists.txt'")
endif()
endforeach()