From 9be64debafa321a6712a9c500b36136757d588c7 Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Fri, 31 Jan 2014 21:25:25 +0100 Subject: Corrected configure-time check for SMTP in curl --- CMakeLists.txt | 6 +----- config.h.in | 3 +++ src/uscxml/Factory.cpp | 15 ++++++++++----- src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp | 4 ++-- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 382fa56..968e4d9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -577,16 +577,12 @@ set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES}) check_cxx_source_compiles(" #include - int main(){return CURLOPT_MAIL_RCPT} + int main(){return CURLOPT_MAIL_RCPT; } " CURL_HAS_SMTP) set(CMAKE_REQUIRED_INCLUDES) set(CMAKE_REQUIRED_LIBRARIES) -if (NOT CURL_HAS_SMTP) - message(STATUS "Curl missing SMTP support.") -endif() - # GLOG # set(ENV{GLOG_SRC} ${CMAKE_SOURCE_DIR}/../glog) find_package(GLOG REQUIRED) diff --git a/config.h.in b/config.h.in index b10be40..8c579b0 100644 --- a/config.h.in +++ b/config.h.in @@ -72,6 +72,9 @@ #cmakedefine EXPECT_FOUND #cmakedefine TCL_FOUND +/** Properties of the libraries we found */ +#cmakedefine CURL_HAS_SMTP + /** Header files we found */ #cmakedefine HAS_UNISTD_H #cmakedefine HAS_STRING_H diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp index c2177d9..f975f39 100644 --- a/src/uscxml/Factory.cpp +++ b/src/uscxml/Factory.cpp @@ -39,9 +39,11 @@ # include "uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h" # include "uscxml/plugins/invoker/system/SystemInvoker.h" # include "uscxml/plugins/invoker/xhtml/XHTMLInvoker.h" -# include "uscxml/plugins/invoker/smtp/SMTPInvoker.h" # include "uscxml/plugins/invoker/imap/IMAPInvoker.h" +# ifdef CURL_HAS_SMTP +# include "uscxml/plugins/invoker/smtp/SMTPInvoker.h" +# endif #ifdef PROTOBUF_FOUND //# include "uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h" @@ -269,6 +271,13 @@ Factory::Factory() { #endif #endif +#ifdef CURL_HAS_SMTP + { + SMTPInvoker* invoker = new SMTPInvoker(); + registerInvoker(invoker); + } +#endif + // these are always available { NULLDataModel* dataModel = new NULLDataModel(); @@ -280,10 +289,6 @@ Factory::Factory() { registerInvoker(invoker); } { - SMTPInvoker* invoker = new SMTPInvoker(); - registerInvoker(invoker); - } - { IMAPInvoker* invoker = new IMAPInvoker(); registerInvoker(invoker); } diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp index 17b5cb4..dda51b7 100644 --- a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp +++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp @@ -81,8 +81,8 @@ boost::shared_ptr SCXMLIOProcessor::create(InterpreterImpl* int Data SCXMLIOProcessor::getDataModelVariables() { Data data; - if(_url.length() > 0); - data.compound["location"] = Data(_url, Data::VERBATIM); + if(_url.length() > 0) + data.compound["location"] = Data(_url, Data::VERBATIM); return data; } -- cgit v0.12