2018-02-28 09:23:39 +01:00
|
|
|
if (HB_HAVE_GLIB)
|
2017-12-29 20:43:29 +01:00
|
|
|
file (READ "${CMAKE_CURRENT_SOURCE_DIR}/Makefile.am" MAKEFILEAM)
|
|
|
|
extract_make_variable (TEST_PROGS ${MAKEFILEAM})
|
|
|
|
|
|
|
|
list (APPEND TEST_PROGS
|
2018-10-12 01:30:59 +02:00
|
|
|
test-ot-color
|
2018-10-16 12:47:21 +02:00
|
|
|
test-ot-name
|
2017-12-29 20:43:29 +01:00
|
|
|
test-ot-tag
|
|
|
|
test-c
|
|
|
|
test-cplusplus
|
|
|
|
)
|
|
|
|
|
|
|
|
if (HB_HAVE_FREETYPE)
|
|
|
|
list (APPEND TEST_PROGS test-ot-math)
|
|
|
|
endif ()
|
|
|
|
|
|
|
|
foreach (test_name IN ITEMS ${TEST_PROGS})
|
2017-12-05 23:43:28 +01:00
|
|
|
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.c)
|
|
|
|
add_executable (${test_name} ${test_name}.c)
|
|
|
|
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${test_name}.cc)
|
|
|
|
add_executable (${test_name} ${test_name}.cc)
|
|
|
|
else ()
|
2017-12-29 20:43:29 +01:00
|
|
|
message (FATAL_ERROR "No source file found for test ${test_name}")
|
2017-12-05 23:43:28 +01:00
|
|
|
endif ()
|
2018-02-08 23:59:32 +01:00
|
|
|
target_link_libraries (${test_name} harfbuzz harfbuzz-subset)
|
2018-03-12 06:38:01 +01:00
|
|
|
if (WIN32)
|
|
|
|
set_property (TARGET ${test_name} PROPERTY RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
|
|
|
|
add_test (NAME ${test_name} COMMAND ${test_name})
|
|
|
|
else (WIN32)
|
|
|
|
add_test (${test_name} ${test_name})
|
|
|
|
endif (WIN32)
|
2017-12-05 23:43:28 +01:00
|
|
|
endforeach ()
|
2017-12-29 20:43:29 +01:00
|
|
|
set_tests_properties (${TEST_PROGS} PROPERTIES ENVIRONMENT
|
2017-12-05 23:43:28 +01:00
|
|
|
"G_TEST_SRCDIR=${CMAKE_CURRENT_SOURCE_DIR};G_TEST_BUILDDIR=${CMAKE_CURRENT_BINARY_DIR}"
|
2017-12-29 20:43:29 +01:00
|
|
|
)
|
|
|
|
endif ()
|