70a1243b3b352143b127a2b314938cc6e7aa371e
[vpp.git] / src / plugins / quic / CMakeLists.txt
1
2 # Copyright (c) 2019 Cisco
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at:
6 #
7 #     http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 message(STATUS "Looking for quicly")
16 unset(QUIC_LINK_LIBRARIES)
17
18 find_path(QUICLY_INCLUDE_DIR NAMES quicly.h)
19 find_library (QUICLY_LIBRARY NAMES "libquicly.a")
20 find_library (PICOTLS_CORE_LIBRARY NAMES "libpicotls-core.a")
21 find_library (PICOTLS_OPENSSL_LIBRARY NAMES "libpicotls-openssl.a")
22
23 list(APPEND QUIC_LINK_LIBRARIES
24   ${QUICLY_LIBRARY}
25   ${PICOTLS_CORE_LIBRARY}
26   ${PICOTLS_OPENSSL_LIBRARY}
27 )
28
29 if(QUICLY_INCLUDE_DIR AND QUIC_LINK_LIBRARIES)
30   include_directories (${QUICLY_INCLUDE_DIR})
31   add_vpp_plugin(quic
32     SOURCES
33     quic.c
34     quic_crypto.c
35
36     INSTALL_HEADERS
37     quic.h
38
39     LINK_LIBRARIES ${QUIC_LINK_LIBRARIES}
40   )
41   message(STATUS "Found quicly in ${QUICLY_INCLUDE_DIR}")
42 else()
43   message(WARNING "-- quicly not found - quic_plugin disabled")
44 endif()