/
CMakeLists.txt
71 lines (64 loc) · 2.5 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
#
# Copyright(c) 2006 to 2021 ZettaScale Technology and others
#
# This program and the accompanying materials are made available under the
# terms of the Eclipse Public License v. 2.0 which is available at
# http://www.eclipse.org/legal/epl-2.0, or the Eclipse Distribution License
# v. 1.0 which is available at
# http://www.eclipse.org/org/documents/edl-v10.php.
#
# SPDX-License-Identifier: EPL-2.0 OR BSD-3-Clause
#
include(GenerateExportHeader)
set(sources
src/authentication.c
src/auth_utils.c
../include/auth_tokens.h
../include/ac_tokens.h)
set(private_headers
src/authentication.h
src/auth_utils.h)
if(BUILD_SHARED_LIBS)
add_library(dds_security_auth SHARED ${sources} ${private_headers})
else()
add_library(dds_security_auth OBJECT ${sources} ${private_headers})
set_property(GLOBAL APPEND PROPERTY cdds_plugin_list dds_security_auth)
set_property(GLOBAL PROPERTY dds_security_auth_symbols init_authentication finalize_authentication)
endif()
generate_export_header(
dds_security_auth
BASE_NAME SECURITY
EXPORT_FILE_NAME "${CMAKE_CURRENT_BINARY_DIR}/include/dds/security/export.h"
)
target_link_libraries(dds_security_auth PRIVATE security_openssl)
if(BUILD_SHARED_LIBS)
target_link_libraries(dds_security_auth PUBLIC ddsc)
endif()
target_link_libraries(dds_security_auth PUBLIC OpenSSL::SSL)
if(CMAKE_GENERATOR MATCHES "Visual Studio")
set_target_properties(dds_security_auth PROPERTIES LINK_FLAGS "/ignore:4099")
endif()
add_coverage(dds_security_auth)
target_include_directories(dds_security_auth
PUBLIC
"$<BUILD_INTERFACE:$<TARGET_PROPERTY:security_api,INTERFACE_INCLUDE_DIRECTORIES>>"
"$<BUILD_INTERFACE:$<TARGET_PROPERTY:security_core,INTERFACE_INCLUDE_DIRECTORIES>>"
"$<BUILD_INTERFACE:$<TARGET_PROPERTY:security_openssl,INTERFACE_INCLUDE_DIRECTORIES>>"
"$<BUILD_INTERFACE:$<TARGET_PROPERTY:ddsrt,INTERFACE_INCLUDE_DIRECTORIES>>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/../../../core/ddsi/include>"
)
install(
TARGETS dds_security_auth
EXPORT "${PROJECT_NAME}"
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT lib
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib
ARCHIVE DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT lib)
if (INSTALL_PDB)
install(FILES $<TARGET_PDB_FILE:dds_security_auth>
DESTINATION "${CMAKE_INSTALL_BINDIR}"
COMPONENT dev
OPTIONAL
)
endif()