-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathCMakeLists.txt
76 lines (68 loc) · 1.79 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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required(VERSION 3.14)
include(FetchContent)
FetchContent_Declare(GatzkaToolchainFiles
GIT_REPOSITORY [email protected]:gatzka/cmake-toolchain-files.git
SOURCE_DIR ${CMAKE_BINARY_DIR}/toolchains
)
FetchContent_MakeAvailable(GatzkaToolchainFiles)
project(scramjet C)
include(CTest)
find_package(cio QUIET)
if(cio_FOUND)
message(STATUS "cio already installed, using it")
else()
message(STATUS "cio not installed, fetching it")
FetchContent_Declare(cio
GIT_REPOSITORY [email protected]:gatzka/cio.git
GIT_TAG origin/main
)
FetchContent_MakeAvailable(cio)
endif()
find_package(hs_hash QUIET)
if(hs_hash_FOUND)
message(STATUS "hs_hash already installed, using it")
else()
message(STATUS "hs_hash not installed, fetching it")
FetchContent_Declare(hs_hash
GIT_REPOSITORY [email protected]:gatzka/hs_hash.git
)
FetchContent_MakeAvailable(hs_hash)
endif()
find_package(sclog QUIET)
if(sclog_FOUND)
message(STATUS "sclog already installed, using it")
else()
message(STATUS "sclog not installed, fetching it")
FetchContent_Declare(sclog
GIT_REPOSITORY [email protected]:gatzka/sclog.git
)
FetchContent_MakeAvailable(sclog)
endif()
add_executable(scramjet
jet_error.h
list.h
messages.c
messages.h
functions.h
peer.c
peer.h
protocol_version.c
protocol_version.h
scramjet.c
sj_log.c
socket_peer.c
socket_peer.h
state.c
state.h
websocket_peer.c
websocket_peer.h
)
target_link_libraries(scramjet cio::cio)
target_link_libraries(scramjet hs_hash::hs_hash)
target_link_libraries(scramjet sclog::sclog)
set_target_properties(scramjet PROPERTIES
C_STANDARD_REQUIRED ON
C_EXTENSIONS OFF
C_CLANG_TIDY ""
)
install(TARGETS scramjet RUNTIME DESTINATION bin)