aboutsummaryrefslogtreecommitdiff
path: root/kde-modules/KDEInstallDirs.cmake
AgeCommit message (Collapse)Author
2021-11-30Revert "If QT_MAJOR_VERSION is not defined, use 5"Volker Krause
There is no path out of QtVersionOption.cmake that would let QT_MAJOR_VERSION undefined, so this check is unnecessary. Worse, this doesn't actually check for QT_MAJOR_VERSION being defined, but whether a variable named after the content of the QT_MAJOR_VERSION variable is defined. That is always false, so this effectively forces Qt5 and breaks Qt6 support. This reverts commit 8fd79163a7c60386fbc94bc14ca4a3b0b29d7227.
2021-11-28If QT_MAJOR_VERSION is not defined, use 5Ivan Čukić
This fixes an infinite recursion of KDEInstallDirs including itself when QT_MAJOR_VERSION is not defined.
2021-11-23Split KDEInstallDirs into a 5 and a 6 variantVolker Krause
This factors out large parts of the common code into separate modules, and adds a backward compatibility wrapper. The 6 variant drops some deprecated variables where possible, but otherwise is the same as the 5 variant. It still lacks a replacement for the paths depending on ECMQueryQMake though.
2021-06-12Add prefix.sh.fish file for fish shellAlexander Lohnau
2021-05-25Clean ECM files after the minimum version changeChristophe Giboudeaux
- Remove deprecated version checks - Use VERSION_GREATER_EQUAL
2021-04-23Modules docs: move rst docs into bracket commentsFriedrich W. H. Kossebau
CMake >= 3.0 supports bracket comments, and the reStructuredText integration code in sphinx/ext/ecm.py already supports extracting the docs from a bracket comment instead. Editing documentation without leading line comment markers is more simple, e,g. when reflowing text over lines. With ECM meanwhile requiring CMake 3.5 now it is possible to switch (and thus follow also the approach used by cmake itself). NO_CHANGELOG
2021-02-08Define relative paths when KDE_INSTALL_USE_QT_SYS_PATHS is enabledDaan De Meyer
When building multiple KDE projects, installing them to "$DESTDIR" and having cmake look for kde dependencies in "$DESTDIR" using "CMAKE_PREFIX_PATH=$DESTDIR/usr", we currently get failures when calling find_package() on projects that use KDE_INSTALL_QTPLUGINDIR, KDE_INSTALL_QTQMLDIR and KDE_INSTALL_QTQUICKIMPORTSDIR because these are defined as absolute paths when KDE_INSTALL_USE_QT_SYS_PATHS is enabled. This commit defines these paths relative to qmake's QT_INSTALL_PREFIX property instead when KDE is install to the same prefix as Qt. This fixes DESTDIR installations because with relative paths, CMake will search for these paths in "$DESTDIR" as well as "/". We limit this change to the scenario where the Qt and CMake install prefixes are the same because always doing this would break backwards compatibility as qml and plugins would be installed into CMAKE_INSTALL_PREFIX instead of QT_INSTALL_PREFIX after this change.
2020-12-14API dox: note that KDEInstallDirs sets CMAKE_INSTALL_PREFIX if still defaultFriedrich W. H. Kossebau
NO_CHANGELOG
2020-12-01Define install dir variable for file templatesAlexander Lohnau
Just like the app templates the file templates have a specific install location. Also the KTEMPLATESDIR is only used as a fallback, because it suggests that all templates are in that dir, which is not true.
2020-06-14extra-cmake-modules: Convert to SPDX license statementsAndreas Cord-Landwehr
2019-11-26Fix typoDavid Edmundson
2019-11-26Explicitly use lib for systemd directoriesDavid Edmundson
Systemd searches "/usr/local/lib/systemd/user", "/usr/local/share/systemd/user", USER_DATA_UNIT_PATH, "/usr/lib/systemd/user", "/usr/share/systemd/user", LIBDIR could be lib or lib64, so we need to be explicit here. Reviewed on D25107
2019-11-06Documentation typo correctionDavid Edmundson
2019-11-03Add install dir for systemd unitsDavid Edmundson
Summary: Like we have for other FD.O projects like DBus service files Test Plan: Unit test passes Used in another project, and it installed to the correct place Reviewers: apol Reviewed By: apol Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D25107
2019-08-28Keep 'lib' as default LIBDIR on Arch Linux based systemsAntonio Rojas
Port of upstream commit https://gitlab.kitware.com/cmake/cmake/commit/18365587c86396f988e256b5acf4d2312f3be2bb Differential Revision: https://phabricator.kde.org/D23497
2019-08-15Define install location for JAR/AAR files for AndroidVolker Krause
Summary: This follows where Qt installs those, and thus androiddeployqt looks for them. Currently this is hardcoded in knotifications for example, seems cleaner to have this here. Reviewers: #build_system, #android, apol Reviewed By: #android, apol Subscribers: apol, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D23131
2019-07-25Notify users when not using KDE_INSTALL_USE_QT_SYS_PATHS about prefix.shAleix Pol
Summary: It's especially when KDE_INSTALL_USE_QT_SYS_PATHS=OFF that the different environment variables will have to be initialised. This adds a message that should tell users about the script so they have a hint of what is going on. Reviewers: #frameworks, albertvaka, cgiboudeaux Reviewed By: albertvaka, cgiboudeaux Subscribers: cgiboudeaux, albertvaka, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D22580
2019-07-23Provide a more sensible CMAKE_INSTALL_PREFIX defaultAleix Pol
Summary: If no prefix is passed, use ECM's by default, instead of defaulting to /usr/local which isn't optimal in any case. Reviewers: cgiboudeaux Reviewed By: cgiboudeaux Subscribers: cgiboudeaux, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D22676
2019-05-31Create specific directory for Qt logging categories filev5.59.0-rc1v5.59.0Laurent Montel
Summary: kdebugsettings categories files Reviewers: dfaure, cgiboudeaux Reviewed By: cgiboudeaux Subscribers: kossebau, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D21313
2019-01-09Use more https in linksFriedrich W. H. Kossebau
2018-06-05Don't include a 64 when building 64bit architectures on flatpakAleix Pol
Summary: It's not a thing on flatpak and it makes packaging weird. Should fix https://github.com/flatpak/freedesktop-sdk-base/issues/22 Reviewers: #frameworks, cgiboudeaux Reviewed By: cgiboudeaux Subscribers: cgiboudeaux, eszlari, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D13102
2018-04-17Don't install plugins within lib on androidAleix Pol
Summary: Otherwise we hit a weird code path on androiddeployqt. This is what the official SDK looks like anyway: ``` $ ls /opt/Qt/5.10.1/android_armv7/ bin doc include jar lib mkspecs plugins qml src translations ``` Reviewers: vkrause Reviewed By: vkrause Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D12269
2017-12-15Introduce INSTALL_PREFIX_SCRIPT to easily set up prefixesAleix Pol
Summary: If enabled it will install a prefix.sh script to the root of the prefix. This file will be useful to be able to easily set up a prefix to be used by integrating the environment variables it exports. Test Plan: ``` $ cat prefix.sh export PATH=/home/apol/devel/kde5/bin:$PATH export LD_LIBRARY_PATH=/home/apol/devel/kde5/lib64:$LD_LIBRARY_PATH export XDG_DATA_DIRS=/home/apol/devel/kde5/share:${XDG_DATA_DIRS:-/usr/local/share/:/usr/share/} export XDG_CONFIG_DIRS=/home/apol/devel/kde5/etc/xdg:${XDG_CONFIG_DIRS:-/etc/xdg} export QT_PLUGIN_PATH=/home/apol/devel/kde5/lib64/plugins:$QT_PLUGIN_PATH export QML2_IMPORT_PATH=/home/apol/devel/kde5/lib64/qml:$QML2_IMPORT_PATH ``` Reviewers: #frameworks, sitter Reviewed By: sitter Subscribers: kfunk, bcooksley, ngraham, sitter, cgiboudeaux, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D9299
2017-07-29Fix usage of query_qmake: differ between calls expecting qmake or notFriedrich W. H. Kossebau
Summary: when KDE_INSTALL_USE_QT_SYS_PATHS has been explicitely set, qmake can be considered a required dependency, otherwise the paths will not be known, which would be unexpected. Also does the code calling query_qmake, besides the one testing for the same install prefix, not handle the case of empty strings being returned and then results in bogus behaviour. Thus this patch makes code fail hard if query_qmake is expected to yield a result, but no qmake executable is found. Reviewers: #frameworks, ltoscano, rdieter, apol Reviewed By: apol Subscribers: #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D6772
2017-07-20Add API dox for KDEInstallDirs' KDE_INSTALL_USE_QT_SYS_PATHSFriedrich W. H. Kossebau
Reviewers: #frameworks, apol Reviewed By: apol Subscribers: #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D6773
2017-07-15Fix incomplete default path noted in QTQCHDIR documentationFriedrich W. H. Kossebau
2017-06-05New: ECMAddQch, for generating qch & doxygen tag filesFriedrich W. H. Kossebau
Summary: Enables generation of QCH files during a normal build, for documenting the public API of a library. These macros are especially done with release builds in mind, so distributed packages (like from Linux distributions) can include QCH files matching the version of the library and will be also automatically updated on new versions of the libary. Next to that these macros also support linking between different QCH files, so a subclass from another library for which there also is a QCH file installed will be linked to the entry in that other QCH file. This inter-QCH linking is especially useful for libraries extending Qt, where many of the used types are from Qt libraries. The macros come with the needed information for Qt libraries prepared, so the used Qt libraries just need to be listed in the LINK_QCHS argument by target names, like Qt5Core_QCH or Qt5Widgets_QCH. This should be a nice supplement to online services like api.kde.org, like Qt's own QCH files are to doc.qt.io, While QCH files from an abstract POV could be seen similar to code libraries, being components with links to lookup symbols/entries in other QCH files, so the rules and code should be done with similar concepts, currently CMake's target system seems bound to executable code creation. So things like "file(EXPORT ...)" could sadly not be reused, as custom targets are not supported with that. Thus a custom macro had to be created for now. Also could I not find a way to use namespaces like KF5::, for more consistent target naming. The patch also adds two variables to KDEInstallDirs.cmake for controlling where the QCH (and respective doxygen tag files) are installed. The QTQCHDIR variant allows to install QCH files for Qt-extending libraries into the same folder where Qt's own QCH files are, so Qt Assistant & other QCH viewer pick up them automatically to add them to the default help file collection. The QCHDIR variant would provide a neutral, but central installation location. Neutral, as it never "pollutes" the Qt system dirs with files possibly unrelated to Qt-based development (e.g. when simply using qthelp tools for documentation), and central, to help with finding available QCH files for manually adding/loading them into a viewer, given there is no official way currently to register the availability of QCH files on installing. Open questions: a) target system for exporting/importing done in a sane way? Better name pattern for the QCH targets than xxx_QCH (see the targets created for Qt, like Qt5Core_QCH)? b) sharing metadata with kapidox Initially I placed these macros into the kapidox module, as this seems the logic place. And would match what kdoctools does for user manuals. Just, that would create a build dependency on kapidox which complicates usage a little. Having these macros in ECM delivers them with no extra effort needed. The data in metainfo.yaml is partially duplicated with the data feed into the macros. How to deduplicate that is still open. Especially with the need to not depend on external data sources like identify.kde.org. Issues: * doxygen versions before 1.8.13 are broken and miss to include some files with generated QCH (https://bugzilla.gnome.org/show_bug.cgi?id=773693) * Qt Assistant often only built with QTextBrowser, while doxygen uses lots of HTML5 (incl. hardcoded JavaScript) (https://bugzilla.gnome.org/show_bug.cgi?id=773715), needs e.g. distributions to use QtWebKit to work, upcoming Qt versions might soon also have QtWebEngine based help viewer (https://codereview.qt-project.org/#/c/111559/) * inter-QCH links do not work in KDevelop currently (see https://bugs.kde.org/show_bug.cgi?id=372747) if installed as separate QCH files More details/background info at https://frinring.wordpress.com/2016/09/27/adding-api-dox-generation-to-the-build-by-cmake-macros/ Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D2854
2016-08-31add full license textAllen Winter
REVIEW: 128780
2016-08-21trivial: Fix documentationMatthias Klumpp
2016-07-18Appstream data changed its preferred locationJonathan Riddell
Update preferred path of appstream data files to /usr/share/metainfo Requires modern versions of appstream metadata generators. FEATURE REVIEW: 128174
2016-06-14Use "${BIN_INSTALL_DIR}/data" for DATAROOTDIR on Windows.Hannah von Reth
Summary: Instead of using "share" use "${BIN_INSTALL_DIR}/data" on Windows, this is the location provided by QStandardPaths for GenericDataLocation on Windows. Reviewers: dfaure Reviewed By: dfaure Subscribers: kfunk Differential Revision: https://phabricator.kde.org/D1873
2016-04-22Revert "Update AppStream metadata path"Matthias Klumpp
Better wait a little until applying this change, since this might break assumptions, and we don't know yet if all distros are using a recent enough AppStream (Generator) release. This reverts commit 4b7a90bfe7a3e2eb3ae83c946c182a79fabc51e3.
2016-04-20Update AppStream metadata pathMatthias Klumpp
As per AppStream release 0.9.4
2016-04-07Enables KDE_INSTALL_USE_QT_SYS_PATHS if CMAKE_INSTALL_PREFIX Qt5 prefixAleix Pol
Make Qt and ECM-based projects use the same directory sctructure (i.e. where plugins are, libs, etc.) by default. Otherwise it creates a tiny mess that might be controlled but usually won't. In the end, otherwise, people need to keep adapting their systems with environment variables anyway. All distros end up setting always this setting as ON, as well as brave developers who don't have separate prefixes for Qt and KDE. REVIEW: 127169
2015-12-29Make the KAppTemplate CMake module globalv5.18.0-rc1v5.18.0Marco Martin
templates are very useful as teaching tool in order to make a minimal application that uses a certain framework. templates in the KAppTemplate repository will always get forgotten (plus kapptemplate is not really necessary as they work in kdevelop as well) An ideal situation would be frameworks having templates in their own repos with templates of barebone apps using the main framework features. In order to do that, the cmake stuff needed in order to correctly install a template needs to be ported to a place avaiable to all frameworks REVIEW:126185
2015-12-18CMake: Cleanup: Strip text from endif/elseKevin Funk
REVIEW: 126414
2015-02-06Document when modules were added to ECM.Alex Merry
2015-01-24Warn when mixing relative and absolute paths in KDEInstallDirs.Alex Merry
BUG: 341683 FIXED-IN: 1.7.0 REVIEW: 121999 CHANGELOG: KDEInstallDirs: warn about mixing relative and absolute installation paths on the command line
2015-01-13Stop lying in the KDEInstallDirs documentation.Alex Merry
2015-01-11Do not unset cache variables in KDEInstallDirs.Alex Merry
Cache variables such as CMAKE_INSTALL_BINDIR may be used by other modules included from parallel parts of the tree, so we should not touch them. We still override them in the runtime environment, but this will not interfere with parallel subtrees of the project. As part of this, the order of precedence of variables specified on the command line is changed, so that KDE_INSTALL_* is considered first (although it is still considered "undefined" in the documentation). This means that if you only specify CMAKE_INSTALL_BINDIR, that will be used by both KDEInstallDirs and GNUInstallDirs, but if you specify both that and KDE_INSTALL_BINDIR, KDEInstallDirs will use KDE_INSTALL_BINDIR instead. This is probably not too useful, but seems more useful than any other arrangement. BUG: 342717 REVIEW: 121982
2015-01-07fix typo that lead to nearly empty KDE_INSTALL_TARGETS_DEFAULT_ARGS var on macChristoph Cullmann
2014-12-28Fix include directory change spotted by Hrvoje Senjan.v1.6.0-rc1v1.6.0Alex Merry
A previous commit inadvertantly changed the KF5 include prefix to kf5 (uppercase to lowercase).
2014-12-28Add deprecation warnings for old-style variables.Alex Merry
REVIEW: 121646
2014-12-28Make KDEInstallDirs provide KDE_INSTALL_* variables.Alex Merry
Creating variables whose names start with CMAKE_ is a bad idea for modules distributed outside CMake itself. Since the module is called KDEInstallDirs, having a KDE_INSTALL_ prefix for the variables is clear and intuitive. Both CMAKE_INSTALL_* variables and the older KDELibs4-compatible variables are provided, unless KDE_INSTALL_DIRS_NO_DEPRECATED is set to TRUE before the module is included. Even then, the CMAKE_INSTALL_* variables provided by the GNUInstallDirs module will still be set and understood (for compatibility with that module), unless KDE_INSTALL_DIRS_NO_CMAKE_VARIABLES is set to TRUE. REVIEW: 121646
2014-11-07Set CMAKE_INSTALL_SYSCONFDIR to /etc when CMAKE_INSTALL_PREFIX is /usrAlex Merry
When installing to /usr, we should use /etc for configuration. Using /usr/etc does not make sense. REVIEW: 120246
2014-09-16allow qmldir to follow qt_sys_pathHarald Sitter
when running with the KDE_INSTALL_USE_QT_SYS_PATHS option allow QMLDIR in KDEInstallDirs to follow whatever is defined by qmake this change makes sure that qml plugins will end up in a default Qt path when using the super special magic flag.
2014-09-11Fix fallout from recent ECM patchesAlex Merry
KDE modules cannot assume the normal ECM modules are in the CMake module path, and CMAKE_INSTALL_IMPORTS_INSTALL_DIR / QTQUICKIMPORTSDIR was not set correctly. Also, ECMQueryQmake.cmake used a deprecated CMake command (exec_program).
2014-09-03Fix ECM to use qmake instead of hardcoding plugin install dirsRohan Garg
Packagers and other interested folks should pass -DKDE_INSTALL_USE_QT_SYS_PATHS=ON when building in order to install various files to the same dir as the Qt5 install dirs. CCMAIL: kde-packagers@kde.org REVIEW: 119901
2014-07-19Check the libdir also on kFreeBSD and HurdPino Toscano
This way, on the Debian versions of these OSes, the library directory can be a multiarch path.
2014-07-18Define variable for AppStream upstream XML directoryMatthias Klumpp
REVIEW:118020