-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
36 lines (29 loc) · 1.31 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
cmake_minimum_required(VERSION 3.20)
project(sndrecv_examples)
set(CMAKE_CXX_STANDARD 20)
include(ExternalProject)
ExternalProject_Add(libunifex_project
GIT_REPOSITORY https://github.com/facebookexperimental/libunifex.git
GIT_TAG 67829c4
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/external/libunifex"
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/external/libunifex"
)
set(libunifex_includes
"${CMAKE_CURRENT_SOURCE_DIR}/external/libunifex/include"
"${CMAKE_CURRENT_BINARY_DIR}/external/libunifex/include"
)
add_library(libunifex STATIC IMPORTED)
#add_dependencies(libunifex libunifex_project)
set_property(TARGET libunifex PROPERTY IMPORTED_LOCATION ${CMAKE_CURRENT_BINARY_DIR}/external/libunifex/source/libunifex.a)
target_include_directories(libunifex INTERFACE ${libunifex_includes})
function(def_example target sourceFile)
add_executable(${target} ${sourceFile})
target_link_libraries(${target} libunifex)
target_include_directories(${target} PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")
endfunction()
def_example(hello "hello.cpp")
def_example(fork "basic/fork.cpp")
def_example(continuation_1 "basic/continuation_1.cpp")
def_example(continuation_2 "basic/continuation_2.cpp")
def_example(join "basic/join.cpp")
def_example(async_start "various/async_start.cpp")