-
Notifications
You must be signed in to change notification settings - Fork 732
Expand file tree
/
Copy pathCMakeLists.txt
More file actions
88 lines (83 loc) · 2.31 KB
/
Copy pathCMakeLists.txt
File metadata and controls
88 lines (83 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
configure_file(test_macros.h.in test_macros.h @ONLY)
# Build thread utilities as a library
add_library(test_thread_utils STATIC test_thread_utils.c)
target_include_directories(test_thread_utils PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
set(TESTS
test_acmod
test_acmod_grow
test_alignment
test_allphone
test_bitvec
test_config
test_dict2pid
test_dict
test_dict_strcat
test_fe
test_fe_warp_overflow
test_fwdflat
test_fwdtree_bestpath
test_fwdtree
test_init
test_jsgf
test_keyphrase
test_lattice
test_lm_convert
test_ngram_model_read
test_log_shifted
test_log_int8
test_log_int16
test_mllr
test_nbest
test_pitch
test_posterior
test_ptm_mgau
test_reinit
test_senfh
test_set_search
test_simple
test_state_align
test_vad
test_vad_alloc
test_word_align
test_align_fsg_beam
test_endpointer
test_endpointer_timestamp
test_thread_local_compile
test_thread_local_basic
test_thread_utils_self
test_genrand_baseline
test_genrand_thread
test_genrand_thread_tls
)
foreach(TEST_EXECUTABLE ${TESTS})
add_executable(${TEST_EXECUTABLE} EXCLUDE_FROM_ALL ${TEST_EXECUTABLE}.c)
target_link_libraries(${TEST_EXECUTABLE} pocketsphinx)
target_include_directories(
${TEST_EXECUTABLE} PRIVATE ${CMAKE_SOURCE_DIR}/src
${TEST_EXECUTABLE} PRIVATE ${CMAKE_BINARY_DIR}
${TEST_EXECUTABLE} PRIVATE ${CMAKE_CURRENT_BINARY_DIR}
)
add_test(NAME ${TEST_EXECUTABLE} COMMAND ${TEST_EXECUTABLE})
add_dependencies(check ${TEST_EXECUTABLE})
endforeach()
# Some tests need thread utilities and pthread support
if(NOT WIN32)
find_package(Threads REQUIRED)
target_link_libraries(test_thread_local_basic ${CMAKE_THREAD_LIBS_INIT})
target_link_libraries(test_thread_utils ${CMAKE_THREAD_LIBS_INIT})
endif()
# test_thread_utils_self needs the thread utilities library
target_link_libraries(test_thread_utils_self test_thread_utils)
# test_genrand_thread needs thread utilities
target_link_libraries(test_genrand_thread test_thread_utils)
target_link_libraries(test_genrand_thread_tls test_thread_utils)
add_subdirectory(test_alloc)
add_subdirectory(test_case)
add_subdirectory(test_feat)
add_subdirectory(test_fsg)
add_subdirectory(test_hash)
add_subdirectory(test_lineiter)
add_subdirectory(test_matrix)
add_subdirectory(test_ngram)
add_subdirectory(test_string)
add_subdirectory(test_util)