-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
48 lines (39 loc) · 1.2 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
42
43
44
45
46
47
# Example CMake command line to create project build files:
#
# *** Windows ***
# cmake -G "Visual Studio 17 2022" -A Win32 -B Build -S .
#
# *** Linux ***
# cmake -G "Unix Makefiles" -B Build -S .
# Specify the minimum CMake version required
cmake_minimum_required(VERSION 3.10)
# Project name and language (C or C++)
project(C_StateMachineWithThreads VERSION 1.0 LANGUAGES C CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED True)
# Collect all .cpp and *.h source files in the current directory
file(GLOB SOURCES "${CMAKE_SOURCE_DIR}/*.cpp" "${CMAKE_SOURCE_DIR}/*.h")
# Add subdirectories to include path
include_directories(
${CMAKE_SOURCE_DIR}/Allocator
${CMAKE_SOURCE_DIR}/Callback
${CMAKE_SOURCE_DIR}/Port
${CMAKE_SOURCE_DIR}/SelfTest
${CMAKE_SOURCE_DIR}/StateMachine
)
# Add an executable target
add_executable(C_StateMachineWithThreadsApp ${SOURCES})
# Add subdirectories to build
add_subdirectory(Allocator)
add_subdirectory(Callback)
add_subdirectory(Port)
add_subdirectory(SelfTest)
add_subdirectory(StateMachine)
target_link_libraries(C_StateMachineWithThreadsApp PRIVATE
AllocatorLib
CallbackLib
PortLib
SelfTestLib
StateMachineLib
)