-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathCMakeLists.txt
54 lines (38 loc) · 1.14 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
48
49
50
51
52
53
54
# 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 .
#
# See ssp_opt.h for HAL and OSAL build options.
# Specify the minimum CMake version required
cmake_minimum_required(VERSION 3.10)
# Project name and language (C or C++)
project(SimpleSocketProtocol 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}/example
${CMAKE_SOURCE_DIR}/port
${CMAKE_SOURCE_DIR}/ssp
)
# Add an executable target
add_executable(SimpleSocketProtocolApp ${SOURCES})
if (ENABLE_ALLOCATOR)
add_compile_definitions(USE_ALLOCATOR)
endif()
# Add subdirectories to build
add_subdirectory(example)
add_subdirectory(port)
add_subdirectory(ssp)
target_link_libraries(SimpleSocketProtocolApp PRIVATE
ExampleLib
PortLib
SSPLib
)