| 1 |
add_executable(performance Performance.cpp) |
| 2 |
target_link_libraries(performance benchmark libopencc) |
| 3 |
add_dependencies(performance opencc Dictionaries) |
| 4 |
target_compile_definitions( |
| 5 |
performance PRIVATE OPENCC_BENCHMARK_OPENCC_PATH="$<TARGET_FILE:opencc>" |
| 6 |
) |
| 7 |
add_test(BenchmarkTest performance) |
| 8 |
|
| 9 |
if (WIN32) |
| 10 |
add_custom_target( |
| 11 |
copy_benchmark |
| 12 |
${CMAKE_COMMAND} -E copy $<TARGET_FILE:benchmark> ${CMAKE_CURRENT_BINARY_DIR} |
| 13 |
COMMENT "Copying benchmark to src/benchmark" |
| 14 |
) |
| 15 |
add_custom_target( |
| 16 |
copy_libopencc |
| 17 |
${CMAKE_COMMAND} -E copy $<TARGET_FILE:libopencc> ${CMAKE_CURRENT_BINARY_DIR} |
| 18 |
COMMENT "Copying libopencc to src/benchmark" |
| 19 |
) |
| 20 |
add_dependencies(performance copy_benchmark copy_libopencc) |
| 21 |
endif() |