Skip to content

Commit d07d3dd

Browse files
committed
fix #146 : 1.1.3: renaming the executable file
1 parent 04cb736 commit d07d3dd

14 files changed

Lines changed: 27 additions & 23 deletions

CMakeLists.txt

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
22

3+
set(target_name scantailor-advanced)
4+
35
# Disable in-source builds.
46
if ("${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
57
message(FATAL_ERROR
@@ -284,7 +286,7 @@ option(PORTABLE_VERSION "Whether to build the portable version." ON)
284286
if (PORTABLE_VERSION)
285287
set(PORTABLE_CONFIG_DIR "config")
286288
endif()
287-
set(APPLICATION_NAME "scantailor-advanced")
289+
set(APPLICATION_NAME "${target_name}")
288290
if (WIN32)
289291
set(TRANSLATION_DIRS ".:translations")
290292
set(PLUGIN_DIRS ".")
@@ -331,14 +333,14 @@ set(SCANTAILOR_RESOURCES_DIR "${CMAKE_SOURCE_DIR}/src/resources")
331333
set(SCANTAILOR_TRANSLATIONS_DIR "${CMAKE_SOURCE_DIR}/src/translations")
332334

333335
configure_file(
334-
"${SCANTAILOR_RESOURCES_DIR}/unix/scantailor.desktop.in"
335-
"${CMAKE_BINARY_DIR}/scantailor.desktop"
336+
"${SCANTAILOR_RESOURCES_DIR}/unix/${target_name}.desktop.in"
337+
"${CMAKE_BINARY_DIR}/${target_name}.desktop"
336338
@ONLY)
337339

338340
add_subdirectory(src)
339341

340342
# Translations
341-
file(GLOB translation_files "${SCANTAILOR_TRANSLATIONS_DIR}/scantailor_*.ts")
343+
file(GLOB translation_files "${SCANTAILOR_TRANSLATIONS_DIR}/${target_name}_*.ts")
342344

343345
finalize_translations(scantailor ${translation_files})
344346
update_translations_target(update_translations scantailor)
@@ -459,11 +461,11 @@ if (WIN32)
459461
endif()
460462

461463
if (UNIX)
462-
install(FILES "${CMAKE_BINARY_DIR}/scantailor.desktop"
464+
install(FILES "${CMAKE_BINARY_DIR}/${target_name}.desktop"
463465
DESTINATION "share/applications")
464466
install(FILES "${SCANTAILOR_RESOURCES_DIR}/appicon.svg"
465467
DESTINATION "share/icons/hicolor/scalable/apps"
466-
RENAME "ScanTailor.svg")
468+
RENAME "${target_name}.svg")
467469
install(FILES "${SCANTAILOR_RESOURCES_DIR}/unix/mime/scantailor-project.xml"
468470
DESTINATION "share/mime/packages")
469471
endif()
@@ -483,17 +485,17 @@ set(CPACK_PACKAGE_VENDOR "4lex4 <4lex49@zoho.com>")
483485
set(CPACK_PACKAGE_CONTACT "${CPACK_PACKAGE_VENDOR}")
484486
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Interactive post-processing tool for scanned pages.")
485487
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_SOURCE_DIR}/LICENSE")
486-
set(CPACK_PACKAGE_EXECUTABLES "scantailor;${CMAKE_PROJECT_NAME}")
487-
set(CPACK_CREATE_DESKTOP_LINKS "scantailor")
488+
set(CPACK_PACKAGE_EXECUTABLES "${target_name};${CMAKE_PROJECT_NAME}")
489+
set(CPACK_CREATE_DESKTOP_LINKS "${target_name}")
488490
if (WIN32)
489-
set(CPACK_NSIS_INSTALLED_ICON_NAME "scantailor.exe")
491+
set(CPACK_NSIS_INSTALLED_ICON_NAME "${target_name}.exe")
490492
set(CPACK_NSIS_PACKAGE_NAME "${CMAKE_PROJECT_NAME}")
491493
set(CPACK_NSIS_DISPLAY_NAME "${CMAKE_PROJECT_NAME} ${VERSION}")
492494
set(CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL ON)
493495
set(CPACK_NSIS_EXECUTABLES_DIRECTORY "${CMAKE_BINARY_DIR}")
494496
set(CPACK_PACKAGE_INSTALL_DIRECTORY "${CMAKE_PROJECT_NAME}")
495497
set(CPACK_NSIS_CREATE_ICONS_EXTRA
496-
"CreateShortCut \\\"$DESKTOP\\\\${CMAKE_PROJECT_NAME}.lnk\\\" \\\"$INSTDIR\\\\scantailor.exe\\\"")
498+
"CreateShortCut \\\"$DESKTOP\\\\${CMAKE_PROJECT_NAME}.lnk\\\" \\\"$INSTDIR\\\\${target_name}.exe\\\"")
497499
set(CPACK_NSIS_DELETE_ICONS_EXTRA
498500
"Delete \\\"$DESKTOP\\\\${CMAKE_PROJECT_NAME}.lnk\\\"")
499501
endif()

src/app/CMakeLists.txt

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
set(CMAKE_AUTOUIC ON)
22
set(CMAKE_AUTORCC ON)
33

4+
set(target_name scantailor-advanced)
5+
46
set(resource_files
57
resources.qrc
68
dark_scheme/dark_scheme.qrc
@@ -68,26 +70,26 @@ if (WIN32)
6870
endif()
6971

7072
add_executable(
71-
scantailor WIN32 ${gui_only_sources} ${gui_only_ui_files}
73+
${target_name} WIN32 ${gui_only_sources} ${gui_only_ui_files}
7274
${resource_files} ${win32_resource_file})
7375
target_link_libraries(
74-
scantailor
76+
${target_name}
7577
PRIVATE core ${EXTRA_LIBS})
7678
target_include_directories(
77-
scantailor
79+
${target_name}
7880
PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}"
7981
"$<TARGET_PROPERTY:TIFF::TIFF,INTERFACE_INCLUDE_DIRECTORIES>")
80-
install(TARGETS scantailor RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
82+
install(TARGETS ${target_name} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
8183

8284
if (Qt6_FOUND AND WIN32)
8385
#manage plugins with windeployqt.
8486
add_custom_command(
85-
TARGET scantailor
87+
TARGET ${target_name}
8688
POST_BUILD
87-
COMMAND ${QT_BINDIR}/windeployqt $<TARGET_FILE:scantailor>
89+
COMMAND ${QT_BINDIR}/windeployqt $<TARGET_FILE:${target_name}>
8890
COMMENT "deploy qt files alongside binary (e.g. plugins)"
8991
)
9092
install(CODE "execute_process(COMMAND \"${QT_BINDIR}/windeployqt\" \"\$\{CMAKE_INSTALL_PREFIX\}\")")
9193
endif()
9294

93-
translation_sources(scantailor ${gui_only_sources} ${gui_only_ui_files})
95+
translation_sources(${target_name} ${gui_only_sources} ${gui_only_ui_files})

src/resources/unix/scantailor.desktop.in renamed to src/resources/unix/scantailor-advanced.desktop.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Version=1.0
33
X-ScanTailor-Advanced-Version=@VERSION@
44
Name=ScanTailor Advanced
55
Comment=Interactive post-processing tool for scanned pages
6-
Exec=scantailor %f
7-
Icon=ScanTailor
6+
Exec=scantailor-advanced %f
7+
Icon=scantailor-advanced
88
Terminal=false
99
X-MultipleArgs=false
1010
Type=Application

src/resources/win32/resources.rc.in

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#include <windows.h>
22

3-
IDI_ICON1 ICON DISCARDABLE "@SCANTAILOR_WIN_DIR_NATIVE@\\scantailor.ico"
3+
IDI_ICON1 ICON DISCARDABLE "@SCANTAILOR_WIN_DIR_NATIVE@\\scantailor-advanced.ico"
44

55
VS_VERSION_INFO VERSIONINFO
66
FILEVERSION @APPLICATION_VERSION_MAJOR@,@APPLICATION_VERSION_MINOR@,@APPLICATION_VERSION_PATCH@,0
@@ -23,8 +23,8 @@ VS_VERSION_INFO VERSIONINFO
2323
VALUE "FileDescription", "ScanTailor Advanced\0"
2424
VALUE "FileVersion", "@VERSION@.0\0"
2525
VALUE "LegalCopyright", "Copyright (C) Joseph Artsimovich, 4lex4\0"
26-
VALUE "OriginalFilename", "scantailor.exe\0"
27-
VALUE "ProductName", "ScanTailor\0"
26+
VALUE "OriginalFilename", "scantailor-advanced.exe\0"
27+
VALUE "ProductName", "ScanTailor-Advanced\0"
2828
VALUE "ProductVersion", "@VERSION@\0"
2929
END
3030
END
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)