From 3b321677e433dbc6f88c9e7faed0857022514efe Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Fri, 31 Jan 2014 20:09:52 +0100 Subject: Only build SMTP invoker with current curl --- CMakeLists.txt | 16 ++++++++++++++++ src/bindings/CMakeLists.txt | 4 ++-- src/uscxml/plugins/invoker/CMakeLists.txt | 32 ++++++++++++++++--------------- 3 files changed, 35 insertions(+), 17 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 19bb061..382fa56 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -570,6 +570,22 @@ list (APPEND USCXML_CORE_LIBS ${CURL_LIBRARIES}) if (WIN32) add_definitions("-DCURL_STATICLIB") endif() +include(CheckCXXSourceCompiles) + +set(CMAKE_REQUIRED_INCLUDES ${CURL_INCLUDE_DIRS}) +set(CMAKE_REQUIRED_LIBRARIES ${CURL_LIBRARIES}) + +check_cxx_source_compiles(" + #include + 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) diff --git a/src/bindings/CMakeLists.txt b/src/bindings/CMakeLists.txt index 82ad509..b1f2429 100644 --- a/src/bindings/CMakeLists.txt +++ b/src/bindings/CMakeLists.txt @@ -6,9 +6,9 @@ if (SWIG_FOUND) add_subdirectory(swig/java) add_subdirectory(swig/php) else() - message("SWIG version 2.0.5 is required, found ${SWIG_VERSION} - skipping java wrapper generation") + message(STATUS "SWIG version 2.0.5 is required, found ${SWIG_VERSION} - skipping java wrapper generation") endif() else() - message("SWIG not found - skipping wrapper generation") + message(STATUS "SWIG not found - skipping wrapper generation") endif() set(USCXML_LANGUAGE_BINDINGS ${USCXML_LANGUAGE_BINDINGS} PARENT_SCOPE) diff --git a/src/uscxml/plugins/invoker/CMakeLists.txt b/src/uscxml/plugins/invoker/CMakeLists.txt index aec337b..fe86e7c 100644 --- a/src/uscxml/plugins/invoker/CMakeLists.txt +++ b/src/uscxml/plugins/invoker/CMakeLists.txt @@ -119,21 +119,23 @@ endif() # SMTP invoker via curl -set(USCXML_INVOKERS "smtp ${USCXML_INVOKERS}") -file(GLOB_RECURSE SMTP_INVOKER - smtp/*.cpp - smtp/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES SMTP_INVOKER) - add_library( - invoker_smtp SHARED - ${SMTP_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_smtp uscxml) - set_target_properties(invoker_smtp PROPERTIES FOLDER "Plugin Invoker") -else() - list (APPEND USCXML_FILES ${SMTP_INVOKER}) +if (CURL_HAS_SMTP) + set(USCXML_INVOKERS "smtp ${USCXML_INVOKERS}") + file(GLOB_RECURSE SMTP_INVOKER + smtp/*.cpp + smtp/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES SMTP_INVOKER) + add_library( + invoker_smtp SHARED + ${SMTP_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_smtp uscxml) + set_target_properties(invoker_smtp PROPERTIES FOLDER "Plugin Invoker") + else() + list (APPEND USCXML_FILES ${SMTP_INVOKER}) + endif() endif() -- cgit v0.12