CMakeLists.txt 634 B

12345678910111213141516
  1. file(GLOB TEST_C_FILES "*.c")
  2. foreach(TEST_C_FILE ${TEST_C_FILES})
  3. get_filename_component(TEST_C_EXE ${TEST_C_FILE} NAME_WE)
  4. add_executable(${TEST_C_EXE} ${TEST_C_FILE})
  5. target_link_libraries(${TEST_C_EXE} ${GY_LIBS} gy_static si_static m
  6. lua_static chipmunk_static eruta_static)
  7. add_test(${TEST_C_EXE} ${TEST_C_EXE})
  8. # Make sure that ctest shows the test error messages if there are any.
  9. set(CMAKE_CTEST_OPTIONS --output-on-failure)
  10. endforeach(TEST_C_FILE)
  11. # Make check compiles the tests and runs them immediately.
  12. # add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} ${CMAKE_CTEST_OPTIONS} DEPENDS ${TEST_EXE})