1 if (HB_HAVE_GLIB) 2 file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM) 3 extract_make_variable (TEST_PROGS ${MAKEFILEAM}) 4 5 list (APPEND TEST_PROGS 6 test-ot-color 7 test-ot-name 8 test-ot-tag 9 test-c 10 test-cplusplus 11 ) 12 13 if (HB_HAVE_FREETYPE) 14 list (APPEND TEST_PROGS test-ot-math) 15 endif () 16 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) 22 else () 23 message (FATAL_ERROR "No source file found for test ${test_name}") 24 endif () 25 target_link_libraries (${test_name} harfbuzz harfbuzz-subset) 26 if (WIN32) 27 set_property (TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}) 28 add_test (NAME ${test_name} COMMAND ${test_name}) 29 else (WIN32) 30 add_test (${test_name} ${test_name}) 31 endif (WIN32) 32 endforeach () 33 set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT 34 "G_TEST_SRCDIR=${CMAKE_CURRENT_SOURCE_DIR};G_TEST_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}" 35 ) 36 endif () 37