diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c120be..37961ac 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,84 +1,85 @@ #cmake < 3.1 has no sane way of checking C++11 features and needed flags cmake_minimum_required(VERSION 3.1 FATAL_ERROR) - project(kdiff3) +set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_CXX_EXTENSIONS OFF ) #don't use non-standard extentions set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(ECM_MIN_VERSION "1.7.0") set(QT_MIN_VERSION "5.6.0") set(KF5_MIN_VERSION "5.16.0") find_package(ECM ${ECM_MIN_VERSION} CONFIG REQUIRED) set( CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${ECM_MODULE_PATH} ${ECM_KDE_MODULE_DIR} ) include(KDEInstallDirs) include(KDECompilerSettings NO_POLICY_SCOPE) include(KDECMakeSettings NO_POLICY_SCOPE) include(FeatureSummary) include(ECMInstallIcons) include(ECMAddAppIcon) # include(GenerateExportHeader) find_package( Qt5 ${QT_MIN_VERSION} CONFIG REQUIRED COMPONENTS Core Gui Widgets PrintSupport ) find_package( KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n CoreAddons Crash DocTools IconThemes ) +find_package(Docbook2X) set(KDiff3_LIBRARIES ${Qt5PrintSupport_LIBRARIES} KF5::I18n KF5::CoreAddons KF5::Crash KF5::IconThemes ) if (CMAKE_CXX_COMPILER_ID MATCHES "Clang") # I don't need warnings about wired things in comments. set(CLANG_WARNING_FLAGS -Wno-comment) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${CLANG_WARNING_FLAGS}") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${CLANG_WARNING_FLAGS}") endif() set( needed_features cxx_nullptr ) add_definitions( -DQT_DEPRECATED_WARNINGS #Get warnings from QT about deprated functions. -DQT_NO_URL_CAST_FROM_STRING #implict casting from string to url does not always behave as you might think ) #remove unnneeded errors remove_definitions( -DQT_NO_CAST_FROM_ASCII #While a good idea in gerneral this triggers for many simple no translable strings ) add_subdirectory(src) add_subdirectory(doc) add_subdirectory(kdiff3fileitemactionplugin) ki18n_install(po) kdoctools_install(po) feature_summary(WHAT ALL FATAL_ON_MISSING_REQUIRED_PACKAGES) diff --git a/cmake/Modules/FindDocbook2X.cmake b/cmake/Modules/FindDocbook2X.cmake new file mode 100644 index 0000000..8d3bc68 --- /dev/null +++ b/cmake/Modules/FindDocbook2X.cmake @@ -0,0 +1,95 @@ +# Attempt to find docbook-to-man binary from docbook2x package +# +# This module defines: +# - DOCBOOK_TO_MAN_EXECUTABLE, path to docbook2x-man binary +# +# Note that the binary docbook-to-man in debian systems is a different application +# than in other distributions. +# +# Debian systems +# * docbook-to-man comes from the package docbook-to-man +# * docbook2man comes from the package docbook-utils +# * docbook2x-man comes from the package docbook2x +# Suse +# * docbook-to-man comes from the package docbook2x +# * docbook2man comes from the package docbook-utils-minimal +# ArchLinux +# * docbook-to-man comes from the package docbook-to-man +# * docbook2man comes from the package docbook2x +# +# We actually want the binary from docbook2x, which supports XML + +#============================================================================= +# Copyright 2013 Kevin Funk +# Copyright 2015 Alex Merry +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= + +macro(_check_docbook2x_executable) + if (DOCBOOK_TO_MAN_EXECUTABLE) + execute_process( + COMMAND ${DOCBOOK_TO_MAN_EXECUTABLE} --version + OUTPUT_VARIABLE _output + ERROR_QUIET + ) + if("${_output}" MATCHES "docbook2X ([0-9]+\\.[0-9]+\\.[0-9]+)") + set(DOCBOOK_TO_MAN_EXECUTABLE ${_docbook_to_man_executable}) + set(Docbook2X_VERSION ${CMAKE_MATCH_1}) + else() + unset(DOCBOOK_TO_MAN_EXECUTABLE) + unset(DOCBOOK_TO_MAN_EXECUTABLE CACHE) + endif() + endif() +endmacro() + +if (DOCBOOK_TO_MAN_EXECUTABLE) + _check_docbook2x_executable() +else() + foreach(test_exec docbook2x-man docbook-to-man db2x_docbook2man docbook2man) + find_program(DOCBOOK_TO_MAN_EXECUTABLE + NAMES ${test_exec} + ) + _check_docbook2x_executable() + if (DOCBOOK_TO_MAN_EXECUTABLE) + break() + endif() + endforeach() +endif() + +include(FindPackageHandleStandardArgs) + +find_package_handle_standard_args(Docbook2X + FOUND_VAR Docbook2X_FOUND + REQUIRED_VARS DOCBOOK_TO_MAN_EXECUTABLE + VERSION_VAR Docbook2X_VERSION +) + +if (Docbook2X_FOUND) + macro(install_docbook_man_page name section) + set(inputfn "man-${name}.${section}.docbook") + set(input "${CMAKE_CURRENT_SOURCE_DIR}/${inputfn}") + set(outputfn "${name}.${section}") + set(output "${CMAKE_CURRENT_BINARY_DIR}/${outputfn}") + set(target "manpage-${outputfn}") + + add_custom_command( + OUTPUT ${output} + COMMAND ${DOCBOOK_TO_MAN_EXECUTABLE} --encoding "UTF-8" ${input} + DEPENDS ${input} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + ) + add_custom_target(${target} ALL + DEPENDS "${output}" + ) + install( + FILES ${output} + DESTINATION ${CMAKE_INSTALL_MANDIR}/man${section} + ) + endmacro() +endif() diff --git a/doc/en/CMakeLists.txt b/doc/en/CMakeLists.txt index 34e10ce..d8084f7 100644 --- a/doc/en/CMakeLists.txt +++ b/doc/en/CMakeLists.txt @@ -1,3 +1,5 @@ kdoctools_create_handbook(index.docbook INSTALL_DESTINATION ${HTML_INSTALL_DIR}/en SUBDIR kdiff3) -install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/kdiff3.1 DESTINATION ${MAN_INSTALL_DIR}) \ No newline at end of file +if (Docbook2X_FOUND) + install_docbook_man_page(kdiff3 1) +endif() \ No newline at end of file diff --git a/doc/en/kdiff3.1 b/doc/en/kdiff3.1 deleted file mode 100644 index 80de937..0000000 --- a/doc/en/kdiff3.1 +++ /dev/null @@ -1,87 +0,0 @@ -.TH "KDIFF3" "1" -.SH "NAME" -KDiff3 \(em compares two or three input files or directories -.SH "SYNOPSIS" -.PP -\fBKDiff3\fR [\fBQT options\fP] [\fBKDE options\fP] [\fBKDiff3 options\fP] [\fB\fIFile1/base\fR\fP] [\fB\fIFile2\fR\fP] [\fB\fIFile3\fR\fP] -.SH "DESCRIPTION" -.PP -This manual page briefly documents the -\fBKDiff3\fR tool. -.PP -For comprehensive help, please see \fBkhelpcenter help:/kdiff3\fR. - -.PP -\fBKDiff3\fR is a program that - -.IP " \(bu" 6 -compares or merges two or three text input files or directories -.IP " \(bu" 6 -shows the differences line by line and character by character -.IP " \(bu" 6 -provides an automatic merge-facility and -.IP " \(bu" 6 -an integrated editor for comfortable solving of merge-conflicts -.IP " \(bu" 6 -supports Unicode, UTF-8 and other codecs -.IP " \(bu" 6 -supports KIO on KDE (allows accessing ftp, sftp, fish, smb etc.) -.IP " \(bu" 6 -Printing of differences -.IP " \(bu" 6 -Manual alignment of lines -.IP " \(bu" 6 -Automatic merging of version control history ($Log$) -.SH "OPTIONS" -.PP -This program follows the usual GNU command line syntax, -with long options starting with two dashes (`\-'). A summary of -options is included below. For a full summary of options, run -\fBKDiff3 \-\-help\fR. - -.IP "\fB-m, \-\-merge\fP " 10 -Merge the input. -.IP "\fB-b, \-\-base file\fP " 10 -Explicit base file. For compatibility with certain tools. -.IP "\fB-o, \-\-output file\fP " 10 -Output file. Implies \-m. E.g.: \-o newfile.txt -.IP "\fB\-\-out file\fP " 10 -Output file, again. (For compatibility with certain tools.) -.IP "\fB\-\-auto\fP " 10 -No GUI if all conflicts are auto-solvable. (Needs \-o file) -.IP "\fB\-\-qall\fP " 10 -Don't solve conflicts automatically. (For compatibility...) -.IP "\fB-L1 alias\fP " 10 -Visible name replacement for first file/base file. -.IP "\fB-L2 alias\fP " 10 -Visible name replacement for second file. -.IP "\fB-L3 alias\fP " 10 -Visible name replacement for third file. -.IP "\fB-L, \-\-fname alias\fP " 10 -Visible name replacement. May by supplied for each input. -.IP "\fB\-\-cs string\fP " 10 -Change a setting, e. g. \-\-cs "AutoAdvance=1". -.IP "\fB\-\-confighelp\fP " 10 -Show a list of all settings and their values. -.IP "\fB\-\-config file \fP " 10 -Use a different settings file. -.IP "\fB\-\-author\fP " 10 -Show author of program. -.IP "\fB-v, \-\-version\fP " 10 -Show version of program. -.IP "\fB\-\-license\fP " 10 -Show license of program. -.SH "AUTHOR" -.PP -This manual page was written by Eike Sauer for -the \fBDebian\fP system (but may be used by others). Permission is -granted to copy, distribute and/or modify this document under -the terms of the GNU General Public License, Version 2 -(or, at your option, any later version published by the Free -Software Foundation). - -.PP -On Debian systems, the complete text of the GNU General Public -License can be found in /usr/share/common-licenses/GPL. - -.\" created by instant / docbook-to-man diff --git a/doc/en/man-kdiff3.1.docbook b/doc/en/man-kdiff3.1.docbook new file mode 100644 index 0000000..14b4d0f --- /dev/null +++ b/doc/en/man-kdiff3.1.docbook @@ -0,0 +1,215 @@ + + + + + +kdiff3 +1 + + +KDiff3 + compares two or three input files or directories + + + + + KDiff3 QToptions + KDEoptions + KDiff3options + File1/base + File2 + File3 + + + + +DESCRIPTION +This manual page briefly documents the +KDiff3 tool. + +For comprehensive help, please see khelpcenter help:/kdiff3. + + +KDiff3 is a program that + + + + + +compares or merges two or three text input files or directories + + + + + +shows the differences line by line and character by character + + + + + +provides an automatic merge-facility and + + + + + +an integrated editor for comfortable solving of merge-conflicts + + + + + +supports Unicode, UTF-8 and other codecs + + + + + +supports KIO on KDE (allows accessing ftp, sftp, fish, smb etc.) + + + + + +Printing of differences + + + + + +Manual alignment of lines + + + + + +Automatic merging of version control history ($Log$) + + + + + +OPTIONS +This program follows the usual GNU command line syntax, +with long options starting with two dashes (`-'). A summary of +options is included below. For a full summary of options, run +KDiff3 --help. + + + + + +Merge the input. + + + + + +Explicit base file. For compatibility with certain tools. + + + + + +Output file. Implies -m. E.g.: -o newfile.txt + + + + + +Output file, again. (For compatibility with certain tools.) + + + + + +No GUI if all conflicts are auto-solvable. (Needs -o file) + + + + + +Don't solve conflicts automatically. (For compatibility...) + + + + + +Visible name replacement for first file/base file. + + + + + +Visible name replacement for second file. + + + + + +Visible name replacement for third file. + + + + + +Visible name replacement. May by supplied for each input. + + + + + +Change a setting, e. g. --cs "AutoAdvance=1". + + + + + +Show a list of all settings and their values. + + + + + +Use a different settings file. + + + + + +Show author of program. + + + + + +Show version of program. + + + + + +Show license of program. + + + + + +AUTHOR +This manual page was written by Eike Sauer <eike@debian.org> for +the Debian system (but may be used by others). Permission is +granted to copy, distribute and/or modify this document under +the terms of the GNU General Public License, Version 2 +(or, at your option, any later version published by the Free +Software Foundation). + + +On Debian systems, the complete text of the GNU General Public +License can be found in /usr/share/common-licenses/GPL. + + + + +