]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/ports/enet/CMakeLists.txt
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / ports / enet / CMakeLists.txt
1 cmake_minimum_required(VERSION 2.6)
2
3 project(enet)
4
5 # The "configure" step.
6 include(CheckFunctionExists)
7 include(CheckStructHasMember)
8 include(CheckTypeSize)
9 check_function_exists("fcntl" HAS_FCNTL)
10 check_function_exists("poll" HAS_POLL)
11 check_function_exists("getaddrinfo" HAS_GETADDRINFO)
12 check_function_exists("getnameinfo" HAS_GETNAMEINFO)
13 check_function_exists("gethostbyname_r" HAS_GETHOSTBYNAME_R)
14 check_function_exists("gethostbyaddr_r" HAS_GETHOSTBYADDR_R)
15 check_function_exists("inet_pton" HAS_INET_PTON)
16 check_function_exists("inet_ntop" HAS_INET_NTOP)
17 check_struct_has_member("struct msghdr" "msg_flags" "sys/types.h;sys/socket.h" HAS_MSGHDR_FLAGS)
18 set(CMAKE_EXTRA_INCLUDE_FILES "sys/types.h" "sys/socket.h")
19 check_type_size("socklen_t" HAS_SOCKLEN_T BUILTIN_TYPES_ONLY)
20 unset(CMAKE_EXTRA_INCLUDE_FILES)
21 if(MSVC)
22 add_definitions(-W3)
23 else()
24 add_definitions(-Wno-error)
25 endif()
26
27 if(HAS_FCNTL)
28 add_definitions(-DHAS_FCNTL=1)
29 endif()
30 if(HAS_POLL)
31 add_definitions(-DHAS_POLL=1)
32 endif()
33 if(HAS_GETNAMEINFO)
34 add_definitions(-DHAS_GETNAMEINFO=1)
35 endif()
36 if(HAS_GETADDRINFO)
37 add_definitions(-DHAS_GETADDRINFO=1)
38 endif()
39 if(HAS_GETHOSTBYNAME_R)
40 add_definitions(-DHAS_GETHOSTBYNAME_R=1)
41 endif()
42 if(HAS_GETHOSTBYADDR_R)
43 add_definitions(-DHAS_GETHOSTBYADDR_R=1)
44 endif()
45 if(HAS_INET_PTON)
46 add_definitions(-DHAS_INET_PTON=1)
47 endif()
48 if(HAS_INET_NTOP)
49 add_definitions(-DHAS_INET_NTOP=1)
50 endif()
51 if(HAS_MSGHDR_FLAGS)
52 add_definitions(-DHAS_MSGHDR_FLAGS=1)
53 endif()
54 if(HAS_SOCKLEN_T)
55 add_definitions(-DHAS_SOCKLEN_T=1)
56 endif()
57
58 include_directories(${PROJECT_SOURCE_DIR}/include)
59
60 add_library(enet STATIC
61 callbacks.c
62 compress.c
63 host.c
64 list.c
65 packet.c
66 peer.c
67 protocol.c
68 unix.c
69 win32.c
70 )
71
72 if (WIN32)
73 target_link_libraries(enet winmm ws2_32)
74 endif()
75
76 install(TARGETS enet ARCHIVE DESTINATION lib
77 LIBRARY DESTINATION lib
78 RUNTIME DESTINATION bin)
79
80 install(DIRECTORY include/
81 DESTINATION include)