From c77d994dc44a9ef8f87dd36661201f499877fc34 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sun, 11 Jun 2023 17:45:38 +0200 Subject: Rename tools, make them installable --- CMakeLists.txt | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'CMakeLists.txt') 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) -- cgit v1.2.3-70-g09d2