-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
43 lines (35 loc) · 909 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
33
34
35
36
37
38
39
40
41
42
43
# cpp-app-template
# Michael Valdron
# Feb. 26, 2021
# CMAKE Version Requirement
cmake_minimum_required(VERSION 3.10)
# Project definitions
project(
cpp-app-template
VERSION 1.0
LANGUAGES CXX)
# Variables
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED True)
set(SOURCE_DIR "${PROJECT_SOURCE_DIR}/src/")
set(INCLUDE_DIR "${PROJECT_SOURCE_DIR}/include/")
# Add submodules
#
# Example:
# add_subdirectory(extern/<submodule>)
# ...
# Link project includes
include_directories(${INCLUDE_DIR})
# Get source files
file(GLOB_RECURSE SOURCES "${SOURCE_DIR}/*.cc" "${SOURCE_DIR}/*.cpp" "${SOURCE_DIR}/*.cxx")
# Compile executable for project
add_executable(${PROJECT_NAME} ${SOURCES})
# Link submodules
#
# Example:
# target_include_directories(${PROJECT_NAME}
# PUBLIC extern/<submodule>/include
# ...
# )
# target_link_libraries(${PROJECT_NAME} <submodule_binary_name>)
# ...