2 file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
3 extract_make_variable (TEST_PROGS ${MAKEFILEAM})
5 list (APPEND TEST_PROGS
14 list (APPEND TEST_PROGS test-ot-math)
17 foreach (test_name IN ITEMS ${TEST_PROGS})
18 if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.c)
19 add_executable (${test_name} ${test_name}.c)
20 elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.cc)
21 add_executable (${test_name} ${test_name}.cc)
23 message (FATAL_ERROR "No source file found for test ${test_name}")
25 target_link_libraries (${test_name} harfbuzz harfbuzz-subset)
27 set_property (TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
28 add_test (NAME ${test_name} COMMAND ${test_name})
30 add_test (${test_name} ${test_name})
33 set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT
34 "G_TEST_SRCDIR=${CMAKE_CURRENT_SOURCE_DIR};G_TEST_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"