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/protocol/reqrep0/CMakeLists.txt | 30 ++++++++++++++++++++++-------- 1 file changed, 22 insertions(+), 8 deletions(-) (limited to 'src/protocol/reqrep0') diff --git a/src/protocol/reqrep0/CMakeLists.txt b/src/protocol/reqrep0/CMakeLists.txt index 071c28f1..70c075c1 100644 --- a/src/protocol/reqrep0/CMakeLists.txt +++ b/src/protocol/reqrep0/CMakeLists.txt @@ -9,18 +9,32 @@ # # Req/Rep protocol +option (NNG_PROTO_REQ0 "Enable REQv0 protocol." ON) +mark_as_advanced(NNG_PROTO_REQ0) + +option (NNG_PROTO_REP0 "Enable REPv0 protocol." ON) +mark_as_advanced(NNG_PROTO_REP0) + +set(_DEFS) +set(_SRCS) +set(_HDRS) if (NNG_PROTO_REQ0) - set(REQ0_SOURCES protocol/reqrep0/req.c protocol/reqrep0/xreq.c - protocol/reqrep0/req.h) - set(REQ0_HEADERS protocol/reqrep0/req.h) + list(APPEND _DEFS -DNNG_HAVE_REQ0) + list(APPEND _SRCS + protocol/reqrep0/req.c protocol/reqrep0/xreq.c + protocol/reqrep0/req.h) + list(APPEND _HDRS protocol/reqrep0/req.h) endif() if (NNG_PROTO_REP0) - set(REP0_SOURCES protocol/reqrep0/rep.c protocol/reqrep0/xrep.c - protocol/reqrep0/rep.h) - set(REP0_HEADERS protocol/reqrep0/rep.h) + list(APPEND _DEFS -DNNG_HAVE_REP0) + list(APPEND _SRCS + protocol/reqrep0/rep.c protocol/reqrep0/xrep.c + protocol/reqrep0/rep.h) + list(APPEND _HDRS protocol/reqrep0/rep.h) endif() -set(NNG_SOURCES ${NNG_SOURCES} ${REQ0_SOURCES} ${REP0_SOURCES} PARENT_SCOPE) -set(NNG_HEADERS ${NNG_HEADERS} ${REQ0_HEADERS} ${REP0_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) -- cgit v1.2.3-70-g09d2