-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
50 lines (35 loc) · 1.21 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
cmake_minimum_required (VERSION 3.8)
if ($ENV{GITHUB_RUN_NUMBER})
project (tcp-echo-server-io-uring VERSION 0.0.$ENV{GITHUB_RUN_NUMBER})
else()
project (tcp-echo-server-io-uring VERSION 0.0.1)
endif()
configure_file(version.h.in version.h)
find_package(Doxygen)
option(WITH_LIBURING "with liburing" ON)
set(PROJECT_SOURCES
tcp-echo-server-io-uring.cpp
echo-server.h
echo-server.cpp
)
add_executable (tcp-echo-server-io-uring ${PROJECT_SOURCES})
if(WITH_LIBURING)
include(FetchContent)
FetchContent_Declare(
liburing_cmake
GIT_REPOSITORY https://github.com/sharpeye/liburing-cmake.git
GIT_TAG main
)
FetchContent_MakeAvailable(liburing_cmake)
endif()
target_link_libraries(tcp-echo-server-io-uring PRIVATE liburing)
if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET tcp-echo-server-io-uring PROPERTY CXX_STANDARD 20)
endif()
install(TARGETS tcp-echo-server-io-uring RUNTIME DESTINATION bin)
set(CPACK_GENERATOR DEB)
set(CPACK_PACKAGE_VERSION_MAJOR "${PROJECT_VERSION_MAJOR}")
set(CPACK_PACKAGE_VERSION_MINOR "${PROJECT_VERSION_MINOR}")
set(CPACK_PACKAGE_VERSION_PATCH "${PROJECT_VERSION_PATCH}")
set(CPACK_PACKAGE_CONTACT [email protected])
include(CPack)