diff options
| -rw-r--r-- | CMakeLists.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 1787154f..e7510343 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,4 +3,14 @@ project(stc) add_library(stc INTERFACE) target_include_directories(stc INTERFACE include) +include(CTest) +if(BUILD_TESTING) + file(GLOB examples examples/*.c) + foreach(file IN LISTS examples) + get_filename_component(name "${file}" NAME_WE) + add_executable(${name} ${file}) + target_link_libraries(${name} PRIVATE stc m) + add_test(NAME ${name} COMMAND ${name}) + endforeach() +endif() |
