aboutsummaryrefslogtreecommitdiff
path: root/examples/CMakeLists.txt
blob: 3072df0779c5e6257258ac1e1b83949dd9abf49a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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_EXECUTABLE}
                  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)