xref: /libuv/docs/code/CMakeLists.txt (revision a7867154)
1cmake_minimum_required(VERSION 3.5)
2
3project(libuv_sample)
4
5set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
6
7add_subdirectory("../../" build)
8
9set(SIMPLE_SAMPLES
10        cgi
11        helloworld
12        dns
13        detach
14        default-loop
15        idle-basic
16        idle-compute
17        interfaces
18        locks
19        onchange
20        pipe-echo-server
21        ref-timer
22        spawn
23        tcp-echo-server
24        thread-create
25        udp-dhcp
26        uvcat
27        uvstop
28        uvtee
29        )
30IF (NOT WIN32)
31    list(APPEND SIMPLE_SAMPLES
32            signal
33            progress
34            queue-cancel
35            queue-work
36            tty
37            tty-gravity
38            )
39ENDIF()
40
41foreach (X IN LISTS SIMPLE_SAMPLES)
42    add_executable(${X} ${X}/main.c)
43    target_link_libraries(${X} uv_a)
44endforeach ()
45
46
47FIND_PACKAGE(CURL)
48IF(CURL_FOUND)
49    add_executable(uvwget uvwget/main.c)
50    target_link_libraries(uvwget uv_a ${CURL_LIBRARIES})
51ENDIF(CURL_FOUND)
52