From a61ef07b5eb3dacfc596a26cb1373356e5673dbb Mon Sep 17 00:00:00 2001 From: Stefan Radomski Date: Thu, 31 Jul 2014 23:05:47 +0200 Subject: Support for ignoring libraries when building and minimal builds --- CMakeLists.txt | 499 ++++++----- apps/uscxml-browser.cpp | 12 +- config.h.in | 1 + .../ioprocessor/adhoc/console/ConsoleFrame.java | 4 +- src/bindings/swig/csharp/uscxml.i | 4 +- src/bindings/swig/java/uscxml.i | 4 +- src/bindings/swig/wrapped/WrappedInvoker.h | 4 + src/uscxml/CMakeLists.txt | 26 +- src/uscxml/Factory.cpp | 80 +- src/uscxml/Interpreter.cpp | 6 +- src/uscxml/Interpreter.h | 6 +- src/uscxml/plugins/EventHandler.h | 4 +- src/uscxml/plugins/Invoker.h | 9 + src/uscxml/plugins/datamodel/CMakeLists.txt | 11 +- src/uscxml/plugins/element/CMakeLists.txt | 192 ++--- src/uscxml/plugins/invoker/CMakeLists.txt | 932 +++++++++++---------- src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h | 4 + src/uscxml/plugins/ioprocessor/CMakeLists.txt | 146 ++-- test/CMakeLists.txt | 135 +-- 19 files changed, 1116 insertions(+), 963 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cfe179c..c238d7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -312,6 +312,7 @@ else() endif() OPTION(ENABLE_GCOV "Compile with gcov support" OFF) +OPTION(BUILD_MINIMAL "Build only features mandated by specification" ON) OPTION(BUILD_DM_ECMA "Build with ECMAScript datamodel" ON) OPTION(BUILD_DM_XPATH "Build with XPath datamodel" ON) OPTION(BUILD_DM_PROLOG "Build with Prolog datamodel" ON) @@ -658,11 +659,21 @@ list (APPEND USCXML_CORE_LIBS ${EVENT_LIBRARY}) ################################################# # Optional libraries +OPTION(DISABLE_ALL "Ignore all optional libraries" OFF) +if (BUILD_MINIMAL) + SET(DISABLE_ALL ON) +endif() + + if (APPLE OR IOS) - find_library(AUDIOTOOLBOX AudioToolbox REQUIRED) - list (APPEND USCXML_OPT_LIBS ${AUDIOTOOLBOX}/AudioToolbox) - set(AUDIOTOOLBOX_FOUND ON) - + OPTION(DISABLE_AUDIOTOOLBOX "Ignore AudioToolbox" OFF) + if (NOT DISABLE_AUDIOTOOLBOX AND NOT DISABLE_ALL) + find_library(AUDIOTOOLBOX AudioToolbox REQUIRED) + list (APPEND USCXML_OPT_LIBS ${AUDIOTOOLBOX}/AudioToolbox) + set(AUDIOTOOLBOX_FOUND ON) + else() + set(AUDIOTOOLBOX_FOUND OFF) + endif() find_library(FOUNDATION_LIBRARY Foundation) list (APPEND USCXML_OPT_LIBS ${FOUNDATION_LIBRARY}/Foundation) @@ -676,36 +687,55 @@ if (APPLE OR IOS) endif() if (APPLE OR IOS) - find_library(JSC_LIBRARY JavaScriptCore) - list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) - set(JSC_FOUND ON) + OPTION(DISABLE_JSC "Ignore JavaScriptCore" OFF) + if (NOT DISABLE_JSC AND NOT DISABLE_ALL) + find_library(JSC_LIBRARY JavaScriptCore) + list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) + set(JSC_FOUND ON) + else() + set(JSC_FOUND OFF) + endif() else() - find_package(V8) - if (V8_FOUND) - include_directories(${V8_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) + OPTION(DISABLE_V8 "Ignore Google's v8" OFF) + if (NOT DISABLE_V8 AND NOT DISABLE_ALL) + find_package(V8) + if (V8_FOUND) + include_directories(${V8_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${V8_LIBRARY}) + endif() + else() + set(V8_FOUND OFF) endif() endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(Lua) -if (LUA_FOUND) - include_directories (${LUA_INCLUDE_DIR}) - include_directories(${PROJECT_SOURCE_DIR}/contrib/src/LuaBridge) - list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - - -find_package(OpenSSL) -if (OPENSSL_FOUND) - set(OPENSSL_HAS_ELIPTIC_CURVES OFF) - include_directories(${OPENSSL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENSSL_LIBRARIES}) - if (EXISTS ${OPENSSL_INCLUDE_DIR}/openssl/ec.h) - set(OPENSSL_HAS_ELIPTIC_CURVES ON) +OPTION(DISABLE_LUA "Ignore Lua" OFF) +if (NOT DISABLE_LUA AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(Lua) + if (LUA_FOUND) + include_directories (${LUA_INCLUDE_DIR}) + include_directories(${PROJECT_SOURCE_DIR}/contrib/src/LuaBridge) + list (APPEND USCXML_OPT_LIBS ${LUA_LIBRARIES}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(LUA_FOUND OFF) +endif() + +OPTION(DISABLE_SSL "Ignore OpenSSL" OFF) +if (NOT DISABLE_SSL AND NOT DISABLE_ALL) + find_package(OpenSSL) + if (OPENSSL_FOUND) + set(OPENSSL_HAS_ELIPTIC_CURVES OFF) + include_directories(${OPENSSL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENSSL_LIBRARIES}) + if (EXISTS ${OPENSSL_INCLUDE_DIR}/openssl/ec.h) + set(OPENSSL_HAS_ELIPTIC_CURVES ON) + endif() + endif() +else() + set(OPENSSL_FOUND OFF) endif() if (EVENT_SSL_FOUND AND OPENSSL_FOUND) @@ -713,189 +743,254 @@ if (EVENT_SSL_FOUND AND OPENSSL_FOUND) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(SWI) -if (SWI_FOUND) - if (SWI_CPP_INCLUDE_DIR) - include_directories(${SWI_CPP_INCLUDE_DIR}) - else() - include_directories(${PROJECT_SOURCE_DIR}/contrib/src/swi-pl) - endif() - include_directories(${SWI_INCLUDE_DIR}) - if (BUILD_PREFER_STATIC_LIBRARIES) - find_package(GMP) - find_package(Curses) - if (GMP_FOUND AND CURSES_FOUND) - list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY} ${GMP_LIBRARY} ${CURSES_LIBRARIES}) +OPTION(DISABLE_SWI "Ignore SWI Prolog" OFF) +if (NOT DISABLE_SWI AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(SWI) + if (SWI_FOUND) + if (SWI_CPP_INCLUDE_DIR) + include_directories(${SWI_CPP_INCLUDE_DIR}) else() - message("Not building datamodel with static SWI without NCurses and GMP") - set(SWI_FOUND OFF) + include_directories(${PROJECT_SOURCE_DIR}/contrib/src/swi-pl) + endif() + include_directories(${SWI_INCLUDE_DIR}) + if (BUILD_PREFER_STATIC_LIBRARIES) + find_package(GMP) + find_package(Curses) + if (GMP_FOUND AND CURSES_FOUND) + list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY} ${GMP_LIBRARY} ${CURSES_LIBRARIES}) + else() + message("Not building datamodel with static SWI without NCurses and GMP") + set(SWI_FOUND OFF) + endif() + else() + list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY}) endif() - else() - list (APPEND USCXML_OPT_LIBS ${SWI_LIBRARY}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(SWI_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -find_package(Sqlite3) -if (SQLITE3_FOUND) -endif() - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(FFMPEG) -if (FFMPEG_FOUND) - include_directories (${FFMPEG_INCLUDE_DIRS}) - list (APPEND USCXML_OPT_LIBS ${FFMPEG_LIBRARIES}) - # required with static ffmpeg builds - # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(LIBICAL) -if (LIBICAL_FOUND) - include_directories (${LIBICAL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${LIBICAL_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -if (NOT DEFINED ENV{LIBJINGLE_ROOT_DIR}) - set(ENV{LIBJINGLE_ROOT_DIR} "/Users/sradomski/Documents/TK/Code/webrtc-work/trunk") -endif() - -find_package(LIBJINGLE) -if (LIBJINGLE_FOUND) - include_directories (${LIBJINGLE_INCLUDE_DIRS}) - list (APPEND USCXML_OPT_LIBS ${LIBJINGLE_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -find_package(Expect) -find_package(TCL) -if (EXPECT_FOUND AND TCL_FOUND) - include_directories (${EXPECT_INCLUDE_DIR}) - include_directories (${TCL_INCLUDE_PATH}) - list (APPEND USCXML_OPT_LIBS ${EXPECT_LIBRARY}) - list (APPEND USCXML_OPT_LIBS ${TCL_LIBRARY}) -endif() - -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(LibPurple) -if (LIBPURPLE_FOUND) - find_package(ICONV) - find_package(GLIB2) - find_package(GObject) - if (GLIB2_FOUND AND ICONV_FOUND AND GOBJECT_FOUND) - include_directories (${LIBPURPLE_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${LIBPURPLE_LIBRARY}) - include_directories (${GLIB2_INCLUDE_DIRS}) - list (APPEND USCXML_OPT_LIBS ${GLIB2_LIBRARIES}) - include_directories (${ICONV_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) - include_directories (${GOBJECT_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${GOBJECT_LIBRARIES}) - else() - set(LIBPURPLE_FOUND OFF) - endif() + +OPTION(DISABLE_SQLITE "Ignore Sqlite3" OFF) +if (NOT DISABLE_SQLITE AND NOT DISABLE_ALL) + find_package(Sqlite3) + if (SQLITE3_FOUND) + endif() +else() + set(SQLITE3_FOUND OFF) +endif() + +OPTION(DISABLE_FFMPEG "Ignore FFMpeg" OFF) +if (NOT DISABLE_FFMPEG AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(FFMPEG) + if (FFMPEG_FOUND) + include_directories (${FFMPEG_INCLUDE_DIRS}) + list (APPEND USCXML_OPT_LIBS ${FFMPEG_LIBRARIES}) + # required with static ffmpeg builds + # set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic") + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(FFMPEG_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +OPTION(DISABLE_ICAL "Ignore iCal" OFF) +if (NOT DISABLE_ICAL AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(LIBICAL) + if (LIBICAL_FOUND) + include_directories (${LIBICAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${LIBICAL_LIBRARIES}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) -if (WIN32) - find_package(UMUNDO COMPONENTS convenience) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + if (NOT DEFINED ENV{LIBJINGLE_ROOT_DIR}) + set(ENV{LIBJINGLE_ROOT_DIR} "/Users/sradomski/Documents/TK/Code/webrtc-work/trunk") + endif() else() - find_package(UMUNDO COMPONENTS rpc serial core) - # find_package(UMUNDO COMPONENTS convenience) + set(LIBICAL_FOUND OFF) endif() -if (UMUNDO_FOUND) - include_directories (${UMUNDO_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${UMUNDO_LIBRARIES}) -# add_definitions("-DUMUNDO_STATIC") + +OPTION(DISABLE_WEBRTC "Ignore libjingle (WebRTC)" OFF) +if (NOT DISABLE_WEBRTC AND NOT DISABLE_ALL) + find_package(LIBJINGLE) + if (LIBJINGLE_FOUND) + include_directories (${LIBJINGLE_INCLUDE_DIRS}) + list (APPEND USCXML_OPT_LIBS ${LIBJINGLE_LIBRARIES}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(LIBJINGLE_FOUND OFF) +endif() + +OPTION(DISABLE_EXPECT "Ignore TCL/Expect" OFF) +if (NOT DISABLE_EXPECT AND NOT DISABLE_ALL) + find_package(Expect) + find_package(TCL) + if (EXPECT_FOUND AND TCL_FOUND) + include_directories (${EXPECT_INCLUDE_DIR}) + include_directories (${TCL_INCLUDE_PATH}) + list (APPEND USCXML_OPT_LIBS ${EXPECT_LIBRARY}) + list (APPEND USCXML_OPT_LIBS ${TCL_LIBRARY}) + endif() +else() + set(EXPECT_FOUND OFF) + set(TCL_FOUND OFF) endif() -if (UNIX) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) # link dynamically! -elseif(WIN32) - if (ENV{OSG_ROOT} STREQUAL "") - set(ENV{OSG_ROOT} "C:/Program Files/OpenSceneGraph-3.0.1") +OPTION(DISABLE_LIBPURPLE "Ignore libpurple (instant messaging)" OFF) +if (NOT DISABLE_LIBPURPLE AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(LibPurple) + if (LIBPURPLE_FOUND) + find_package(ICONV) + find_package(GLIB2) + find_package(GObject) + if (GLIB2_FOUND AND ICONV_FOUND AND GOBJECT_FOUND) + include_directories (${LIBPURPLE_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${LIBPURPLE_LIBRARY}) + include_directories (${GLIB2_INCLUDE_DIRS}) + list (APPEND USCXML_OPT_LIBS ${GLIB2_LIBRARIES}) + include_directories (${ICONV_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) + include_directories (${GOBJECT_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${GOBJECT_LIBRARIES}) + else() + set(LIBPURPLE_FOUND OFF) + endif() endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(LIBPURPLE_FOUND OFF) endif() -find_package(OpenSceneGraph COMPONENTS osgViewer osgGA osgText osgFX osgManipulator osgDB osgUtil OpenThreads) -find_package(OpenGL) -if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) - include_directories (${OPENSCENEGRAPH_INCLUDE_DIRS}) - include_directories (${OPENGL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES}) -endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) - -set(CMAKE_FIND_FRAMEWORK "FIRST") -find_package(OpenAL) -if (OPENAL_FOUND) - list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) - if (APPLE OR IOS) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}/OpenAL) + +OPTION(DISABLE_UMUNDO "Ignore uMundo" OFF) +if (NOT DISABLE_UMUNDO AND NOT DISABLE_ALL) + if (WIN32) + find_package(UMUNDO COMPONENTS convenience) else() - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + find_package(UMUNDO COMPONENTS rpc serial core) + # find_package(UMUNDO COMPONENTS convenience) + endif() + if (UMUNDO_FOUND) + include_directories (${UMUNDO_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${UMUNDO_LIBRARIES}) + # add_definitions("-DUMUNDO_STATIC") + endif() +else() + set(UMUNDO_FOUND OFF) +endif() + +OPTION(DISABLE_OSG "Ignore OpenSceneGraph" OFF) +if (NOT DISABLE_OSG AND NOT DISABLE_ALL) + if (UNIX) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) # link dynamically! + elseif(WIN32) + if (ENV{OSG_ROOT} STREQUAL "") + set(ENV{OSG_ROOT} "C:/Program Files/OpenSceneGraph-3.0.1") + endif() + endif() + find_package(OpenSceneGraph COMPONENTS osgViewer osgGA osgText osgFX osgManipulator osgDB osgUtil OpenThreads) + find_package(OpenGL) + if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) + include_directories (${OPENSCENEGRAPH_INCLUDE_DIRS}) + include_directories (${OPENGL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENSCENEGRAPH_LIBRARIES} ${OPENGL_LIBRARIES}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) else() - find_package(OpenALKCAT) + set(OPENSCENEGRAPH_FOUND OFF) + set(OPENGL_FOUND OFF) +endif() + +OPTION(DISABLE_OPENAL "Ignore OpenAL" OFF) +if (NOT DISABLE_OPENAL AND NOT DISABLE_ALL) + set(CMAKE_FIND_FRAMEWORK "FIRST") + find_package(OpenAL) if (OPENAL_FOUND) list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + if (APPLE OR IOS) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}/OpenAL) + else() + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + endif() + else() + find_package(OpenALKCAT) + if (OPENAL_FOUND) + list (APPEND USCXML_INCLUDE_DIRS ${OPENAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + endif() endif() + set(CMAKE_FIND_FRAMEWORK "LAST") +else() + set(OPENAL_FOUND OFF) endif() -set(CMAKE_FIND_FRAMEWORK "LAST") if (NOT AUDIOTOOLBOX_FOUND) - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) - find_package(LIBSNDFILE) - if (LIBSNDFILE_FOUND) - list (APPEND USCXML_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${LIBSNDFILE_LIBRARY}) + OPTION(DISABLE_LIBSNDFILE "Ignore libsndfile" OFF) + if (NOT DISABLE_LIBSNDFILE AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(LIBSNDFILE) + if (LIBSNDFILE_FOUND) + list (APPEND USCXML_INCLUDE_DIRS ${LIBSNDFILE_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${LIBSNDFILE_LIBRARY}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) + else() + set(LIBSNDFILE_FOUND OFF) endif() - set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(MILES) -#set(JPEG_ROOT_PATH "" CACHE STRING "Where to find libjpeg") -if (MILES_FOUND) - - if (NOT WIN32) - # openal is only needed for miles - find_package(OpenAL) - find_package(JPEG) - find_package(ICONV) +OPTION(DISABLE_MILES "Ignore miles" OFF) +if (NOT DISABLE_MILES AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(MILES) + #set(JPEG_ROOT_PATH "" CACHE STRING "Where to find libjpeg") + if (MILES_FOUND) + if (NOT WIN32) + # openal is only needed for miles + find_package(OpenAL) + find_package(JPEG) + find_package(ICONV) - if (OPENAL_FOUND AND ICONV_FOUND AND JPEG_FOUND) + if (OPENAL_FOUND AND ICONV_FOUND AND JPEG_FOUND) + include_directories (${MILES_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) + include_directories (${ICONV_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) + include_directories (${JPEG_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${JPEG_LIBRARIES}) + include_directories (${OPENAL_INCLUDE_DIR}) + list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) + else() + set(MILES_FOUND OFF) + endif() + else() include_directories (${MILES_INCLUDE_DIR}) list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) - include_directories (${ICONV_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${ICONV_LIBRARIES}) - include_directories (${JPEG_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${JPEG_LIBRARIES}) - include_directories (${OPENAL_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${OPENAL_LIBRARY}) - else() - set(MILES_FOUND OFF) endif() - else() - include_directories (${MILES_INCLUDE_DIR}) - list (APPEND USCXML_OPT_LIBS ${MILES_LIBRARIES}) endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(MILES_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) -find_package(Protobuf) -if (PROTOBUF_FOUND) - include_directories(${PROTOBUF_INCLUDE_DIRS}) - LIST(APPEND USCXML_OPT_LIBS optimized ${PROTOBUF_LIBRARY}) - LIST(APPEND USCXML_OPT_LIBS debug ${PROTOBUF_LIBRARY_DEBUG}) +OPTION(DISABLE_PROTOBUF "Ignore protobuf" OFF) +if (NOT DISABLE_PROTOBUF AND NOT DISABLE_ALL) + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_SHARED}) + find_package(Protobuf) + if (PROTOBUF_FOUND) + include_directories(${PROTOBUF_INCLUDE_DIRS}) + LIST(APPEND USCXML_OPT_LIBS optimized ${PROTOBUF_LIBRARY}) + LIST(APPEND USCXML_OPT_LIBS debug ${PROTOBUF_LIBRARY_DEBUG}) + endif() + set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) +else() + set(PROTOBUF_FOUND OFF) endif() -set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_FIND_LIBRARY_SUFFIXES_ORIG}) ################################################# # Gather source files @@ -1028,33 +1123,35 @@ if (NOT CMAKE_CROSSCOMPILING) set_target_properties(uscxml-browser PROPERTIES FOLDER "Apps") install_executable(TARGETS uscxml-browser COMPONENT tools) - if (WIN32) - add_executable(uscxml-transform apps/uscxml-transform.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) - else() - add_executable(uscxml-transform apps/uscxml-transform.cpp) - endif() - target_link_libraries(uscxml-transform uscxml) - if (NOT CMAKE_CROSSCOMPILING) - if (ENABLE_COTIRE) - set_target_properties(uscxml-transform PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + if (NOT BUILD_MINIMAL) + if (WIN32) + add_executable(uscxml-transform apps/uscxml-transform.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) + else() + add_executable(uscxml-transform apps/uscxml-transform.cpp) endif() - endif() - set_target_properties(uscxml-transform PROPERTIES FOLDER "Apps") - install_executable(TARGETS uscxml-transform COMPONENT tools) + target_link_libraries(uscxml-transform uscxml) + if (NOT CMAKE_CROSSCOMPILING) + if (ENABLE_COTIRE) + set_target_properties(uscxml-transform PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + endif() + endif() + set_target_properties(uscxml-transform PROPERTIES FOLDER "Apps") + install_executable(TARGETS uscxml-transform COMPONENT tools) - if (WIN32) - add_executable(uscxml-dot apps/uscxml-dot.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) - else() - add_executable(uscxml-dot apps/uscxml-dot.cpp) - endif() - target_link_libraries(uscxml-dot uscxml) - if (NOT CMAKE_CROSSCOMPILING) - if (ENABLE_COTIRE) - set_target_properties(uscxml-dot PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + if (WIN32) + add_executable(uscxml-dot apps/uscxml-dot.cpp ${PROJECT_SOURCE_DIR}/contrib/src/getopt/getopt.c) + else() + add_executable(uscxml-dot apps/uscxml-dot.cpp) + endif() + target_link_libraries(uscxml-dot uscxml) + if (NOT CMAKE_CROSSCOMPILING) + if (ENABLE_COTIRE) + set_target_properties(uscxml-dot PROPERTIES COTIRE_ADD_UNITY_BUILD FALSE) + endif() endif() + set_target_properties(uscxml-dot PROPERTIES FOLDER "Apps") + install_executable(TARGETS uscxml-dot COMPONENT tools) endif() - set_target_properties(uscxml-dot PROPERTIES FOLDER "Apps") - install_executable(TARGETS uscxml-dot COMPONENT tools) if (PROTOBUF_FOUND AND OFF) file(GLOB W3C-MMI-COMMON ${PROJECT_SOURCE_DIR}/apps/w3c-mmi/*.cpp ${PROJECT_SOURCE_DIR}/apps/w3c-mmi/*.h) diff --git a/apps/uscxml-browser.cpp b/apps/uscxml-browser.cpp index f9a06bb..4e21ec6 100644 --- a/apps/uscxml-browser.cpp +++ b/apps/uscxml-browser.cpp @@ -1,7 +1,10 @@ #include "uscxml/config.h" #include "uscxml/Interpreter.h" #include "uscxml/DOMUtils.h" -#include "uscxml/debug/DebuggerServlet.h" + +#ifndef BUILD_MINIMAL +# include "uscxml/debug/DebuggerServlet.h" +#endif #include #include "uscxml/Factory.h" @@ -159,11 +162,13 @@ int main(int argc, char** argv) { } HTTPServer::getInstance(options.httpPort, options.wsPort, sslConf); +#ifndef BUILD_MINIMAL DebuggerServlet* debugger; if (options.withDebugger) { debugger = new DebuggerServlet(); HTTPServer::getInstance()->registerServlet("/debug", debugger); } +#endif // instantiate and configure interpreters std::list interpreters; @@ -184,9 +189,12 @@ int main(int argc, char** argv) { VerboseMonitor* vm = new VerboseMonitor(); interpreter.addMonitor(vm); } + +#ifndef BUILD_MINIMAL if (options.withDebugger) { interpreter.addMonitor(debugger); } +#endif interpreters.push_back(interpreter); @@ -220,11 +228,13 @@ int main(int argc, char** argv) { } } +#ifndef BUILD_MINIMAL if (options.withDebugger) { // idle and wait for CTRL+C or debugging events while(true) tthread::this_thread::sleep_for(tthread::chrono::seconds(1)); } +#endif } catch (Event e) { std::cout << e << std::endl; } diff --git a/config.h.in b/config.h.in index 814760e..0ea3b16 100644 --- a/config.h.in +++ b/config.h.in @@ -47,6 +47,7 @@ #cmakedefine SWI_BINARY "@SWI_BINARY@" /** whether we want some feature */ +#cmakedefine BUILD_MINIMAL #cmakedefine BUILD_DM_PROLOG #cmakedefine BUILD_DM_PROMELA #cmakedefine BUILD_DM_ECMA diff --git a/embedding/java/src/org/uscxml/tests/ioprocessor/adhoc/console/ConsoleFrame.java b/embedding/java/src/org/uscxml/tests/ioprocessor/adhoc/console/ConsoleFrame.java index 0dbe528..aced20e 100644 --- a/embedding/java/src/org/uscxml/tests/ioprocessor/adhoc/console/ConsoleFrame.java +++ b/embedding/java/src/org/uscxml/tests/ioprocessor/adhoc/console/ConsoleFrame.java @@ -26,7 +26,9 @@ public class ConsoleFrame extends Frame { + " " + " " - + " " + + " " + + " " + + " " + " " + " " + " " diff --git a/src/bindings/swig/csharp/uscxml.i b/src/bindings/swig/csharp/uscxml.i index 359f640..eb7926e 100644 --- a/src/bindings/swig/csharp/uscxml.i +++ b/src/bindings/swig/csharp/uscxml.i @@ -57,7 +57,7 @@ typedef uscxml::ExecutableContentImpl ExecutableContentImpl; #include "../../../uscxml/Interpreter.h" #include "../../../uscxml/concurrency/BlockingQueue.h" #include "../../../uscxml/server/HTTPServer.h" -#include "../../../uscxml/debug/DebuggerServlet.h" +//#include "../../../uscxml/debug/DebuggerServlet.h" #include "../wrapped/WrappedInvoker.h" #include "../wrapped/WrappedDataModel.h" @@ -382,7 +382,7 @@ using System.Runtime.InteropServices; %include "../../../uscxml/Interpreter.h" %include "../../../uscxml/concurrency/BlockingQueue.h" %include "../../../uscxml/server/HTTPServer.h" -%include "../../../uscxml/debug/DebuggerServlet.h" +//%include "../../../uscxml/debug/DebuggerServlet.h" %include "../../../uscxml/messages/Blob.h" %include "../../../uscxml/messages/Data.h" diff --git a/src/bindings/swig/java/uscxml.i b/src/bindings/swig/java/uscxml.i index 036b244..7ec8218 100644 --- a/src/bindings/swig/java/uscxml.i +++ b/src/bindings/swig/java/uscxml.i @@ -56,7 +56,7 @@ typedef uscxml::ExecutableContentImpl ExecutableContentImpl; #include "../../../uscxml/Interpreter.h" #include "../../../uscxml/concurrency/BlockingQueue.h" #include "../../../uscxml/server/HTTPServer.h" -#include "../../../uscxml/debug/DebuggerServlet.h" +//#include "../../../uscxml/debug/DebuggerServlet.h" #include "../wrapped/WrappedInvoker.h" #include "../wrapped/WrappedDataModel.h" @@ -410,7 +410,7 @@ import java.util.LinkedList; %include "../../../uscxml/Interpreter.h" %include "../../../uscxml/concurrency/BlockingQueue.h" %include "../../../uscxml/server/HTTPServer.h" -%include "../../../uscxml/debug/DebuggerServlet.h" +//%include "../../../uscxml/debug/DebuggerServlet.h" %include "../../../uscxml/messages/Blob.h" %include "../../../uscxml/messages/Data.h" diff --git a/src/bindings/swig/wrapped/WrappedInvoker.h b/src/bindings/swig/wrapped/WrappedInvoker.h index 5e0f39e..1220746 100644 --- a/src/bindings/swig/wrapped/WrappedInvoker.h +++ b/src/bindings/swig/wrapped/WrappedInvoker.h @@ -52,6 +52,10 @@ public: virtual void invoke(const InvokeRequest& req) {} virtual void uninvoke() {} + virtual bool deleteOnUninvoke() { + return false; + } + virtual WrappedInvoker* create(const Interpreter& interpreter) { return new WrappedInvoker(); } diff --git a/src/uscxml/CMakeLists.txt b/src/uscxml/CMakeLists.txt index c38bcbf..d74f512 100644 --- a/src/uscxml/CMakeLists.txt +++ b/src/uscxml/CMakeLists.txt @@ -32,19 +32,21 @@ file(GLOB_RECURSE USCXML_MESSAGES source_group("Interpreter" FILES ${USCXML_MESSAGES}) list (APPEND USCXML_FILES ${USCXML_MESSAGES}) -file(GLOB_RECURSE USCXML_DEBUG - debug/*.cpp - debug/*.h -) -source_group("Interpreter" FILES ${USCXML_DEBUG}) -list (APPEND USCXML_FILES ${USCXML_DEBUG}) +if (NOT BUILD_MINIMAL) + file(GLOB_RECURSE USCXML_DEBUG + debug/*.cpp + debug/*.h + ) + source_group("Interpreter" FILES ${USCXML_DEBUG}) + list (APPEND USCXML_FILES ${USCXML_DEBUG}) -file(GLOB_RECURSE USCXML_TRANSFORM - transform/*.cpp - transform/*.h -) -source_group("Interpreter" FILES ${USCXML_TRANSFORM}) -list (APPEND USCXML_FILES ${USCXML_TRANSFORM}) + file(GLOB_RECURSE USCXML_TRANSFORM + transform/*.cpp + transform/*.h + ) + source_group("Interpreter" FILES ${USCXML_TRANSFORM}) + list (APPEND USCXML_FILES ${USCXML_TRANSFORM}) +endif() file(GLOB_RECURSE USCXML_INTERPRETERS interpreter/*.cpp diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp index 62756fc..e9b651f 100644 --- a/src/uscxml/Factory.cpp +++ b/src/uscxml/Factory.cpp @@ -35,19 +35,32 @@ #else # include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h" -# include "uscxml/plugins/ioprocessor/comet/CometIOProcessor.h" # include "uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h" # include "uscxml/plugins/invoker/scxml/USCXMLInvoker.h" -# include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" -# include "uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h" -# 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/imap/IMAPInvoker.h" - -# ifdef CURL_HAS_SMTP -# include "uscxml/plugins/invoker/smtp/SMTPInvoker.h" -# endif + +# ifndef BUILD_MINIMAL +# include "uscxml/plugins/invoker/imap/IMAPInvoker.h" +# ifdef CURL_HAS_SMTP +# include "uscxml/plugins/invoker/smtp/SMTPInvoker.h" +# endif +# include "uscxml/plugins/invoker/xhtml/XHTMLInvoker.h" +# include "uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h" +# include "uscxml/plugins/invoker/system/SystemInvoker.h" +# include "uscxml/plugins/invoker/http/HTTPServletInvoker.h" +# include "uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h" + +# include "uscxml/plugins/datamodel/xpath/XPathDataModel.h" +# include "uscxml/plugins/datamodel/promela/PromelaDataModel.h" + +# include "uscxml/plugins/element/file/FileElement.h" +# include "uscxml/plugins/element/fetch/FetchElement.h" +# include "uscxml/plugins/element/respond/RespondElement.h" +# include "uscxml/plugins/element/postpone/PostponeElement.h" + +# include "uscxml/plugins/ioprocessor/comet/CometIOProcessor.h" + +# endif + #ifdef PROTOBUF_FOUND //# include "uscxml/plugins/ioprocessor/modality/MMIHTTPIOProcessor.h" @@ -108,15 +121,6 @@ # include "uscxml/plugins/datamodel/lua/LuaDataModel.h" # endif -#include "uscxml/plugins/datamodel/xpath/XPathDataModel.h" -#include "uscxml/plugins/datamodel/promela/PromelaDataModel.h" - - -# include "uscxml/plugins/element/file/FileElement.h" -# include "uscxml/plugins/element/fetch/FetchElement.h" -# include "uscxml/plugins/element/respond/RespondElement.h" -# include "uscxml/plugins/element/postpone/PostponeElement.h" - # if 0 # include "uscxml/plugins/element/mmi/MMIEvents.h" # endif @@ -211,7 +215,8 @@ void Factory::registerPlugins() { if (_pluginPath.length() > 0) LOG(WARNING) << "Plugin path is given, but uscxml is compiled without support"; -#if 1 +#ifndef BUILD_MINIMAL + # if (defined UMUNDO_FOUND && defined PROTOBUF_FOUND) { UmundoInvoker* invoker = new UmundoInvoker(); @@ -223,7 +228,6 @@ void Factory::registerPlugins() { registerInvoker(invoker); } #endif -#endif #ifdef MILES_FOUND { @@ -339,8 +343,8 @@ void Factory::registerPlugins() { } #endif - // these are always available -#if 1 + + // these are always available when not building minimal { XHTMLInvoker* invoker = new XHTMLInvoker(); registerInvoker(invoker); @@ -350,10 +354,6 @@ void Factory::registerPlugins() { registerInvoker(invoker); } { - USCXMLInvoker* invoker = new USCXMLInvoker(); - registerInvoker(invoker); - } - { HTTPServletInvoker* invoker = new HTTPServletInvoker(); registerInvoker(invoker); } @@ -370,14 +370,6 @@ void Factory::registerPlugins() { registerInvoker(invoker); } { - BasicHTTPIOProcessor* ioProcessor = new BasicHTTPIOProcessor(); - registerIOProcessor(ioProcessor); - } - { - SCXMLIOProcessor* ioProcessor = new SCXMLIOProcessor(); - registerIOProcessor(ioProcessor); - } - { FetchElement* element = new FetchElement(); registerExecutableContent(element); } @@ -395,6 +387,22 @@ void Factory::registerPlugins() { } #endif + + { + USCXMLInvoker* invoker = new USCXMLInvoker(); + registerInvoker(invoker); + } + + { + BasicHTTPIOProcessor* ioProcessor = new BasicHTTPIOProcessor(); + registerIOProcessor(ioProcessor); + } + + { + SCXMLIOProcessor* ioProcessor = new SCXMLIOProcessor(); + registerIOProcessor(ioProcessor); + } + #endif } diff --git a/src/uscxml/Interpreter.cpp b/src/uscxml/Interpreter.cpp index b8e4bfe..c202246 100644 --- a/src/uscxml/Interpreter.cpp +++ b/src/uscxml/Interpreter.cpp @@ -1401,7 +1401,7 @@ void InterpreterImpl::invoke(const Arabica::DOM::Node& element) { if (invoker) { tthread::lock_guard lock(_pluginMutex); try { - + if (!invoker.getElement()) invoker.setElement(Element(element)); @@ -1463,12 +1463,12 @@ void InterpreterImpl::cancelInvoke(const Arabica::DOM::Node& elemen USCXML_MONITOR_CALLBACK3(beforeUninvoking, Element(element), invokeId) _invokers[invokeId].uninvoke(); - + /** * This should not be necessary. Most invokers have their "clean-up" code in their * destructor and not their uninvoke method - we need to refactor them all! */ - if (_dontDestructOnUninvoke.find(invokeId) == _dontDestructOnUninvoke.end()) + if (_invokers[invokeId].deleteOnUninvoke()) _invokers.erase(invokeId); USCXML_MONITOR_CALLBACK3(beforeUninvoking, Element(element), invokeId) diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h index dc889e3..3cd6016 100644 --- a/src/uscxml/Interpreter.h +++ b/src/uscxml/Interpreter.h @@ -364,7 +364,7 @@ public: nameIter++; } } - + const std::map& getIOProcessors() { return _ioProcessors; } @@ -383,7 +383,7 @@ public: _invokers[invokeId].setInterpreter(this); _invokers[invokeId].setInvokeId(invokeId); } - + const std::map& getInvokers() { return _invokers; } @@ -474,7 +474,7 @@ protected: bool _domIsSetup; bool _userSuppliedDataModel; std::set _dontDestructOnUninvoke; - + bool _isStarted; bool _isRunning; diff --git a/src/uscxml/plugins/EventHandler.h b/src/uscxml/plugins/EventHandler.h index 4078cfe..2b41ae5 100644 --- a/src/uscxml/plugins/EventHandler.h +++ b/src/uscxml/plugins/EventHandler.h @@ -52,7 +52,7 @@ public: std::string getType() { return _type; } - + void setElement(const Arabica::DOM::Element& element) { _element = element; } @@ -104,7 +104,7 @@ public: void setInvokeId(const std::string& invokeId) { _impl->setInvokeId(invokeId); } - + void setType(const std::string& type) { _impl->setType(type); } diff --git a/src/uscxml/plugins/Invoker.h b/src/uscxml/plugins/Invoker.h index 4a142e4..dd3d66d 100644 --- a/src/uscxml/plugins/Invoker.h +++ b/src/uscxml/plugins/Invoker.h @@ -34,6 +34,11 @@ public: virtual ~InvokerImpl() {} virtual void invoke(const InvokeRequest& req) = 0; virtual void uninvoke() {} + + virtual bool deleteOnUninvoke() { + return true; + } + virtual boost::shared_ptr create(InterpreterImpl* interpreter) = 0; }; @@ -70,6 +75,10 @@ public: _impl->uninvoke(); } + virtual bool deleteOnUninvoke() { + return _impl->deleteOnUninvoke(); + } + protected: boost::shared_ptr _impl; }; diff --git a/src/uscxml/plugins/datamodel/CMakeLists.txt b/src/uscxml/plugins/datamodel/CMakeLists.txt index acf7344..76f928b 100644 --- a/src/uscxml/plugins/datamodel/CMakeLists.txt +++ b/src/uscxml/plugins/datamodel/CMakeLists.txt @@ -30,7 +30,8 @@ if (BUILD_DM_ECMA) list (APPEND USCXML_FILES ${JSC_DOM}) list (APPEND USCXML_OPT_LIBS ${JSC_LIBRARY}) endif() - else() + + elseif(V8_FOUND) # GOOGLE V8 ecmascript datamodel set(USCXML_DATAMODELS "ecmascript(V8) ${USCXML_DATAMODELS}") @@ -81,7 +82,7 @@ list (APPEND USCXML_FILES ${NULL_DATAMODEL}) # Lua datamodel -if (BUILD_DM_LUA AND LUA_FOUND) +if (BUILD_DM_LUA AND LUA_FOUND AND NOT BUILD_MINIMAL) set(USCXML_DATAMODELS "lua ${USCXML_DATAMODELS}") file(GLOB LUA_DATAMODEL lua/*.cpp @@ -105,7 +106,7 @@ endif() # XPath datamodel -if (BUILD_DM_XPATH) +if (BUILD_DM_XPATH AND NOT BUILD_MINIMAL) set(USCXML_DATAMODELS "xpath ${USCXML_DATAMODELS}") file(GLOB XPATH_DATAMODEL xpath/*.cpp @@ -125,7 +126,7 @@ endif() # SWI PROLOG datamodel -if (SWI_FOUND AND BUILD_DM_PROLOG) +if (SWI_FOUND AND BUILD_DM_PROLOG AND NOT BUILD_MINIMAL) set(USCXML_DATAMODELS "prolog ${USCXML_DATAMODELS}") configure_file(${CMAKE_CURRENT_SOURCE_DIR}/prolog/swi/SWIConfig.h.in ${CMAKE_BINARY_DIR}/uscxml/SWIConfig.h) @@ -164,7 +165,7 @@ endif() # Promela datamodel -if (BUILD_DM_PROMELA) +if (BUILD_DM_PROMELA AND NOT BUILD_MINIMAL) set(USCXML_DATAMODELS "promela ${USCXML_DATAMODELS}") file(GLOB_RECURSE PROMELA_DATAMODEL diff --git a/src/uscxml/plugins/element/CMakeLists.txt b/src/uscxml/plugins/element/CMakeLists.txt index 16a9a1d..e2142ca 100644 --- a/src/uscxml/plugins/element/CMakeLists.txt +++ b/src/uscxml/plugins/element/CMakeLists.txt @@ -1,109 +1,113 @@ -# Fetch element +if (NOT BUILD_MINIMAL) -set(USCXML_ELEMENTS "fetch ${USCXML_ELEMENTS}") -file(GLOB_RECURSE FETCH_ELEMENT - fetch/*.cpp - fetch/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${FETCH_ELEMENT}) - add_library( - element_fetch SHARED - ${FETCH_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_fetch uscxml) - set_target_properties(element_fetch PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_fetch PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_fetch PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${FETCH_ELEMENT}) -endif() + # Fetch element -# MMI elements + set(USCXML_ELEMENTS "fetch ${USCXML_ELEMENTS}") + file(GLOB_RECURSE FETCH_ELEMENT + fetch/*.cpp + fetch/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${FETCH_ELEMENT}) + add_library( + element_fetch SHARED + ${FETCH_ELEMENT} + "../Plugins.cpp") + target_link_libraries(element_fetch uscxml) + set_target_properties(element_fetch PROPERTIES FOLDER "Plugin Element") + set_target_properties(element_fetch PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(element_fetch PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${FETCH_ELEMENT}) + endif() -# file(GLOB_RECURSE MMI_ELEMENT -# mmi/*.cpp -# mmi/*.h -# ) -# if (BUILD_AS_PLUGINS) -# source_group("" FILES ${MMI_ELEMENT}) -# add_library( -# element_mmi SHARED -# ${MMI_ELEMENT} -# "../Plugins.cpp") -# target_link_libraries(element_mmi uscxml) -# set_target_properties(element_mmi PROPERTIES FOLDER "Plugin Element") -# set_target_properties(element_mmi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") -# set_target_properties(element_mmi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -# else() -# list (APPEND USCXML_FILES ${MMI_ELEMENT}) -# endif() + # MMI elements + # file(GLOB_RECURSE MMI_ELEMENT + # mmi/*.cpp + # mmi/*.h + # ) + # if (BUILD_AS_PLUGINS) + # source_group("" FILES ${MMI_ELEMENT}) + # add_library( + # element_mmi SHARED + # ${MMI_ELEMENT} + # "../Plugins.cpp") + # target_link_libraries(element_mmi uscxml) + # set_target_properties(element_mmi PROPERTIES FOLDER "Plugin Element") + # set_target_properties(element_mmi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + # set_target_properties(element_mmi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + # else() + # list (APPEND USCXML_FILES ${MMI_ELEMENT}) + # endif() -# Postpone element -set(USCXML_ELEMENTS "postpone ${USCXML_ELEMENTS}") -file(GLOB_RECURSE POSTPONE_ELEMENT - postpone/*.cpp - postpone/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${POSTPONE_ELEMENT}) - add_library( - element_postpone SHARED - ${POSTPONE_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_postpone uscxml) - set_target_properties(element_postpone PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_postpone PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_postpone PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${POSTPONE_ELEMENT}) -endif() + # Postpone element + set(USCXML_ELEMENTS "postpone ${USCXML_ELEMENTS}") + file(GLOB_RECURSE POSTPONE_ELEMENT + postpone/*.cpp + postpone/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${POSTPONE_ELEMENT}) + add_library( + element_postpone SHARED + ${POSTPONE_ELEMENT} + "../Plugins.cpp") + target_link_libraries(element_postpone uscxml) + set_target_properties(element_postpone PROPERTIES FOLDER "Plugin Element") + set_target_properties(element_postpone PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(element_postpone PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${POSTPONE_ELEMENT}) + endif() -# File element -set(USCXML_ELEMENTS "file ${USCXML_ELEMENTS}") -file(GLOB_RECURSE FILE_ELEMENT - file/*.cpp - file/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${FILE_ELEMENT}) - add_library( - element_file SHARED - ${FILE_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_file uscxml) - set_target_properties(element_file PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_file PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${FILE_ELEMENT}) -endif() + # File element + set(USCXML_ELEMENTS "file ${USCXML_ELEMENTS}") + file(GLOB_RECURSE FILE_ELEMENT + file/*.cpp + file/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${FILE_ELEMENT}) + add_library( + element_file SHARED + ${FILE_ELEMENT} + "../Plugins.cpp") + target_link_libraries(element_file uscxml) + set_target_properties(element_file PROPERTIES FOLDER "Plugin Element") + set_target_properties(element_file PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(element_file PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${FILE_ELEMENT}) + endif() -# Respond element -set(USCXML_ELEMENTS "respond ${USCXML_ELEMENTS}") -file(GLOB_RECURSE RESPOND_ELEMENT - respond/*.cpp - respond/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${RESPOND_ELEMENT}) - add_library( - element_respond SHARED - ${RESPOND_ELEMENT} - "../Plugins.cpp") - target_link_libraries(element_respond uscxml) - set_target_properties(element_respond PROPERTIES FOLDER "Plugin Element") - set_target_properties(element_respond PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(element_respond PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${RESPOND_ELEMENT}) -endif() + # Respond element + + set(USCXML_ELEMENTS "respond ${USCXML_ELEMENTS}") + file(GLOB_RECURSE RESPOND_ELEMENT + respond/*.cpp + respond/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${RESPOND_ELEMENT}) + add_library( + element_respond SHARED + ${RESPOND_ELEMENT} + "../Plugins.cpp") + target_link_libraries(element_respond uscxml) + set_target_properties(element_respond PROPERTIES FOLDER "Plugin Element") + set_target_properties(element_respond PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(element_respond PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${RESPOND_ELEMENT}) + endif() + +endif() # BUILD_MINIMAL set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_FILES ${USCXML_FILES} PARENT_SCOPE) diff --git a/src/uscxml/plugins/invoker/CMakeLists.txt b/src/uscxml/plugins/invoker/CMakeLists.txt index 3f63ea3..31ec444 100644 --- a/src/uscxml/plugins/invoker/CMakeLists.txt +++ b/src/uscxml/plugins/invoker/CMakeLists.txt @@ -1,577 +1,579 @@ -# sample invoker - include to make sure it compiles -set(USCXML_INVOKERS "sample ${USCXML_INVOKERS}") -file(GLOB_RECURSE SAMPLE_INVOKER - sample/*.cpp - sample/*.h -) - -if (BUILD_AS_PLUGINS) - source_group("" FILES ${SAMPLE_INVOKER}) - add_library( - invoker_sample SHARED - ${SAMPLE_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_sample uscxml) - set_target_properties(invoker_sample PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_sample PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${SAMPLE_INVOKER}) -endif() - -# DirMon invoker to watch for filesystem changes - -set(USCXML_INVOKERS "dirmon ${USCXML_INVOKERS}") -file(GLOB_RECURSE DIRMON_INVOKER - filesystem/dirmon/*.cpp - filesystem/dirmon/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${DIRMON_INVOKER}) - add_library( - invoker_dirmon SHARED - ${DIRMON_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_dirmon uscxml) - set_target_properties(invoker_dirmon PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_dirmon PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_dirmon PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${DIRMON_INVOKER}) -endif() - - -# Location invoker to watch for proximity to GPS coordinates - -# file(GLOB_RECURSE LOCATION_INVOKER -# location/*.cpp -# location/*.h -# ) -# if (BUILD_AS_PLUGINS) -# source_group("" FILES ${LOCATION_INVOKER}) -# add_library( -# invoker_location SHARED -# ${LOCATION_INVOKER} -# "../Plugins.cpp") -# target_link_libraries(invoker_location uscxml) -# set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") -# else() -# list (APPEND USCXML_FILES ${LOCATION_INVOKER}) -# endif() - - -# XHTML invoker - -set(USCXML_INVOKERS "xhtml ${USCXML_INVOKERS}") -file(GLOB_RECURSE XHTML_INVOKER - xhtml/*.cpp - xhtml/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${XHTML_INVOKER}) - add_library( - invoker_xhtml SHARED - ${XHTML_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_xhtml uscxml) - set_target_properties(invoker_xhtml PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_xhtml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_xhtml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${XHTML_INVOKER}) -endif() - - -# System invoker to open a native command +# USCXML invoker -file(GLOB_RECURSE SYSTEM_INVOKER - system/*.cpp - system/*.h -) +set(USCXML_INVOKERS "scxml ${USCXML_INVOKERS}") +file(GLOB_RECURSE USCXML_INVOKER + scxml/*.cpp + scxml/*.h) if (BUILD_AS_PLUGINS) - source_group("" FILES ${SYSTEM_INVOKER}) + source_group("" FILES ${USCXML_INVOKER}) add_library( - invoker_system SHARED - ${SYSTEM_INVOKER} + invoker_uscxml SHARED + ${USCXML_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_system uscxml) - set_target_properties(invoker_system PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_system PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_system PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(invoker_uscxml uscxml) + set_target_properties(invoker_uscxml PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_uscxml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_uscxml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${SYSTEM_INVOKER}) + list (APPEND USCXML_FILES ${USCXML_INVOKER}) endif() - -# expect invoker - -if (EXPECT_FOUND AND TCL_FOUND) - set(USCXML_INVOKERS "expect ${USCXML_INVOKERS}") - file(GLOB_RECURSE EXPECT_INVOKER - expect/*.cpp - expect/*.h +if (NOT BUILD_MINIMAL) + # sample invoker - include to make sure it compiles + set(USCXML_INVOKERS "sample ${USCXML_INVOKERS}") + file(GLOB_RECURSE SAMPLE_INVOKER + sample/*.cpp + sample/*.h ) + if (BUILD_AS_PLUGINS) - source_group("" FILES EXPECT_INVOKER) + source_group("" FILES ${SAMPLE_INVOKER}) add_library( - invoker_expect SHARED - ${EXPECT_INVOKER} + invoker_sample SHARED + ${SAMPLE_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_expect uscxml ${EXPECT_LIBRARY} ${TCL_LIBRARY}) - set_target_properties(invoker_expect PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_expect PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_expect PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(invoker_sample uscxml) + set_target_properties(invoker_sample PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_sample PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${EXPECT_INVOKER}) + list (APPEND USCXML_FILES ${SAMPLE_INVOKER}) endif() -endif() + # DirMon invoker to watch for filesystem changes -# SMTP invoker via curl - -if (CURL_HAS_SMTP) - set(USCXML_INVOKERS "smtp ${USCXML_INVOKERS}") - file(GLOB_RECURSE SMTP_INVOKER - smtp/*.cpp - smtp/*.h + set(USCXML_INVOKERS "dirmon ${USCXML_INVOKERS}") + file(GLOB_RECURSE DIRMON_INVOKER + filesystem/dirmon/*.cpp + filesystem/dirmon/*.h ) if (BUILD_AS_PLUGINS) - source_group("" FILES SMTP_INVOKER) + source_group("" FILES ${DIRMON_INVOKER}) add_library( - invoker_smtp SHARED - ${SMTP_INVOKER} + invoker_dirmon SHARED + ${DIRMON_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_smtp uscxml) - set_target_properties(invoker_smtp PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_smtp PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_smtp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(invoker_dirmon uscxml) + set_target_properties(invoker_dirmon PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_dirmon PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_dirmon PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${SMTP_INVOKER}) + list (APPEND USCXML_FILES ${DIRMON_INVOKER}) endif() -endif() -# IMAP invoker via curl + # Location invoker to watch for proximity to GPS coordinates -set(USCXML_INVOKERS "imap ${USCXML_INVOKERS}") -file(GLOB_RECURSE IMAP_INVOKER - imap/*.cpp - imap/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES IMAP_INVOKER) - add_library( - invoker_imap SHARED - ${IMAP_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_imap uscxml) - set_target_properties(invoker_imap PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_imap PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_imap PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${IMAP_INVOKER}) -endif() + # file(GLOB_RECURSE LOCATION_INVOKER + # location/*.cpp + # location/*.h + # ) + # if (BUILD_AS_PLUGINS) + # source_group("" FILES ${LOCATION_INVOKER}) + # add_library( + # invoker_location SHARED + # ${LOCATION_INVOKER} + # "../Plugins.cpp") + # target_link_libraries(invoker_location uscxml) + # set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") + # else() + # list (APPEND USCXML_FILES ${LOCATION_INVOKER}) + # endif() -# SQLite3 SQL Invoker + # XHTML invoker -if (SQLITE3_FOUND) - file(GLOB_RECURSE SQLITE3_INVOKER - sqlite3/*.cpp - sqlite3/*.h + set(USCXML_INVOKERS "xhtml ${USCXML_INVOKERS}") + file(GLOB_RECURSE XHTML_INVOKER + xhtml/*.cpp + xhtml/*.h ) if (BUILD_AS_PLUGINS) - source_group("" FILES ${SQLITE3_INVOKER}) + source_group("" FILES ${XHTML_INVOKER}) add_library( - invoker_sqlite3 SHARED - ${SQLITE3_INVOKER} + invoker_xhtml SHARED + ${XHTML_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_sqlite3 uscxml) - set_target_properties(invoker_sqlite3 PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_sqlite3 PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_sqlite3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(invoker_xhtml uscxml) + set_target_properties(invoker_xhtml PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_xhtml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_xhtml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${SQLITE3_INVOKER}) + list (APPEND USCXML_FILES ${XHTML_INVOKER}) endif() -endif() -# ffmpeg invoker + # System invoker to open a native command -if (FFMPEG_FOUND) - set(USCXML_INVOKERS "ffmpeg ${USCXML_INVOKERS}") - file(GLOB_RECURSE FFMPEG_INVOKER - ffmpeg/*.cpp - ffmpeg/*.h + file(GLOB_RECURSE SYSTEM_INVOKER + system/*.cpp + system/*.h ) if (BUILD_AS_PLUGINS) - source_group("" FILES ${FFMPEG_INVOKER}) + source_group("" FILES ${SYSTEM_INVOKER}) add_library( - invoker_ffmpeg SHARED - ${FFMPEG_INVOKER} + invoker_system SHARED + ${SYSTEM_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_ffmpeg uscxml ${FFMPEG_LIBRARIES}) - set_target_properties(invoker_ffmpeg PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_ffmpeg PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_ffmpeg PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(invoker_system uscxml) + set_target_properties(invoker_system PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_system PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_system PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${FFMPEG_INVOKER}) + list (APPEND USCXML_FILES ${SYSTEM_INVOKER}) endif() -endif() -# instant messaging invoker + # expect invoker -if (LIBPURPLE_FOUND) - set(USCXML_INVOKERS "im ${USCXML_INVOKERS}") - configure_file(${CMAKE_CURRENT_SOURCE_DIR}/im/IMConfig.h.in ${CMAKE_BINARY_DIR}/uscxml/IMConfig.h) - - file(GLOB_RECURSE LIBPURPLE_INVOKER - im/*.cpp - im/*.h - ) - - if (BUILD_AS_PLUGINS) - source_group("" FILES ${LIBPURPLE_INVOKER}) - add_library( - invoker_im SHARED - ${LIBPURPLE_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_im uscxml ${LIBPURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${ICONV_LIBRARIES}) - set_target_properties(invoker_im PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_im PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_im PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${LIBPURPLE_INVOKER}) + if (EXPECT_FOUND AND TCL_FOUND) + set(USCXML_INVOKERS "expect ${USCXML_INVOKERS}") + file(GLOB_RECURSE EXPECT_INVOKER + expect/*.cpp + expect/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES EXPECT_INVOKER) + add_library( + invoker_expect SHARED + ${EXPECT_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_expect uscxml ${EXPECT_LIBRARY} ${TCL_LIBRARY}) + set_target_properties(invoker_expect PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_expect PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_expect PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${EXPECT_INVOKER}) + endif() endif() -endif() -# calendar invoker + # SMTP invoker via curl -if (LIBICAL_FOUND) - set(USCXML_INVOKERS "calendar ${USCXML_INVOKERS}") - file(GLOB_RECURSE CALENDAR_INVOKER - calendar/*.cpp - calendar/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${CALENDAR_INVOKER}) - add_library( - invoker_calendar SHARED - ${CALENDAR_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_calendar uscxml ${LIBICAL_LIBRARIES}) - set_target_properties(invoker_calendar PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_calendar PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_calendar PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${CALENDAR_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") + set_target_properties(invoker_smtp PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_smtp PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${SMTP_INVOKER}) + endif() endif() -endif() -# webrtc invoker + # IMAP invoker via curl -if (LIBJINGLE_FOUND) - set(USCXML_INVOKERS "webrtc ${USCXML_INVOKERS}") - file(GLOB_RECURSE WEBRTC_INVOKER - webrtc/*.cpp - webrtc/*.h + set(USCXML_INVOKERS "imap ${USCXML_INVOKERS}") + file(GLOB_RECURSE IMAP_INVOKER + imap/*.cpp + imap/*.h ) if (BUILD_AS_PLUGINS) - source_group("" FILES ${WEBRTC_INVOKER}) + source_group("" FILES IMAP_INVOKER) add_library( - invoker_webrtc SHARED - ${WEBRTC_INVOKER} + invoker_imap SHARED + ${IMAP_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_webrtc uscxml ${LIBJINGLE_LIBRARIES}) - set_target_properties(invoker_webrtc PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_webrtc PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_webrtc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(invoker_imap uscxml) + set_target_properties(invoker_imap PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_imap PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_imap PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${WEBRTC_INVOKER}) + list (APPEND USCXML_FILES ${IMAP_INVOKER}) endif() -endif() -# location invoker + # SQLite3 SQL Invoker -if (CORELOCATION_LIBRARY AND OFF) - set(USCXML_INVOKERS "location ${USCXML_INVOKERS}") - file(GLOB_RECURSE LOCATION_INVOKER - location/CoreLocation/*.cpp - location/CoreLocation/*.mm - location/CoreLocation/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${LOCATION_INVOKER}) - add_library( - invoker_location SHARED - ${LOCATION_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_location uscxml) - set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_location PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_location PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${LOCATION_INVOKER}) + if (SQLITE3_FOUND) + file(GLOB_RECURSE SQLITE3_INVOKER + sqlite3/*.cpp + sqlite3/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${SQLITE3_INVOKER}) + add_library( + invoker_sqlite3 SHARED + ${SQLITE3_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_sqlite3 uscxml) + set_target_properties(invoker_sqlite3 PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_sqlite3 PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_sqlite3 PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${SQLITE3_INVOKER}) + endif() endif() -endif() -# UMUNDO invoker + # ffmpeg invoker -if (UMUNDO_FOUND AND PROTOBUF_FOUND) - set(USCXML_INVOKERS "umundo ${USCXML_INVOKERS}") - set(UMUNDO_INVOKER - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/UmundoInvoker.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/UmundoInvoker.h - ) - if (PROTOBUF_FOUND) - list(APPEND UMUNDO_INVOKER - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/JSON.pb.cc - ${CMAKE_CURRENT_SOURCE_DIR}/umundo/JSON.pb.h + if (FFMPEG_FOUND) + set(USCXML_INVOKERS "ffmpeg ${USCXML_INVOKERS}") + file(GLOB_RECURSE FFMPEG_INVOKER + ffmpeg/*.cpp + ffmpeg/*.h ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${FFMPEG_INVOKER}) + add_library( + invoker_ffmpeg SHARED + ${FFMPEG_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_ffmpeg uscxml ${FFMPEG_LIBRARIES}) + set_target_properties(invoker_ffmpeg PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_ffmpeg PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_ffmpeg PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${FFMPEG_INVOKER}) + endif() endif() - if (BUILD_AS_PLUGINS) - source_group("" FILES ${UMUNDO_INVOKER}) -# message(FATAL_ERROR "UMUNDO_LIBRARIES: ${UMUNDO_LIBRARIES}") - add_library( - invoker_umundo SHARED - ${UMUNDO_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_umundo uscxml - ${UMUNDO_LIBRARIES}) - if (PROTOBUF_FOUND) - target_link_libraries(invoker_umundo - optimized ${PROTOBUF_LIBRARY} - debug ${PROTOBUF_LIBRARY_DEBUG}) + + + # instant messaging invoker + + if (LIBPURPLE_FOUND) + set(USCXML_INVOKERS "im ${USCXML_INVOKERS}") + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/im/IMConfig.h.in ${CMAKE_BINARY_DIR}/uscxml/IMConfig.h) + + file(GLOB_RECURSE LIBPURPLE_INVOKER + im/*.cpp + im/*.h + ) + + if (BUILD_AS_PLUGINS) + source_group("" FILES ${LIBPURPLE_INVOKER}) + add_library( + invoker_im SHARED + ${LIBPURPLE_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_im uscxml ${LIBPURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${ICONV_LIBRARIES}) + set_target_properties(invoker_im PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_im PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_im PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${LIBPURPLE_INVOKER}) endif() - set_target_properties(invoker_umundo PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_umundo PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_umundo PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${UMUNDO_INVOKER}) endif() -endif() -# USCXML invoker + # calendar invoker -set(USCXML_INVOKERS "scxml ${USCXML_INVOKERS}") -file(GLOB_RECURSE USCXML_INVOKER - scxml/*.cpp - scxml/*.h) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${USCXML_INVOKER}) - add_library( - invoker_uscxml SHARED - ${USCXML_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_uscxml uscxml) - set_target_properties(invoker_uscxml PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_uscxml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_uscxml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${USCXML_INVOKER}) -endif() + if (LIBICAL_FOUND) + set(USCXML_INVOKERS "calendar ${USCXML_INVOKERS}") + file(GLOB_RECURSE CALENDAR_INVOKER + calendar/*.cpp + calendar/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${CALENDAR_INVOKER}) + add_library( + invoker_calendar SHARED + ${CALENDAR_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_calendar uscxml ${LIBICAL_LIBRARIES}) + set_target_properties(invoker_calendar PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_calendar PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_calendar PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${CALENDAR_INVOKER}) + endif() + endif() -# HTTP server invoker + # webrtc invoker -set(USCXML_INVOKERS "httpservlet ${USCXML_INVOKERS}") -file(GLOB_RECURSE HTTPSERVLET_INVOKER - http/*.cpp - http/*.h) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${HTTPSERVLET_INVOKER}) - add_library( - invoker_httpserver SHARED - ${HTTPSERVLET_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_httpserver - uscxml) - set_target_properties(invoker_httpserver PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_httpserver PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_httpserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${HTTPSERVLET_INVOKER}) -endif() + if (LIBJINGLE_FOUND) + set(USCXML_INVOKERS "webrtc ${USCXML_INVOKERS}") + file(GLOB_RECURSE WEBRTC_INVOKER + webrtc/*.cpp + webrtc/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${WEBRTC_INVOKER}) + add_library( + invoker_webrtc SHARED + ${WEBRTC_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_webrtc uscxml ${LIBJINGLE_LIBRARIES}) + set_target_properties(invoker_webrtc PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_webrtc PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_webrtc PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${WEBRTC_INVOKER}) + endif() + endif() -# Heartbeat invoker + # location invoker -set(USCXML_INVOKERS "heartbeat ${USCXML_INVOKERS}") -file(GLOB_RECURSE HEARTBEAT_INVOKER - heartbeat/*.cpp - heartbeat/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${HEARTBEAT_INVOKER}) - add_library( - invoker_heartbeat SHARED - ${HEARTBEAT_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_heartbeat uscxml) - set_target_properties(invoker_heartbeat PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_heartbeat PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_heartbeat PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${HEARTBEAT_INVOKER}) -endif() + if (CORELOCATION_LIBRARY AND OFF) + set(USCXML_INVOKERS "location ${USCXML_INVOKERS}") + file(GLOB_RECURSE LOCATION_INVOKER + location/CoreLocation/*.cpp + location/CoreLocation/*.mm + location/CoreLocation/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${LOCATION_INVOKER}) + add_library( + invoker_location SHARED + ${LOCATION_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_location uscxml) + set_target_properties(invoker_location PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_location PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_location PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${LOCATION_INVOKER}) + endif() + endif() -# OpenSceneGraph invoker -if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) - set(USCXML_INVOKERS "scenegraph ${USCXML_INVOKERS}") - file(GLOB OPENSCENEGRAPH_INVOKER - graphics/openscenegraph/*.cpp - graphics/openscenegraph/*.h) + # UMUNDO invoker - if (BUILD_AS_PLUGINS) - source_group("" FILES ${OPENSCENEGRAPH_INVOKER}) - add_library( - invoker_openscenegraph SHARED - ${OPENSCENEGRAPH_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_openscenegraph - ${OPENSCENEGRAPH_LIBRARIES} - ${OPENGL_LIBRARIES} - uscxml) - set_target_properties(invoker_openscenegraph PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_openscenegraph PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_openscenegraph PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${OPENSCENEGRAPH_INVOKER}) + if (UMUNDO_FOUND AND PROTOBUF_FOUND) + set(USCXML_INVOKERS "umundo ${USCXML_INVOKERS}") + set(UMUNDO_INVOKER + ${CMAKE_CURRENT_SOURCE_DIR}/umundo/UmundoInvoker.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/umundo/UmundoInvoker.h + ) + if (PROTOBUF_FOUND) + list(APPEND UMUNDO_INVOKER + ${CMAKE_CURRENT_SOURCE_DIR}/umundo/JSON.pb.cc + ${CMAKE_CURRENT_SOURCE_DIR}/umundo/JSON.pb.h + ) + endif() + if (BUILD_AS_PLUGINS) + source_group("" FILES ${UMUNDO_INVOKER}) + # message(FATAL_ERROR "UMUNDO_LIBRARIES: ${UMUNDO_LIBRARIES}") + add_library( + invoker_umundo SHARED + ${UMUNDO_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_umundo uscxml + ${UMUNDO_LIBRARIES}) + if (PROTOBUF_FOUND) + target_link_libraries(invoker_umundo + optimized ${PROTOBUF_LIBRARY} + debug ${PROTOBUF_LIBRARY_DEBUG}) + endif() + set_target_properties(invoker_umundo PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_umundo PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_umundo PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${UMUNDO_INVOKER}) + endif() endif() - set(USCXML_INVOKERS "osgvonvert ${USCXML_INVOKERS}") - file(GLOB OPENSCENEGRAPH_CONVERTER_INVOKER - graphics/openscenegraph/converter/*.cpp - graphics/openscenegraph/converter/*.h) + # HTTP server invoker + + set(USCXML_INVOKERS "httpservlet ${USCXML_INVOKERS}") + file(GLOB_RECURSE HTTPSERVLET_INVOKER + http/*.cpp + http/*.h) if (BUILD_AS_PLUGINS) - source_group("" FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) + source_group("" FILES ${HTTPSERVLET_INVOKER}) add_library( - invoker_openscenegraph_convert SHARED - ${OPENSCENEGRAPH_CONVERTER_INVOKER} + invoker_httpserver SHARED + ${HTTPSERVLET_INVOKER} "../Plugins.cpp") - target_link_libraries(invoker_openscenegraph_convert - ${OPENSCENEGRAPH_LIBRARIES} - ${OPENGL_LIBRARIES} + target_link_libraries(invoker_httpserver uscxml) - set_target_properties(invoker_openscenegraph_convert PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_openscenegraph_convert PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_openscenegraph_convert PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + set_target_properties(invoker_httpserver PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_httpserver PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_httpserver PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) + list (APPEND USCXML_FILES ${HTTPSERVLET_INVOKER}) endif() -endif() -# OpenAL modality components - -if (OPENAL_FOUND AND (LIBSNDFILE_FOUND OR AUDIOTOOLBOX_FOUND)) - set(USCXML_INVOKERS "openal ${USCXML_INVOKERS}") - file(GLOB_RECURSE OPENAL_INVOKER - audio/OpenAL*.cpp - audio/OpenAL*.h) - if (LIBSNDFILE_FOUND) - file(GLOB_RECURSE LIBSNDFILE_WRAPPER - audio/LibSoundFile*.cpp - audio/LibSoundFile*.h) - LIST(APPEND OPENAL_INVOKER ${LIBSNDFILE_WRAPPER}) - elseif(AUDIOTOOLBOX_FOUND) - file(GLOB_RECURSE AUDIOTOOLBOX_WRAPPER - audio/AudioToolbox*.mm - audio/AudioToolbox*.h) - LIST(APPEND OPENAL_INVOKER ${AUDIOTOOLBOX_WRAPPER}) - endif() -# message("MILES_INVOKER ${MILES_INVOKER}") + # Heartbeat invoker + set(USCXML_INVOKERS "heartbeat ${USCXML_INVOKERS}") + file(GLOB_RECURSE HEARTBEAT_INVOKER + heartbeat/*.cpp + heartbeat/*.h + ) if (BUILD_AS_PLUGINS) - source_group("" FILES ${OPENAL_INVOKER}) + source_group("" FILES ${HEARTBEAT_INVOKER}) add_library( - invoker_openal SHARED - ${OPENAL_INVOKER} + invoker_heartbeat SHARED + ${HEARTBEAT_INVOKER} "../Plugins.cpp") - if (LIBSNDFILE_FOUND) - target_link_libraries(invoker_openal - ${OPENAL_LIBRARY} - ${LIBSNDFILE_LIBRARY} + target_link_libraries(invoker_heartbeat uscxml) + set_target_properties(invoker_heartbeat PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_heartbeat PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_heartbeat PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${HEARTBEAT_INVOKER}) + endif() + + + # OpenSceneGraph invoker + if (OPENSCENEGRAPH_FOUND AND OPENGL_FOUND) + set(USCXML_INVOKERS "scenegraph ${USCXML_INVOKERS}") + file(GLOB OPENSCENEGRAPH_INVOKER + graphics/openscenegraph/*.cpp + graphics/openscenegraph/*.h) + + if (BUILD_AS_PLUGINS) + source_group("" FILES ${OPENSCENEGRAPH_INVOKER}) + add_library( + invoker_openscenegraph SHARED + ${OPENSCENEGRAPH_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_openscenegraph + ${OPENSCENEGRAPH_LIBRARIES} + ${OPENGL_LIBRARIES} uscxml) - elseif(AUDIOTOOLBOX_FOUND) - target_link_libraries(invoker_openal - ${OPENAL_LIBRARY} - ${AUDIOTOOLBOX}/AudioToolbox + set_target_properties(invoker_openscenegraph PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_openscenegraph PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_openscenegraph PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${OPENSCENEGRAPH_INVOKER}) + endif() + + set(USCXML_INVOKERS "osgvonvert ${USCXML_INVOKERS}") + file(GLOB OPENSCENEGRAPH_CONVERTER_INVOKER + graphics/openscenegraph/converter/*.cpp + graphics/openscenegraph/converter/*.h) + + if (BUILD_AS_PLUGINS) + source_group("" FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) + add_library( + invoker_openscenegraph_convert SHARED + ${OPENSCENEGRAPH_CONVERTER_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_openscenegraph_convert + ${OPENSCENEGRAPH_LIBRARIES} + ${OPENGL_LIBRARIES} uscxml) - endif() - set_target_properties(invoker_openal PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_openal PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_openal PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${OPENAL_INVOKER}) + set_target_properties(invoker_openscenegraph_convert PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_openscenegraph_convert PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_openscenegraph_convert PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${OPENSCENEGRAPH_CONVERTER_INVOKER}) + endif() endif() -endif() -# MILES modality components + # OpenAL modality components + + if (OPENAL_FOUND AND (LIBSNDFILE_FOUND OR AUDIOTOOLBOX_FOUND)) + set(USCXML_INVOKERS "openal ${USCXML_INVOKERS}") + file(GLOB_RECURSE OPENAL_INVOKER + audio/OpenAL*.cpp + audio/OpenAL*.h) + if (LIBSNDFILE_FOUND) + file(GLOB_RECURSE LIBSNDFILE_WRAPPER + audio/LibSoundFile*.cpp + audio/LibSoundFile*.h) + LIST(APPEND OPENAL_INVOKER ${LIBSNDFILE_WRAPPER}) + elseif(AUDIOTOOLBOX_FOUND) + file(GLOB_RECURSE AUDIOTOOLBOX_WRAPPER + audio/AudioToolbox*.mm + audio/AudioToolbox*.h) + LIST(APPEND OPENAL_INVOKER ${AUDIOTOOLBOX_WRAPPER}) + endif() + # message("MILES_INVOKER ${MILES_INVOKER}") + + if (BUILD_AS_PLUGINS) + source_group("" FILES ${OPENAL_INVOKER}) + add_library( + invoker_openal SHARED + ${OPENAL_INVOKER} + "../Plugins.cpp") + if (LIBSNDFILE_FOUND) + target_link_libraries(invoker_openal + ${OPENAL_LIBRARY} + ${LIBSNDFILE_LIBRARY} + uscxml) + elseif(AUDIOTOOLBOX_FOUND) + target_link_libraries(invoker_openal + ${OPENAL_LIBRARY} + ${AUDIOTOOLBOX}/AudioToolbox + uscxml) + endif() + set_target_properties(invoker_openal PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_openal PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_openal PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${OPENAL_INVOKER}) + endif() + endif() -if (MILES_FOUND) - set(USCXML_INVOKERS "miles ${USCXML_INVOKERS}") - file(GLOB_RECURSE MILES_INVOKER - miles/*.cpp - miles/*.h) -# message("MILES_INVOKER ${MILES_INVOKER}") - if (BUILD_AS_PLUGINS) - source_group("" FILES ${MILES_INVOKER}) - add_library( - invoker_miles SHARED - ${MILES_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_miles - ${MILES_LIBRARIES} - ${JPEG_LIBRARIES} - uscxml) - if (ICONV_FOUND) - target_link_libraries(invoker_miles ${ICONV_LIBRARIES}) - endif() - if (OPENAL_FOUND) - target_link_libraries(invoker_miles ${OPENAL_LIBRARY}) - endif() - set_target_properties(invoker_miles PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_miles PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_miles PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${MILES_INVOKER}) + # MILES modality components + + if (MILES_FOUND) + set(USCXML_INVOKERS "miles ${USCXML_INVOKERS}") + file(GLOB_RECURSE MILES_INVOKER + miles/*.cpp + miles/*.h) + # message("MILES_INVOKER ${MILES_INVOKER}") + + if (BUILD_AS_PLUGINS) + source_group("" FILES ${MILES_INVOKER}) + add_library( + invoker_miles SHARED + ${MILES_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_miles + ${MILES_LIBRARIES} + ${JPEG_LIBRARIES} + uscxml) + if (ICONV_FOUND) + target_link_libraries(invoker_miles ${ICONV_LIBRARIES}) + endif() + if (OPENAL_FOUND) + target_link_libraries(invoker_miles ${OPENAL_LIBRARY}) + endif() + set_target_properties(invoker_miles PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_miles PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_miles PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${MILES_INVOKER}) + endif() endif() -endif() -# VoiceXML modality components + # VoiceXML modality components -if (UMUNDO_FOUND AND OFF) - set(USCXML_INVOKERS "vxml ${USCXML_INVOKERS}") - file(GLOB_RECURSE VXML_INVOKER - vxml/*.cpp - vxml/*.h - ) - if (BUILD_AS_PLUGINS) - source_group("" FILES ${VXML_INVOKER}) - add_library( - invoker_voicexml SHARED - ${VXML_INVOKER} - "../Plugins.cpp") - target_link_libraries(invoker_voicexml uscxml) - set_target_properties(invoker_voicexml PROPERTIES FOLDER "Plugin Invoker") - set_target_properties(invoker_voicexml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(invoker_voicexml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") - else() - list (APPEND USCXML_FILES ${VXML_INVOKER}) + if (UMUNDO_FOUND AND OFF) + set(USCXML_INVOKERS "vxml ${USCXML_INVOKERS}") + file(GLOB_RECURSE VXML_INVOKER + vxml/*.cpp + vxml/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${VXML_INVOKER}) + add_library( + invoker_voicexml SHARED + ${VXML_INVOKER} + "../Plugins.cpp") + target_link_libraries(invoker_voicexml uscxml) + set_target_properties(invoker_voicexml PROPERTIES FOLDER "Plugin Invoker") + set_target_properties(invoker_voicexml PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(invoker_voicexml PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${VXML_INVOKER}) + endif() endif() -endif() + +endif() # BUILD_MINIMAL set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_FILES ${USCXML_FILES} PARENT_SCOPE) diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h index f6aa77a..f5f8fbd 100644 --- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h @@ -56,6 +56,10 @@ public: return names; } + virtual bool deleteOnUninvoke() { + return false; + } + virtual Data getDataModelVariables(); virtual void send(const SendRequest& req); virtual void cancel(const std::string sendId); diff --git a/src/uscxml/plugins/ioprocessor/CMakeLists.txt b/src/uscxml/plugins/ioprocessor/CMakeLists.txt index f09a866..3c882ed 100644 --- a/src/uscxml/plugins/ioprocessor/CMakeLists.txt +++ b/src/uscxml/plugins/ioprocessor/CMakeLists.txt @@ -1,42 +1,3 @@ -set(USCXML_IOPROCESSORS "sample ${USCXML_IOPROCESSORS}") -file(GLOB_RECURSE SAMPLE_IOPROCESSOR - sample/*.cpp - sample/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${SAMPLE_IOPROCESSOR}) - add_library( - ioprocessor_sample SHARED - ${SAMPLE_IOPROCESSOR} - "../Plugins.cpp") - target_link_libraries(ioprocessor_sample uscxml) - set_target_properties(ioprocessor_sample PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_sample PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${SAMPLE_IOPROCESSOR}) -endif() - -set(USCXML_IOPROCESSORS "comet ${USCXML_IOPROCESSORS}") -file(GLOB_RECURSE COMET_IOPROCESSOR - comet/*.cpp - comet/*.h -) -if (BUILD_AS_PLUGINS) - source_group("" FILES ${COMET_IOPROCESSOR}) - add_library( - ioprocessor_comet SHARED - ${COMET_IOPROCESSOR} - "../Plugins.cpp") - target_link_libraries(ioprocessor_comet uscxml) - set_target_properties(ioprocessor_comet PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_comet PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_comet PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") -else() - list (APPEND USCXML_FILES ${COMET_IOPROCESSOR}) -endif() - - # LIBEVENT basichttp ioprocessor - this one is already required above set(USCXML_IOPROCESSORS "basichttp ${USCXML_IOPROCESSORS}") @@ -59,7 +20,7 @@ else() endif() -# scxml ioprocessor - this one is already required above +# scxml ioprocessor set(USCXML_IOPROCESSORS "scxml ${USCXML_IOPROCESSORS}") file(GLOB_RECURSE SCXML_IOPROCESSOR @@ -87,46 +48,89 @@ else() endif() -# mmi ioprocessor +if (NOT BUILD_MINIMAL) -if (PROTOBUF_FOUND AND OFF) - - if (NOT PROTOBUF_PROTOC_EXECUTABLE) - message(FATAL_ERROR "protoc binary required for serialization") + set(USCXML_IOPROCESSORS "sample ${USCXML_IOPROCESSORS}") + file(GLOB_RECURSE SAMPLE_IOPROCESSOR + sample/*.cpp + sample/*.h + ) + if (BUILD_AS_PLUGINS) + source_group("" FILES ${SAMPLE_IOPROCESSOR}) + add_library( + ioprocessor_sample SHARED + ${SAMPLE_IOPROCESSOR} + "../Plugins.cpp") + target_link_libraries(ioprocessor_sample uscxml) + set_target_properties(ioprocessor_sample PROPERTIES FOLDER "Plugin IOProcessor") + set_target_properties(ioprocessor_sample PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(ioprocessor_sample PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${SAMPLE_IOPROCESSOR}) endif() - set(USCXML_IOPROCESSORS "mmi ${USCXML_IOPROCESSORS}") - file(GLOB_RECURSE MMI_IOPROCESSOR - modality/*.cpp - modality/*.h + set(USCXML_IOPROCESSORS "comet ${USCXML_IOPROCESSORS}") + file(GLOB_RECURSE COMET_IOPROCESSOR + comet/*.cpp + comet/*.h ) - - # process .proto files - file(GLOB_RECURSE PROTOBUF_INTERFACES ${PROJECT_SOURCE_DIR}/contrib/proto/*.proto) - list (APPEND USCXML_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}) - - PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTOBUF_INTERFACES}) -# set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE) - - # this needs to be here for dependencies on the generated proto files - add_library(mmi_proto STATIC ${PROTO_SRCS}) - set_target_properties(mmi_proto PROPERTIES FOLDER "Generated") - if (BUILD_AS_PLUGINS) - source_group("" FILES ${MMI_IOPROCESSOR}) + source_group("" FILES ${COMET_IOPROCESSOR}) add_library( - ioprocessor_mmi SHARED - ${MMI_IOPROCESSOR} + ioprocessor_comet SHARED + ${COMET_IOPROCESSOR} "../Plugins.cpp") - target_link_libraries(ioprocessor_mmi uscxml mmi_proto) - set_target_properties(ioprocessor_mmi PROPERTIES FOLDER "Plugin IOProcessor") - set_target_properties(ioprocessor_mmi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") - set_target_properties(ioprocessor_mmi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + target_link_libraries(ioprocessor_comet uscxml) + set_target_properties(ioprocessor_comet PROPERTIES FOLDER "Plugin IOProcessor") + set_target_properties(ioprocessor_comet PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(ioprocessor_comet PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") else() - list (APPEND USCXML_FILES ${MMI_IOPROCESSOR}) - list (APPEND USCXML_OPT_LIBS mmi_proto) + list (APPEND USCXML_FILES ${COMET_IOPROCESSOR}) endif() -endif() + + + # mmi ioprocessor + + if (PROTOBUF_FOUND AND OFF) + + if (NOT PROTOBUF_PROTOC_EXECUTABLE) + message(FATAL_ERROR "protoc binary required for serialization") + endif() + + set(USCXML_IOPROCESSORS "mmi ${USCXML_IOPROCESSORS}") + file(GLOB_RECURSE MMI_IOPROCESSOR + modality/*.cpp + modality/*.h + ) + + # process .proto files + file(GLOB_RECURSE PROTOBUF_INTERFACES ${PROJECT_SOURCE_DIR}/contrib/proto/*.proto) + list (APPEND USCXML_INCLUDE_DIRS ${CMAKE_CURRENT_BINARY_DIR}) + + PROTOBUF_GENERATE_CPP(PROTO_SRCS PROTO_HDRS ${PROTOBUF_INTERFACES}) + # set_source_files_properties(${PROTO_SRCS} ${PROTO_HDRS} PROPERTIES GENERATED TRUE) + + # this needs to be here for dependencies on the generated proto files + add_library(mmi_proto STATIC ${PROTO_SRCS}) + set_target_properties(mmi_proto PROPERTIES FOLDER "Generated") + + if (BUILD_AS_PLUGINS) + source_group("" FILES ${MMI_IOPROCESSOR}) + add_library( + ioprocessor_mmi SHARED + ${MMI_IOPROCESSOR} + "../Plugins.cpp") + target_link_libraries(ioprocessor_mmi uscxml mmi_proto) + set_target_properties(ioprocessor_mmi PROPERTIES FOLDER "Plugin IOProcessor") + set_target_properties(ioprocessor_mmi PROPERTIES COMPILE_FLAGS "-DPLUMA_EXPORTS") + set_target_properties(ioprocessor_mmi PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${OUTPUT_DIR}/lib") + else() + list (APPEND USCXML_FILES ${MMI_IOPROCESSOR}) + list (APPEND USCXML_OPT_LIBS mmi_proto) + endif() + endif() + +endif() # BUILD_MINIMAL set(USCXML_INCLUDE_DIRS ${USCXML_INCLUDE_DIRS} PARENT_SCOPE) set(USCXML_OPT_LIBS ${USCXML_OPT_LIBS} PARENT_SCOPE) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 436f52e..b106d87 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -83,29 +83,32 @@ if (NOT WIN32) add_test(test-arabica-xpath ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-arabica-parsing) set_target_properties(test-arabica-parsing PROPERTIES FOLDER "Tests") - add_executable(test-stress src/test-stress.cpp) - if (BUILD_AS_PLUGINS) - target_link_libraries(test-stress uscxml invoker_dirmon) - else() - target_link_libraries(test-stress uscxml) - endif() - # add_test(test-stress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-stress ${CMAKE_SOURCE_DIR}/test/w3c) - set_target_properties(test-stress PROPERTIES FOLDER "Tests") - - # if (LIBPURPLE_FOUND) - # add_executable(test-instant-messaging src/test-instant-messaging.cpp) - # target_link_libraries(test-instant-messaging uscxml ${LIBPURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${ICONV_LIBRARIES}) - # add_test(test-instant-messaging ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-instant-messaging) - # set_target_properties(test-instant-messaging PROPERTIES FOLDER "Tests") - # endif() - - add_executable(test-promela-parser src/test-promela-parser.cpp) - target_link_libraries(test-promela-parser uscxml) - if (BUILD_AS_PLUGINS) - target_link_libraries(test-promela-parser datamodel_promela) + if (NOT BUILD_MINIMAL) + + add_executable(test-stress src/test-stress.cpp) + if (BUILD_AS_PLUGINS) + target_link_libraries(test-stress uscxml invoker_dirmon) + else() + target_link_libraries(test-stress uscxml) + endif() + # add_test(test-stress ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-stress ${CMAKE_SOURCE_DIR}/test/w3c) + set_target_properties(test-stress PROPERTIES FOLDER "Tests") + + # if (LIBPURPLE_FOUND) + # add_executable(test-instant-messaging src/test-instant-messaging.cpp) + # target_link_libraries(test-instant-messaging uscxml ${LIBPURPLE_LIBRARY} ${GLIB2_LIBRARIES} ${ICONV_LIBRARIES}) + # add_test(test-instant-messaging ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-instant-messaging) + # set_target_properties(test-instant-messaging PROPERTIES FOLDER "Tests") + # endif() + + add_executable(test-promela-parser src/test-promela-parser.cpp) + target_link_libraries(test-promela-parser uscxml) + if (BUILD_AS_PLUGINS) + target_link_libraries(test-promela-parser datamodel_promela) + endif() + add_test(test-url ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-promela-parser) + set_target_properties(test-promela-parser PROPERTIES FOLDER "Tests") endif() - add_test(test-url ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-promela-parser) - set_target_properties(test-promela-parser PROPERTIES FOLDER "Tests") endif() @@ -158,52 +161,54 @@ if (EXPECT_FOUND AND TCL_FOUND) set_target_properties(test-expect PROPERTIES FOLDER "Tests") endif() -add_executable(test-w3c src/test-w3c.cpp) -target_link_libraries(test-w3c uscxml) -set_target_properties(test-w3c PROPERTIES FOLDER "Tests") - -file(GLOB_RECURSE W3C_TESTS - w3c/*.scxml -) - -foreach( W3C_TEST ${W3C_TESTS} ) - string(REGEX MATCH "[^//]+/[^//]+.scxml" TEST_NAME ${W3C_TEST}) -# message("TEST_NAME: ${TEST_NAME}") - if (NOT TEST_NAME MATCHES ".*sub.*") - if (BUILD_TESTS_W3C_ECMA AND TEST_NAME MATCHES "^ecma\\/.*") - add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c ${W3C_TEST}) - set_property(TEST ${TEST_NAME} PROPERTY LABELS ${TEST_NAME}) -# set_tests_properties(${TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST FAILED") - if (TEST_NAME STREQUAL "ecma/test250.scxml") - set_tests_properties(${TEST_NAME} PROPERTIES - FAIL_REGULAR_EXPRESSION "entering final state, invocation was not cancelled") - elseif (TEST_NAME STREQUAL "ecma/test307.scxml") - set_tests_properties(${TEST_NAME} PROPERTIES - FAIL_REGULAR_EXPRESSION "error in state") +if (NOT BUILD_MINIMAL) + add_executable(test-w3c src/test-w3c.cpp) + target_link_libraries(test-w3c uscxml) + set_target_properties(test-w3c PROPERTIES FOLDER "Tests") + + file(GLOB_RECURSE W3C_TESTS + w3c/*.scxml + ) + + foreach( W3C_TEST ${W3C_TESTS} ) + string(REGEX MATCH "[^//]+/[^//]+.scxml" TEST_NAME ${W3C_TEST}) + # message("TEST_NAME: ${TEST_NAME}") + if (NOT TEST_NAME MATCHES ".*sub.*") + if (BUILD_TESTS_W3C_ECMA AND TEST_NAME MATCHES "^ecma\\/.*") + add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c ${W3C_TEST}) + set_property(TEST ${TEST_NAME} PROPERTY LABELS ${TEST_NAME}) + # set_tests_properties(${TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST FAILED") + if (TEST_NAME STREQUAL "ecma/test250.scxml") + set_tests_properties(${TEST_NAME} PROPERTIES + FAIL_REGULAR_EXPRESSION "entering final state, invocation was not cancelled") + elseif (TEST_NAME STREQUAL "ecma/test307.scxml") + set_tests_properties(${TEST_NAME} PROPERTIES + FAIL_REGULAR_EXPRESSION "error in state") + endif() endif() - endif() - if (BUILD_TESTS_FSM_ECMA AND TEST_NAME MATCHES "^ecma\\/.*") - add_test("fsm/${TEST_NAME}" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c -f ${W3C_TEST}) - set_property(TEST "fsm/${TEST_NAME}" PROPERTY LABELS "fsm/${TEST_NAME}") - endif() + if (BUILD_TESTS_FSM_ECMA AND TEST_NAME MATCHES "^ecma\\/.*") + add_test("fsm/${TEST_NAME}" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c -f ${W3C_TEST}) + set_property(TEST "fsm/${TEST_NAME}" PROPERTY LABELS "fsm/${TEST_NAME}") + endif() - if (BUILD_TESTS_W3C_XPATH AND TEST_NAME MATCHES "^xpath\\/.*") - add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c ${W3C_TEST}) - set_property(TEST ${TEST_NAME} PROPERTY LABELS ${TEST_NAME}) -# set_tests_properties(${TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST FAILED") - endif() + if (BUILD_TESTS_W3C_XPATH AND TEST_NAME MATCHES "^xpath\\/.*") + add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c ${W3C_TEST}) + set_property(TEST ${TEST_NAME} PROPERTY LABELS ${TEST_NAME}) + # set_tests_properties(${TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST FAILED") + endif() - if (BUILD_TESTS_FSM_XPATH AND TEST_NAME MATCHES "^xpath\\/.*") - add_test("fsm/${TEST_NAME}" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c -f ${W3C_TEST}) - set_property(TEST "fsm/${TEST_NAME}" PROPERTY LABELS "fsm/${TEST_NAME}") - endif() + if (BUILD_TESTS_FSM_XPATH AND TEST_NAME MATCHES "^xpath\\/.*") + add_test("fsm/${TEST_NAME}" ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c -f ${W3C_TEST}) + set_property(TEST "fsm/${TEST_NAME}" PROPERTY LABELS "fsm/${TEST_NAME}") + endif() - if (BUILD_DM_LUA AND LUA_FOUND AND BUILD_TESTS_W3C_LUA AND TEST_NAME MATCHES "^lua\\/.*") - add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c ${W3C_TEST}) - set_property(TEST ${TEST_NAME} PROPERTY LABELS ${TEST_NAME}) -# set_tests_properties(${TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST FAILED") - endif() + if (BUILD_DM_LUA AND LUA_FOUND AND BUILD_TESTS_W3C_LUA AND TEST_NAME MATCHES "^lua\\/.*") + add_test(${TEST_NAME} ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/test-w3c ${W3C_TEST}) + set_property(TEST ${TEST_NAME} PROPERTY LABELS ${TEST_NAME}) + # set_tests_properties(${TEST_NAME} PROPERTIES FAIL_REGULAR_EXPRESSION "TEST FAILED") + endif() - endif() -endforeach() + endif() + endforeach() +endif() \ No newline at end of file -- cgit v0.12