-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathCMakeLists.txt
50 lines (40 loc) · 1.45 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
# Example CMake command line to create project build files:
#
# *** Windows ***
# cmake -G "Visual Studio 17 2022" -A Win32 -B ../AsyncMulticastDelegateBuild -S .
# cmake -G "Visual Studio 17 2022" -A x64 -B ../AsyncMulticastDelegateBuild -S .
# cmake -G "Visual Studio 17 2022" -A x64 -B ../AsyncMulticastDelegateBuild -S . -DENABLE_UNIT_TESTS=ON
#
# *** Linux ***
# cmake -G "Unix Makefiles" -B ../AsyncMulticastDelegateBuild -S .
# cmake -G "Unix Makefiles" -B ../AsyncMulticastDelegateBuild -S . -DENABLE_UNIT_TESTS=ON
# Specify the minimum CMake version required
cmake_minimum_required(VERSION 3.10)
# Project name and language (C or C++)
project(Delegate VERSION 1.0 LANGUAGES CXX)
# Set C++ standard
set(CMAKE_CXX_STANDARD 11)
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}/Delegate
${CMAKE_SOURCE_DIR}/Examples
${CMAKE_SOURCE_DIR}/Port
)
# Add an executable target
add_executable(DelegateApp ${SOURCES})
# Define the DELEGATE_UNIT_TEST macro for the DelegateApp target
if (ENABLE_UNIT_TESTS)
add_compile_definitions(DELEGATE_UNIT_TESTS)
endif()
# Add subdirectories to build
add_subdirectory(Delegate)
add_subdirectory(Examples)
add_subdirectory(Port)
target_link_libraries(DelegateApp PRIVATE
DelegateLib
ExamplesLib
PortLib
)