diff options
Diffstat (limited to 'examples/cpp/library/lambdas')
-rw-r--r-- | examples/cpp/library/lambdas/CMakeLists.txt | 10 | ||||
-rw-r--r-- | examples/cpp/library/lambdas/main.cpp | 17 |
2 files changed, 27 insertions, 0 deletions
diff --git a/examples/cpp/library/lambdas/CMakeLists.txt b/examples/cpp/library/lambdas/CMakeLists.txt new file mode 100644 index 0000000..c062e64 --- /dev/null +++ b/examples/cpp/library/lambdas/CMakeLists.txt @@ -0,0 +1,10 @@ +cmake_minimum_required(VERSION 2.8.6) +project(simple-scxml) + +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "/usr/local/share/uscxml/cmake/") +find_package(USCXML REQUIRED) + + +include_directories(${USCXML_INCLUDE_DIR}) +add_executable(simple main.cpp) +target_link_libraries(simple ${USCXML_LIBRARIES})
\ No newline at end of file diff --git a/examples/cpp/library/lambdas/main.cpp b/examples/cpp/library/lambdas/main.cpp new file mode 100644 index 0000000..316576b --- /dev/null +++ b/examples/cpp/library/lambdas/main.cpp @@ -0,0 +1,17 @@ +#include <iostream> +#include "uscxml/uscxml.h" + +int main(int argc, char *argv[]) +{ + if (argc < 2) { + std::cerr << "Expected URL with SCXML document as first argument" << std::endl; + return -1; + } + + uscxml::Interpreter sc = uscxml::Interpreter::fromURL(argv[1]); + uscxml::InterpreterState state; + while ((state = sc.step()) != uscxml::USCXML_FINISHED) { + } + + return 0; +} |