reduce code duplication in build system
- get rid of qmake project file - provide CMake modules for common tasks - provide templates for *.desktop files
This commit is contained in:
parent
a38ea5629f
commit
69605bc09d
268
CMakeLists.txt
268
CMakeLists.txt
|
@ -3,6 +3,7 @@ cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
||||||
# meta data
|
# meta data
|
||||||
set(META_PROJECT_NAME tageditor)
|
set(META_PROJECT_NAME tageditor)
|
||||||
set(META_APP_NAME "Tag Editor")
|
set(META_APP_NAME "Tag Editor")
|
||||||
|
set(META_APP_CATEGORIES "Utility;Audio;Video;")
|
||||||
set(META_APP_AUTHOR "Martchus")
|
set(META_APP_AUTHOR "Martchus")
|
||||||
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
set(META_APP_URL "https://github.com/${META_APP_AUTHOR}/${META_PROJECT_NAME}")
|
||||||
set(META_APP_DESCRIPTION "A tageditor with Qt GUI and command line interface. Supports MP4 (iTunes), ID3, Vorbis, Opus and Matroska.")
|
set(META_APP_DESCRIPTION "A tageditor with Qt GUI and command line interface. Supports MP4 (iTunes), ID3, Vorbis, Opus and Matroska.")
|
||||||
|
@ -10,15 +11,6 @@ set(META_VERSION_MAJOR 1)
|
||||||
set(META_VERSION_MINOR 4)
|
set(META_VERSION_MINOR 4)
|
||||||
set(META_VERSION_PATCH 0)
|
set(META_VERSION_PATCH 0)
|
||||||
|
|
||||||
# stringification of meta data
|
|
||||||
set(META_PROJECT_NAME_STR "\"${META_PROJECT_NAME}\"")
|
|
||||||
set(META_APP_NAME_STR "\"${META_APP_NAME}\"")
|
|
||||||
set(META_APP_AUTHOR_STR "\"${META_APP_AUTHOR}\"")
|
|
||||||
set(META_APP_URL_STR "\"${META_APP_URL}\"")
|
|
||||||
set(META_APP_DESCRIPTION_STR "\"${META_APP_DESCRIPTION}\"")
|
|
||||||
set(META_APP_VERSION ${META_VERSION_MAJOR}.${META_VERSION_MINOR}.${META_VERSION_PATCH})
|
|
||||||
set(META_APP_VERSION_STR "\"${META_APP_VERSION}\"")
|
|
||||||
|
|
||||||
# add project files
|
# add project files
|
||||||
set(HEADER_FILES
|
set(HEADER_FILES
|
||||||
application/knownfieldmodel.h
|
application/knownfieldmodel.h
|
||||||
|
@ -36,6 +28,7 @@ set(SRC_FILES
|
||||||
misc/htmlinfo.cpp
|
misc/htmlinfo.cpp
|
||||||
misc/utility.cpp
|
misc/utility.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
set(WIDGETS_HEADER_FILES
|
set(WIDGETS_HEADER_FILES
|
||||||
gui/entertargetdialog.h
|
gui/entertargetdialog.h
|
||||||
gui/javascripthighlighter.h
|
gui/javascripthighlighter.h
|
||||||
|
@ -116,242 +109,55 @@ set(WIDGETS_UI_FILES
|
||||||
gui/tageditorwidget.ui
|
gui/tageditorwidget.ui
|
||||||
gui/dbquerywidget.ui
|
gui/dbquerywidget.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
#set(QUICK_HEADER_FILES
|
#set(QUICK_HEADER_FILES
|
||||||
#)
|
#)
|
||||||
#set(QUICK_SRC_FILES
|
#set(QUICK_SRC_FILES
|
||||||
# resources/icons.qrc
|
# resources/icons.qrc
|
||||||
#)
|
#)
|
||||||
|
|
||||||
set(TS_FILES
|
set(TS_FILES
|
||||||
translations/${META_PROJECT_NAME}_de_DE.ts
|
translations/${META_PROJECT_NAME}_de_DE.ts
|
||||||
translations/${META_PROJECT_NAME}_en_US.ts
|
translations/${META_PROJECT_NAME}_en_US.ts
|
||||||
)
|
)
|
||||||
|
|
||||||
# define project
|
set(ICON_FILES
|
||||||
project(${META_PROJECT_NAME})
|
resources/icons/hicolor/scalable/apps/${META_PROJECT_NAME}.svg
|
||||||
|
|
||||||
# add configuration header
|
|
||||||
configure_file(
|
|
||||||
"${PROJECT_SOURCE_DIR}/resources/config.h.in"
|
|
||||||
"${PROJECT_BINARY_DIR}/resources/config.h"
|
|
||||||
)
|
|
||||||
include_directories("${PROJECT_BINARY_DIR}")
|
|
||||||
|
|
||||||
# set "GUI-type" to WIN32 to hide console under windows
|
|
||||||
if(WIN32)
|
|
||||||
set(GUI_TYPE WIN32)
|
|
||||||
endif(WIN32)
|
|
||||||
|
|
||||||
# add windows resource file
|
|
||||||
if(MINGW)
|
|
||||||
# creation windows icon from png with ffmpeg if available
|
|
||||||
find_program(FFMPEG_BIN ffmpeg avconv)
|
|
||||||
if(FFMPEG_BIN)
|
|
||||||
set(PNG_ICON_PATH "${PROJECT_SOURCE_DIR}/resources/icons/hicolor/128x128/apps/${META_PROJECT_NAME}.png")
|
|
||||||
if(EXISTS ${PNG_ICON_PATH})
|
|
||||||
set(WINDOWS_ICON_PATH "${PROJECT_BINARY_DIR}/${META_PROJECT_NAME}.ico")
|
|
||||||
set(WINDOWS_ICON_RC_ENTRY "IDI_ICON1 ICON DISCARDABLE \"${WINDOWS_ICON_PATH}\"")
|
|
||||||
add_custom_command(
|
|
||||||
OUTPUT "${WINDOWS_ICON_PATH}"
|
|
||||||
COMMAND ${FFMPEG_BIN} -y -i "${PNG_ICON_PATH}" -vf crop=iw-20:ih-20:10:10,scale=64:64 "${WINDOWS_ICON_PATH}"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif(FFMPEG_BIN)
|
|
||||||
# create windows rc file from template
|
|
||||||
set(WINDOWS_EXT "exe")
|
|
||||||
configure_file(
|
|
||||||
"${PROJECT_SOURCE_DIR}/resources/windows.rc.in"
|
|
||||||
"${PROJECT_BINARY_DIR}/resources/windows.rc"
|
|
||||||
)
|
|
||||||
# set windres as resource compiler
|
|
||||||
set(RES_FILES "${PROJECT_BINARY_DIR}/resources/windows.rc")
|
|
||||||
set(CMAKE_RC_COMPILER_INIT windres)
|
|
||||||
set(CMAKE_RC_COMPILE_OBJECT "<CMAKE_RC_COMPILER> <FLAGS> -O coff <DEFINES> -i <SOURCE> -o <OBJECT>")
|
|
||||||
enable_language(RC)
|
|
||||||
endif(MINGW)
|
|
||||||
|
|
||||||
# read cached variables
|
|
||||||
set(WIDGETS_GUI "yes" CACHE STRING "enables/disables building the Qt Widgets GUI: yes (default) or no")
|
|
||||||
set(JS_PROVIDER "auto" CACHE STRING "specifies the JavaScript provider: auto (default), qml or script")
|
|
||||||
set(WEBVIEW_PROVIDER "auto" CACHE STRING "specifies the webview provider: auto (default), webkit or webengine")
|
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
|
||||||
message(STATUS "Building with Qt Widgets GUI.")
|
|
||||||
elseif(${WIDGETS_GUI} STREQUAL "no")
|
|
||||||
message(STATUS "Building WITHOUT Qt Widgets GUI.")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "Specification whether to build with Qt Widgets GUI is invalid (must be either yes or no).")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
|
|
||||||
# check required Qt 5 modules
|
|
||||||
find_package(Qt5Core REQUIRED)
|
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
|
||||||
find_package(Qt5Gui REQUIRED)
|
|
||||||
find_package(Qt5Widgets REQUIRED)
|
|
||||||
find_package(Qt5LinguistTools REQUIRED)
|
|
||||||
find_package(Qt5Concurrent REQUIRED)
|
|
||||||
find_package(Qt5Network REQUIRED)
|
|
||||||
set(WIDGETS_LIBS Qt5::Core Qt5::Widgets Qt5::Concurrent Qt5::Network)
|
|
||||||
# select Qt module providing JavaScript (either Qt Script or Qt Qml)
|
|
||||||
if(${JS_PROVIDER} STREQUAL "auto")
|
|
||||||
find_package(Qt5Script)
|
|
||||||
if(Qt5Script_FOUND)
|
|
||||||
set(JS_PROVIDER Qt5::Script)
|
|
||||||
message(STATUS "No JavaScript provider explicitely specified, defaulting to Qt Script.")
|
|
||||||
else()
|
|
||||||
find_package(Qt5Qml REQUIRED)
|
|
||||||
set(JS_PROVIDER Qt5::Qml)
|
|
||||||
message(STATUS "No JavaScript provider explicitely specified, defaulting to Qt Qml.")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if(${JS_PROVIDER} STREQUAL "script")
|
|
||||||
find_package(Qt5Script REQUIRED)
|
|
||||||
set(JS_PROVIDER Qt5::Script)
|
|
||||||
message(STATUS "Using Qt Script as JavaScript provider.")
|
|
||||||
elseif(${JS_PROVIDER} STREQUAL "qml")
|
|
||||||
find_package(Qt5Qml REQUIRED)
|
|
||||||
set(JS_PROVIDER Qt5::Qml)
|
|
||||||
set(JS_DEFINITION -DTAGEDITOR_USE_JSENGINE)
|
|
||||||
message(STATUS "Using Qt Qml as JavaScript provider.")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "The specified JavaScript provider '${JS_PROVIDER}' is unknown.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
# select Qt module providing webview (either Qt WebKit or Qt WebEngine)
|
|
||||||
if(${WEBVIEW_PROVIDER} STREQUAL "auto")
|
|
||||||
find_package(Qt5WebKitWidgets)
|
|
||||||
if(Qt5WebKitWidgets_FOUND)
|
|
||||||
set(WEBVIEW_PROVIDER Qt5::WebKitWidgets)
|
|
||||||
message(STATUS "No webview provider explicitely specified, defaulting to Qt WebKit.")
|
|
||||||
else()
|
|
||||||
find_package(Qt5WebEngineWidgets REQUIRED)
|
|
||||||
set(WEBVIEW_PROVIDER Qt5::WebEngineWidgets)
|
|
||||||
set(WEBVIEW_DEFINITION -DTAGEDITOR_USE_WEBENGINE)
|
|
||||||
message(STATUS "No webview provider explicitely specified, defaulting to Qt WebEngine.")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
if(${WEBVIEW_PROVIDER} STREQUAL "webkit")
|
|
||||||
find_package(Qt5WebKitWidgets REQUIRED)
|
|
||||||
set(WEBVIEW_PROVIDER Qt5::WebKitWidgets)
|
|
||||||
message(STATUS "Using Qt WebKit as webview provider.")
|
|
||||||
elseif(${WEBVIEW_PROVIDER} STREQUAL "webengine")
|
|
||||||
find_package(Qt5WebEngineWidgets REQUIRED)
|
|
||||||
set(WEBVIEW_PROVIDER Qt5::WebEngineWidgets)
|
|
||||||
set(WEBVIEW_DEFINITION -DTAGEDITOR_USE_WEBENGINE)
|
|
||||||
message(STATUS "Using Qt WebEngine as webview provider.")
|
|
||||||
elseif(${WEBVIEW_PROVIDER} STREQUAL "none")
|
|
||||||
set(WEBVIEW_DEFINITION -DTAGEDITOR_NO_WEBVIEW)
|
|
||||||
message(STATUS "Webview has been disabled.")
|
|
||||||
else()
|
|
||||||
message(FATAL_ERROR "The specified webview provider '${WEBVIEW_PROVIDER}' is unknown.")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# enable Qt Widgets GUI
|
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
|
||||||
add_definitions(
|
|
||||||
-DGUI_QTWIDGETS
|
|
||||||
-DMODEL_UNDO_SUPPORT
|
|
||||||
${JS_DEFINITION}
|
|
||||||
${WEBVIEW_DEFINITION}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# disable new ABI (can't catch ios_base::failure with new ABI)
|
|
||||||
add_definitions(
|
|
||||||
-D_GLIBCXX_USE_CXX11_ABI=0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# enable code for debugging
|
# find c++utilities
|
||||||
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
find_package(c++utilities REQUIRED)
|
||||||
add_definitions(-DDEBUG_BUILD)
|
use_cpp_utilities()
|
||||||
message(STATUS "Debug build enabled.")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# enable moc, uic and rcc
|
# find qtutilities
|
||||||
set(CMAKE_AUTOMOC ON)
|
find_package(qtutilities REQUIRED)
|
||||||
set(CMAKE_AUTORCC ON)
|
use_qt_utilities()
|
||||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
|
||||||
set(CMAKE_AUTOUIC ON)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# enable lrelease
|
# find tagparser
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
find_package(tagparser REQUIRED)
|
||||||
qt5_add_translation(QM_FILES ${TS_FILES})
|
use_tag_parser()
|
||||||
add_custom_target(translations ALL DEPENDS ${QM_FILES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# stuff which is only required when building Qt GUI
|
# add Qt modules which can currently not be detected automatically
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
list(APPEND ADDITIONAL_QT_MODULES Concurrent Network)
|
||||||
set(WIDGETS_STUFF ${GUI_TYPE} ${WIDGETS_HEADER_FILES} ${WIDGETS_SRC_FILES} ${WIDGETS_UI_FILES} ${QM_FILES} ${RES_FILES})
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# executable and linking
|
# include modules to apply configuration
|
||||||
add_executable(${META_PROJECT_NAME} ${HEADER_FILES} ${SRC_FILES} ${WIDGETS_STUFF} ${WINDOWS_ICON_PATH})
|
include(BasicConfig)
|
||||||
target_link_libraries(${META_PROJECT_NAME} c++utilities qtutilities tagparser ${WIDGETS_LIBS} ${JS_PROVIDER} ${WEBVIEW_PROVIDER})
|
include(QtGuiConfig)
|
||||||
set_target_properties(${META_PROJECT_NAME} PROPERTIES
|
include(QtConfig)
|
||||||
CXX_STANDARD 11
|
include(JsProviderConfig)
|
||||||
|
include(WebViewProviderConfig)
|
||||||
|
include(WindowsResources)
|
||||||
|
include(AppTarget)
|
||||||
|
|
||||||
|
# create desktop file using previously defined meta data
|
||||||
|
add_desktop_file()
|
||||||
|
|
||||||
|
# create custom desktop file for launching the renaming utility separately
|
||||||
|
add_custom_desktop_file(
|
||||||
|
"${META_PROJECT_NAME}-renamingutility"
|
||||||
|
"Renaming utility (${META_APP_NAME})"
|
||||||
|
"Tool to rename tags using tag information."
|
||||||
|
"${META_APP_CATEGORIES}"
|
||||||
|
"${META_PROJECT_NAME} qt-gui --renaming-utility"
|
||||||
|
"${META_PROJECT_NAME}"
|
||||||
)
|
)
|
||||||
|
|
||||||
# add install target
|
|
||||||
install(TARGETS ${META_PROJECT_NAME}
|
|
||||||
RUNTIME DESTINATION bin
|
|
||||||
COMPONENT binary
|
|
||||||
)
|
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
|
||||||
install(FILES resources/icons/hicolor/scalable/apps/${META_PROJECT_NAME}.svg
|
|
||||||
DESTINATION share/icons/hicolor/scalable/apps
|
|
||||||
COMPONENT desktop
|
|
||||||
)
|
|
||||||
install(FILES resources/desktop/applications/${META_PROJECT_NAME}.desktop
|
|
||||||
DESTINATION share/applications
|
|
||||||
COMPONENT desktop
|
|
||||||
)
|
|
||||||
install(FILES resources/desktop/applications/${META_PROJECT_NAME}-renamingutility.desktop
|
|
||||||
DESTINATION share/applications
|
|
||||||
COMPONENT desktop
|
|
||||||
)
|
|
||||||
install(FILES ${QM_FILES}
|
|
||||||
DESTINATION share/${META_PROJECT_NAME}/translations
|
|
||||||
COMPONENT localization
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(NOT TARGET install-binary)
|
|
||||||
add_custom_target(install-binary
|
|
||||||
DEPENDS ${META_PROJECT_NAME}
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(${WIDGETS_GUI} STREQUAL "yes")
|
|
||||||
if(NOT TARGET install-desktop)
|
|
||||||
add_custom_target(install-desktop
|
|
||||||
DEPENDS ${META_PROJECT_NAME}
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=desktop -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
# localization isn't provided for the command line interface
|
|
||||||
if(NOT TARGET install-localization)
|
|
||||||
set(LOCALIZATION_TARGET "install-localization")
|
|
||||||
add_custom_target(install-localization
|
|
||||||
DEPENDS ${META_PROJECT_NAME}
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=localization -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
if(NOT TARGET install-mingw-w64)
|
|
||||||
add_custom_target(install-mingw-w64
|
|
||||||
DEPENDS install-binary ${LOCALIZATION_TARGET}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(NOT TARGET install-binary-strip)
|
|
||||||
add_custom_target(install-binary-strip
|
|
||||||
DEPENDS ${META_PROJECT_NAME}
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -DCMAKE_INSTALL_DO_STRIP=1 -DCMAKE_INSTALL_COMPONENT=binary -P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
if(NOT TARGET install-mingw-w64-strip)
|
|
||||||
add_custom_target(install-mingw-w64-strip
|
|
||||||
DEPENDS install-binary-strip ${LOCALIZATION_TARGET}
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
|
@ -0,0 +1,94 @@
|
||||||
|
__tageditorcompappend ()
|
||||||
|
{
|
||||||
|
local x i=${#COMPREPLY[@]}
|
||||||
|
for x in $1; do
|
||||||
|
if [[ "$x" == "$3"* ]]; then
|
||||||
|
COMPREPLY[i++]="$2$x$4"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__tageditorcomp ()
|
||||||
|
{
|
||||||
|
local cur_="${3-$cur}"
|
||||||
|
case "$cur_" in
|
||||||
|
--*=)
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
local c i=0 IFS=$' \t\n'
|
||||||
|
for c in $1; do
|
||||||
|
c="$c${4-}"
|
||||||
|
if [[ $c == "$cur_"* ]]; then
|
||||||
|
case $c in
|
||||||
|
--*=*|*.) ;;
|
||||||
|
*) c="$c " ;;
|
||||||
|
esac
|
||||||
|
COMPREPLY[i++]="${2-}$c"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
}
|
||||||
|
|
||||||
|
__tageditorcomp_nl_append ()
|
||||||
|
{
|
||||||
|
local IFS=$'\n'
|
||||||
|
__tageditorcompappend "$1" "${2-}" "${3-$cur}" "${4- }"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
__tageditorcomp_nl ()
|
||||||
|
{
|
||||||
|
COMPREPLY=()
|
||||||
|
__tageditorcomp_nl_append "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
_tageditor ()
|
||||||
|
{
|
||||||
|
local cur prev opts base
|
||||||
|
COMPREPLY=()
|
||||||
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
#
|
||||||
|
# The basic options we'll complete.
|
||||||
|
#
|
||||||
|
opts="get set --help"
|
||||||
|
|
||||||
|
|
||||||
|
#
|
||||||
|
# Complete the arguments to some of the basic commands.
|
||||||
|
#
|
||||||
|
case "${cur}" in
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
case "${prev}" in
|
||||||
|
=)
|
||||||
|
COMPREPLY=( $(compgen -A file -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
cover)
|
||||||
|
COMPREPLY=( $(compgen -A file) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
get)
|
||||||
|
#__tageditorcomp $(tageditor --print-field-names)
|
||||||
|
COMPREPLY=( $(compgen -W "$(tageditor --print-field-names)" -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
set)
|
||||||
|
#__tageditorcomp_nl "$(tageditor --print-field-names)"
|
||||||
|
COMPREPLY=( $(compgen -W "$(tageditor --print-field-names)" -S = -- ${cur}) )
|
||||||
|
return 0
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -F _tageditor tageditor
|
103
general.pri
103
general.pri
|
@ -1,103 +0,0 @@
|
||||||
# specify build directories for moc, object and rcc files
|
|
||||||
MOC_DIR = ./moc
|
|
||||||
OBJECTS_DIR = ./obj
|
|
||||||
RCC_DIR = ./res
|
|
||||||
|
|
||||||
# compiler flags: enable C++11
|
|
||||||
QMAKE_CXXFLAGS += -std=c++11
|
|
||||||
QMAKE_LFLAGS += -std=c++11
|
|
||||||
|
|
||||||
# disable new ABI (can't catch ios_base::failure with new ABI)
|
|
||||||
DEFINES += _GLIBCXX_USE_CXX11_ABI=0
|
|
||||||
|
|
||||||
# variables to check target architecture
|
|
||||||
win32-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch
|
|
||||||
win32-g++-32:QMAKE_TARGET.arch = x86
|
|
||||||
win32-g++-64:QMAKE_TARGET.arch = x86_64
|
|
||||||
linux-g++:QMAKE_TARGET.arch = $$QMAKE_HOST.arch
|
|
||||||
linux-g++-32:QMAKE_TARGET.arch = x86
|
|
||||||
linux-g++-64:QMAKE_TARGET.arch = x86_64
|
|
||||||
|
|
||||||
# determine and print target prefix
|
|
||||||
targetprefix = $$(TARGET_PREFIX)
|
|
||||||
message("Using target prefix \"$${targetprefix}\".")
|
|
||||||
|
|
||||||
# print install root
|
|
||||||
message("Using install root \"$$(INSTALL_ROOT)\".")
|
|
||||||
|
|
||||||
# set target
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
TARGET = $${targetprefix}$${projectname}d
|
|
||||||
} else {
|
|
||||||
TARGET = $${targetprefix}$${projectname}
|
|
||||||
}
|
|
||||||
|
|
||||||
# add defines for meta data
|
|
||||||
DEFINES += "APP_METADATA_AVAIL"
|
|
||||||
DEFINES += "'PROJECT_NAME=\"$${projectname}\"'"
|
|
||||||
DEFINES += "'APP_NAME=\"$${appname}\"'"
|
|
||||||
DEFINES += "'APP_AUTHOR=\"$${appauthor}\"'"
|
|
||||||
DEFINES += "'APP_URL=\"$${appurl}\"'"
|
|
||||||
DEFINES += "'APP_VERSION=\"$${VERSION}\"'"
|
|
||||||
|
|
||||||
# configure Qt modules and defines
|
|
||||||
mobile {
|
|
||||||
DEFINES += CONFIG_MOBILE
|
|
||||||
} else:desktop {
|
|
||||||
DEFINES += CONFIG_DESKTOP
|
|
||||||
} else:android {
|
|
||||||
CONFIG += mobile
|
|
||||||
DEFINES += CONFIG_MOBILE
|
|
||||||
} else {
|
|
||||||
CONFIG += desktop
|
|
||||||
DEFINES += CONFIG_DESKTOP
|
|
||||||
}
|
|
||||||
no-gui {
|
|
||||||
QT -= gui
|
|
||||||
DEFINES += GUI_NONE
|
|
||||||
guiqtquick || guiqtwidgets {
|
|
||||||
error("Can not use no-gui with guiqtquick or guiqtwidgets.")
|
|
||||||
} else {
|
|
||||||
message("Configured for no GUI support.")
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
QT += gui
|
|
||||||
mobile {
|
|
||||||
CONFIG += guiqtquick
|
|
||||||
}
|
|
||||||
desktop {
|
|
||||||
CONFIG += guiqtwidgets
|
|
||||||
}
|
|
||||||
}
|
|
||||||
guiqtquick {
|
|
||||||
message("Configured for Qt Quick GUI support.")
|
|
||||||
QT += quick
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
CONFIG += qml_debug
|
|
||||||
}
|
|
||||||
DEFINES += GUI_QTQUICK
|
|
||||||
}
|
|
||||||
guiqtwidgets {
|
|
||||||
message("Configured for Qt widgets GUI support.")
|
|
||||||
QT += widgets
|
|
||||||
DEFINES += GUI_QTWIDGETS
|
|
||||||
DEFINES += MODEL_UNDO_SUPPORT
|
|
||||||
}
|
|
||||||
|
|
||||||
# configuration for cross compliation with mingw-w64
|
|
||||||
win32 {
|
|
||||||
QMAKE_TARGET_PRODUCT = "$${appname}"
|
|
||||||
QMAKE_TARGET_COPYRIGHT = "by $${appauthor}"
|
|
||||||
}
|
|
||||||
mingw-w64-manualstrip-dll {
|
|
||||||
QMAKE_POST_LINK=$${CROSS_COMPILE}strip --strip-unneeded ./release/$(TARGET); \
|
|
||||||
$${CROSS_COMPILE}strip --strip-unneeded ./release/lib$(TARGET).a
|
|
||||||
}
|
|
||||||
mingw-w64-manualstrip-exe {
|
|
||||||
QMAKE_POST_LINK=$${CROSS_COMPILE}strip --strip-unneeded ./release/$(TARGET)
|
|
||||||
}
|
|
||||||
mingw-w64-noversion {
|
|
||||||
TARGET_EXT = ".dll"
|
|
||||||
TARGET_VERSION_EXT = ""
|
|
||||||
CONFIG += skip_target_version_ext
|
|
||||||
}
|
|
|
@ -1,9 +0,0 @@
|
||||||
#ifndef APP_METADATA_AVAIL
|
|
||||||
#define APP_METADATA_AVAIL
|
|
||||||
#define PROJECT_NAME @META_PROJECT_NAME_STR@
|
|
||||||
#define APP_NAME @META_APP_NAME_STR@
|
|
||||||
#define APP_VERSION @META_APP_VERSION_STR@
|
|
||||||
#define APP_AUTHOR @META_APP_AUTHOR_STR@
|
|
||||||
#define APP_URL @META_APP_URL_STR@
|
|
||||||
#define APP_DESCRIPTION @META_APP_DESCRIPTION_STR@
|
|
||||||
#endif // APP_METADATA_AVAIL
|
|
|
@ -1,9 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=Renaming utility (Tag Editor)
|
|
||||||
GenericName=Renaming utility (Tag Editor)
|
|
||||||
Comment=Tool to rename files using tag information.
|
|
||||||
Exec=tageditor qt-gui --renaming-utility
|
|
||||||
Icon=tageditor
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Categories=Utility;Audio;Video;
|
|
|
@ -1,9 +0,0 @@
|
||||||
[Desktop Entry]
|
|
||||||
Name=Tag Editor
|
|
||||||
GenericName=Tag editor
|
|
||||||
Comment=A tag editing utility supporting ID3, Vorbis, MP4 (iTunes style) and Matroska tags.
|
|
||||||
Exec=tageditor
|
|
||||||
Icon=tageditor
|
|
||||||
Terminal=false
|
|
||||||
Type=Application
|
|
||||||
Categories=Utility;Audio;Video;
|
|
|
@ -1,40 +0,0 @@
|
||||||
# if defined(UNDER_CE)
|
|
||||||
# include <winbase.h>
|
|
||||||
# else
|
|
||||||
# include <windows.h>
|
|
||||||
# endif
|
|
||||||
|
|
||||||
@WINDOWS_ICON_RC_ENTRY@
|
|
||||||
|
|
||||||
VS_VERSION_INFO VERSIONINFO
|
|
||||||
FILEVERSION @META_VERSION_MAJOR@,@META_VERSION_MINOR@,@META_VERSION_PATCH@,0
|
|
||||||
PRODUCTVERSION @META_VERSION_MAJOR@,@META_VERSION_MINOR@,@META_VERSION_PATCH@,0
|
|
||||||
FILEFLAGSMASK 0x3fL
|
|
||||||
#ifdef _DEBUG
|
|
||||||
FILEFLAGS VS_FF_DEBUG
|
|
||||||
#else
|
|
||||||
FILEFLAGS 0x0L
|
|
||||||
#endif
|
|
||||||
FILEOS VOS__WINDOWS32
|
|
||||||
FILETYPE VFT_DLL
|
|
||||||
FILESUBTYPE 0x0L
|
|
||||||
BEGIN
|
|
||||||
BLOCK "StringFileInfo"
|
|
||||||
BEGIN
|
|
||||||
BLOCK "040904b0"
|
|
||||||
BEGIN
|
|
||||||
VALUE "CompanyName", "@META_APP_AUTHOR@\0"
|
|
||||||
VALUE "FileDescription", "@META_APP_DESCRIPTION@\0"
|
|
||||||
VALUE "FileVersion", "@META_APP_VERSION@\0"
|
|
||||||
VALUE "LegalCopyright", "by @META_APP_AUTHOR@\0"
|
|
||||||
VALUE "OriginalFilename", "@META_PROJECT_NAME@.@WINDOWS_EXT@\0"
|
|
||||||
VALUE "ProductName", "@META_APP_NAME@\0"
|
|
||||||
VALUE "ProductVersion", "@META_APP_VERSION@\0"
|
|
||||||
END
|
|
||||||
END
|
|
||||||
BLOCK "VarFileInfo"
|
|
||||||
BEGIN
|
|
||||||
VALUE "Translation", 0x0409, 1200
|
|
||||||
END
|
|
||||||
END
|
|
||||||
/* End of Version info */
|
|
164
tageditor.pro
164
tageditor.pro
|
@ -1,164 +0,0 @@
|
||||||
# meta data
|
|
||||||
projectname = tageditor
|
|
||||||
appname = "Tag Editor"
|
|
||||||
appauthor = Martchus
|
|
||||||
appurl = "https://github.com/$${appauthor}/$${projectname}"
|
|
||||||
QMAKE_TARGET_DESCRIPTION = "A tageditor with Qt GUI and command line interface. Supports MP4 (iTunes), ID3, Vorbis, Opus and Matroska."
|
|
||||||
VERSION = 1.4.0
|
|
||||||
|
|
||||||
# include ../../common.pri when building as part of a subdirs project; otherwise include general.pri
|
|
||||||
!include(../../common.pri) {
|
|
||||||
!include(./general.pri) {
|
|
||||||
error("Couldn't find the common.pri or the general.pri file!")
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# basic configuration: application
|
|
||||||
TEMPLATE = app
|
|
||||||
QT += core gui widgets concurrent network
|
|
||||||
# use webkitwidgets if available; otherwise use webenginewidgets
|
|
||||||
!forcewebengine:qtHaveModule(webkitwidgets) {
|
|
||||||
QT += webkitwidgets
|
|
||||||
} else {
|
|
||||||
QT += webenginewidgets
|
|
||||||
DEFINES += TAGEDITOR_USE_WEBENGINE
|
|
||||||
}
|
|
||||||
# use script if available; otherwise use qml
|
|
||||||
!forcejsengine:qtHaveModule(script) {
|
|
||||||
QT += script
|
|
||||||
} else {
|
|
||||||
QT += qml
|
|
||||||
DEFINES += TAGEDITOR_USE_JSENGINE
|
|
||||||
}
|
|
||||||
|
|
||||||
# add project files
|
|
||||||
HEADERS += \
|
|
||||||
application/main.h \
|
|
||||||
application/knownfieldmodel.h \
|
|
||||||
application/settings.h \
|
|
||||||
gui/filefilterproxymodel.h \
|
|
||||||
gui/tagfieldedit.h \
|
|
||||||
gui/tagedit.h \
|
|
||||||
gui/mainwindow.h \
|
|
||||||
gui/pathlineedit.h \
|
|
||||||
gui/notificationlabel.h \
|
|
||||||
gui/renamefilesdialog.h \
|
|
||||||
gui/javascripthighlighter.h \
|
|
||||||
gui/picturepreviewselection.h \
|
|
||||||
gui/notificationmodel.h \
|
|
||||||
gui/settingsdialog.h \
|
|
||||||
renamingutility/filesystemitem.h \
|
|
||||||
renamingutility/filesystemitemmodel.h \
|
|
||||||
renamingutility/filteredfilesystemitemmodel.h \
|
|
||||||
renamingutility/renamingengine.h \
|
|
||||||
renamingutility/scriptdefs.h \
|
|
||||||
renamingutility/tageditorobject.h \
|
|
||||||
misc/htmlinfo.h \
|
|
||||||
gui/previousvaluehandling.h \
|
|
||||||
gui/initiate.h \
|
|
||||||
cli/mainfeatures.h \
|
|
||||||
misc/utility.h \
|
|
||||||
gui/entertargetdialog.h \
|
|
||||||
gui/attachmentsmodel.h \
|
|
||||||
gui/attachmentsedit.h \
|
|
||||||
gui/codeedit.h \
|
|
||||||
gui/tageditorwidget.h \
|
|
||||||
dbquery/dbquery.h \
|
|
||||||
gui/dbquerywidget.h
|
|
||||||
|
|
||||||
SOURCES += \
|
|
||||||
application/main.cpp \
|
|
||||||
application/knownfieldmodel.cpp \
|
|
||||||
application/settings.cpp \
|
|
||||||
gui/filefilterproxymodel.cpp \
|
|
||||||
gui/settingsdialog.cpp \
|
|
||||||
gui/mainwindow.cpp \
|
|
||||||
gui/pathlineedit.cpp \
|
|
||||||
gui/notificationlabel.cpp \
|
|
||||||
gui/renamefilesdialog.cpp \
|
|
||||||
gui/javascripthighlighter.cpp \
|
|
||||||
gui/tagfieldedit.cpp \
|
|
||||||
gui/tagedit.cpp \
|
|
||||||
gui/picturepreviewselection.cpp \
|
|
||||||
gui/notificationmodel.cpp \
|
|
||||||
renamingutility/filesystemitem.cpp \
|
|
||||||
renamingutility/filesystemitemmodel.cpp \
|
|
||||||
renamingutility/filteredfilesystemitemmodel.cpp \
|
|
||||||
renamingutility/renamingengine.cpp \
|
|
||||||
renamingutility/tageditorobject.cpp \
|
|
||||||
misc/htmlinfo.cpp \
|
|
||||||
gui/initiate.cpp \
|
|
||||||
cli/mainfeatures.cpp \
|
|
||||||
misc/utility.cpp \
|
|
||||||
gui/entertargetdialog.cpp \
|
|
||||||
gui/attachmentsmodel.cpp \
|
|
||||||
gui/attachmentsedit.cpp \
|
|
||||||
gui/codeedit.cpp \
|
|
||||||
gui/tageditorwidget.cpp \
|
|
||||||
dbquery/dbquery.cpp \
|
|
||||||
gui/dbquerywidget.cpp
|
|
||||||
|
|
||||||
FORMS += \
|
|
||||||
gui/id3v2optionpage.ui \
|
|
||||||
gui/id3v1optionpage.ui \
|
|
||||||
gui/tagprocessinggeneraloptionpage.ui \
|
|
||||||
gui/editorgeneraloptionpage.ui \
|
|
||||||
gui/filebrowsergeneraloptionpage.ui \
|
|
||||||
gui/mainwindow.ui \
|
|
||||||
gui/renamefilesdialog.ui \
|
|
||||||
gui/editorautocorrectionoptionpage.ui \
|
|
||||||
gui/picturepreviewselection.ui \
|
|
||||||
gui/editorfieldsoptionpage.ui \
|
|
||||||
gui/editordbqueryoptionpage.ui \
|
|
||||||
gui/infooptionpage.ui \
|
|
||||||
gui/entertargetdialog.ui \
|
|
||||||
gui/attachmentsedit.ui \
|
|
||||||
gui/editortempoptionpage.ui \
|
|
||||||
gui/filelayout.ui \
|
|
||||||
gui/tageditorwidget.ui \
|
|
||||||
gui/dbquerywidget.ui
|
|
||||||
|
|
||||||
RESOURCES += \
|
|
||||||
resources/icons.qrc \
|
|
||||||
resources/scripts.qrc
|
|
||||||
|
|
||||||
TRANSLATIONS = \
|
|
||||||
translations/tageditor_en_US.ts \
|
|
||||||
translations/tageditor_de_DE.ts
|
|
||||||
|
|
||||||
OTHER_FILES += \
|
|
||||||
README.md \
|
|
||||||
LICENSE \
|
|
||||||
CMakeLists.txt \
|
|
||||||
resources/config.h.in \
|
|
||||||
resources/windows.rc.in
|
|
||||||
|
|
||||||
# release translations
|
|
||||||
include(translations.pri)
|
|
||||||
|
|
||||||
# add libs
|
|
||||||
CONFIG(debug, debug|release) {
|
|
||||||
LIBS += -lc++utilitiesd -ltagparserd
|
|
||||||
!no-gui {
|
|
||||||
LIBS += -lqtutilitiesd
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
LIBS += -lc++utilities -ltagparser
|
|
||||||
!no-gui {
|
|
||||||
LIBS += -lqtutilities
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
# installs
|
|
||||||
target.path = $$(INSTALL_ROOT)/bin
|
|
||||||
INSTALLS += target
|
|
||||||
!mingw-w64-install {
|
|
||||||
icon.path = $$(INSTALL_ROOT)/share/icons/hicolor/scalable/apps/
|
|
||||||
icon.files = $${PWD}/resources/icons/hicolor/scalable/apps/$${projectname}.svg
|
|
||||||
INSTALLS += icon
|
|
||||||
menu.path = $$(INSTALL_ROOT)/share/applications/
|
|
||||||
menu.files = \
|
|
||||||
$${PWD}/resources/desktop/applications/$${projectname}.desktop \
|
|
||||||
$${PWD}/resources/desktop/applications/$${projectname}-renamingutility.desktop
|
|
||||||
INSTALLS += menu
|
|
||||||
}
|
|
|
@ -1,15 +0,0 @@
|
||||||
!isEmpty(TRANSLATIONS) {
|
|
||||||
isEmpty(lreleasepath) {
|
|
||||||
lreleasepath = $$[QT_HOST_BINS]/lrelease
|
|
||||||
}
|
|
||||||
genqm.name = translations
|
|
||||||
genqm.input = TRANSLATIONS
|
|
||||||
genqm.output = $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
|
|
||||||
genqm.commands = $$lreleasepath ${QMAKE_FILE_IN} -qm $${OUT_PWD}/translations/${QMAKE_FILE_BASE}.qm
|
|
||||||
genqm.CONFIG = no_link
|
|
||||||
QMAKE_EXTRA_COMPILERS += genqm
|
|
||||||
PRE_TARGETDEPS += compiler_genqm_make_all
|
|
||||||
translations.path = $$(INSTALL_ROOT)/share/$${projectname}/translations/
|
|
||||||
translations.extra = install -m644 -D $${OUT_PWD}/translations/*.qm $$(INSTALL_ROOT)/share/$${projectname}/translations/
|
|
||||||
INSTALLS += translations
|
|
||||||
}
|
|
Loading…
Reference in New Issue