From 77984b14a65c0a7387c97f3d36f947dd17358744 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 5 Nov 2018 13:54:40 -0800 Subject: fixes #577 target library dependencies should be public This is a significant refactor of the library configuration. We use the modern package configuration helper, with a template script that also does the find_package dance for any of our dependencies. We also have restructured the code so that most protocols and transports have their configuration isolated to their own CMakeLists file, reducing the size of the global CMakeLists file. --- src/transport/tls/CMakeLists.txt | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src/transport/tls') diff --git a/src/transport/tls/CMakeLists.txt b/src/transport/tls/CMakeLists.txt index d55a9e92..80bc60af 100644 --- a/src/transport/tls/CMakeLists.txt +++ b/src/transport/tls/CMakeLists.txt @@ -9,11 +9,16 @@ # # TLS transport +CMAKE_DEPENDENT_OPTION(NNG_TRANSPORT_TLS "Enable TLS transport" ON + "NNG_ENABLE_TLS" OFF) +mark_as_advanced(NNG_TRANSPORT_TLS) if (NNG_TRANSPORT_TLS) - set(TLS_SOURCES transport/tls/tls.c transport/tls/tls.h) - set(TLS_HEADERS transport/tls/tls.h) -endif() + set(_DEFS -DNNG_TRANSPORT_TLS) + set(_SRCS transport/tls/tls.c transport/tls/tls.h) + set(_HDRS transport/tls/tls.h) -set(NNG_SOURCES ${NNG_SOURCES} ${TLS_SOURCES} PARENT_SCOPE) -set(NNG_HEADERS ${NNG_HEADERS} ${TLS_HEADERS} PARENT_SCOPE) + set(NNG_DEFS ${NNG_DEFS} ${_DEFS} PARENT_SCOPE) + set(NNG_SRCS ${NNG_SRCS} ${_SRCS} PARENT_SCOPE) + set(NNG_HDRS ${NNG_HDRS} ${_HDRS} PARENT_SCOPE) +endif() -- cgit v1.2.3-70-g09d2