From c77d994dc44a9ef8f87dd36661201f499877fc34 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C5=99emysl=20Eric=20Janouch?= Date: Sun, 11 Jun 2023 17:45:38 +0200 Subject: [PATCH] Rename tools, make them installable --- CMakeLists.txt | 10 ++++++++-- README.adoc | 8 ++++---- src/{add-pronunciation.c => tdv-add-pronunciation.c} | 0 src/{query-tool.c => tdv-query-tool.c} | 0 src/{tabfile.c => tdv-tabfile.c} | 0 src/{transform.c => tdv-transform.c} | 2 +- 6 files changed, 13 insertions(+), 7 deletions(-) rename src/{add-pronunciation.c => tdv-add-pronunciation.c} (100%) rename src/{query-tool.c => tdv-query-tool.c} (100%) rename src/{tabfile.c => tdv-tabfile.c} (100%) rename src/{transform.c => tdv-transform.c} (98%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d4c494..f995dd4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,14 +285,17 @@ endif () target_link_libraries (${PROJECT_NAME} ${project_libraries}) # Tools -set (tools tabfile add-pronunciation query-tool transform) +set (tools tdv-tabfile tdv-add-pronunciation tdv-query-tool tdv-transform) foreach (tool ${tools}) add_executable (${tool} EXCLUDE_FROM_ALL src/${tool}.c ${project_common_sources}) target_link_libraries (${tool} ${project_common_libraries}) endforeach () -add_custom_target (tools DEPENDS ${tools}) +option (WITH_TOOLS "Build and install some StarDict tools" ${UNIX}) +if (WITH_TOOLS) + add_custom_target (tools ALL DEPENDS ${tools}) +endif () # Example dictionaries file (GLOB dicts_scripts "${PROJECT_SOURCE_DIR}/dicts/*.*") @@ -315,6 +318,9 @@ if (NOT WIN32) install (TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR}) install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR}) + if (WITH_TOOLS) + install (TARGETS ${tools} DESTINATION ${CMAKE_INSTALL_BINDIR}) + endif () if (WITH_GUI) install (FILES ${PROJECT_NAME}.svg DESTINATION ${CMAKE_INSTALL_DATADIR}/icons/hicolor/scalable/apps) diff --git a/README.adoc b/README.adoc index 0d9ca4e..ab2b4be 100644 --- a/README.adoc +++ b/README.adoc @@ -81,10 +81,10 @@ The `make dicts` command will build some examples from freely available sources: - Czech foreign words (the site's export is broken as of 2022/08, no response) - Czech WordNet 1.9 PDT (synonyms, hypernyms, hyponyms) -You can use the included 'transform' tool to convert already existing StarDict -dictionaries that are nearly good as they are. Remember that you can change -the `sametypesequence` of the resulting '.ifo' file to another format, or run -'dictzip' on '.dict' files to make them compact. +You can use the included 'tdv-transform' tool to convert already existing +StarDict dictionaries that are nearly good as they are. Remember that you can +change the `sametypesequence` of the resulting '.ifo' file to another format, +or run 'dictzip' on '.dict' files to make them compact. https://mega.co.nz/#!axtD0QRK!sbtBgizksyfkPqKvKEgr8GQ11rsWhtqyRgUUV0B7pwg[CZ <--> EN/DE/PL/RU dictionaries] diff --git a/src/add-pronunciation.c b/src/tdv-add-pronunciation.c similarity index 100% rename from src/add-pronunciation.c rename to src/tdv-add-pronunciation.c diff --git a/src/query-tool.c b/src/tdv-query-tool.c similarity index 100% rename from src/query-tool.c rename to src/tdv-query-tool.c diff --git a/src/tabfile.c b/src/tdv-tabfile.c similarity index 100% rename from src/tabfile.c rename to src/tdv-tabfile.c diff --git a/src/transform.c b/src/tdv-transform.c similarity index 98% rename from src/transform.c rename to src/tdv-transform.c index ba33dee..7520eb8 100644 --- a/src/transform.c +++ b/src/tdv-transform.c @@ -3,7 +3,7 @@ * * The external filter needs to process NUL-separated textual entries. * - * Example: transform input.ifo output -- perl -p0e s/bullshit/soykaf/g + * Example: tdv-transform input.ifo output -- perl -p0e s/bullshit/soykaf/g * * Copyright (c) 2020, Přemysl Eric Janouch *