DefaultExecutable.cmake 636 Bytes
Newer Older
Bastian Krayer's avatar
Bastian Krayer committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
cmake_minimum_required(VERSION 3.16)

get_filename_component(ProjectId ${CMAKE_CURRENT_SOURCE_DIR} NAME)
string(REPLACE " " "_" ProjectId ${ProjectId})
project(${ProjectId})

# Enables the CMake policy to use environment variables {LIBNAME}_ROOT to search for libraries
EnableCmakeLibEnvironmentRoot()

# Creates an executable from all source and header files in the current directory
# This will also find all dependencies specified in the depdencies.txt and
# link them privately
CreateExecutable(${ProjectId})

# Add default dependencies with private visibility, since it is an executable
AddDefaultDependencies(${ProjectId} PRIVATE)