diff options
Diffstat (limited to 'examples/CMakeLists.txt')
-rw-r--r-- | examples/CMakeLists.txt | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt new file mode 100644 index 0000000..32cdd29 --- /dev/null +++ b/examples/CMakeLists.txt @@ -0,0 +1,26 @@ +add_executable(effcee-example main.cc) + +target_link_libraries(effcee-example effcee) +if(UNIX AND NOT MINGW) + set_target_properties(effcee-example PROPERTIES LINK_FLAGS -pthread) +endif() +if (WIN32 AND NOT MSVC) + # For MinGW cross-compile, statically link to the C++ runtime + set_target_properties(effcee-example PROPERTIES + LINK_FLAGS "-static -static-libgcc -static-libstdc++") +endif(WIN32 AND NOT MSVC) + + +if(EFFCEE_BUILD_TESTING) + add_test(NAME effcee-example + COMMAND ${PYTHON_EXE} + effcee-example-driver.py + $<TARGET_FILE:effcee-example> + example_data.txt + "CHECK: Hello" + "CHECK-SAME: world" + "CHECK-NEXT: Bees" + "CHECK-NOT: Sting" + "CHECK: Honey" + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}) +endif(EFFCEE_BUILD_TESTING) |