aboutsummaryrefslogtreecommitdiff
path: root/modules
AgeCommit message (Collapse)Author
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-06-17ECMAddQch: fail hard if needed tools are not present, to avoid surprisesFriedrich W. H. Kossebau
2017-06-17Drop perl as dep for ecm_add_qch, not needed/usedFriedrich W. H. Kossebau
Cmp. https://bugzilla.gnome.org/show_bug.cgi?id=783759
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
2017-05-23ecm_qt_declare_logging_category(): more unique include guard for headerFriedrich W. H. Kossebau
Summary: The old guard was created just from the identifier + _H, which runs the chance to clash in projects which use an identifier matching the project name and which also have a class or central file header which is named by the project and then has an include guard matching the filename. Example: project ABC -> abc.h with ABC_H guard identifier ABC, header debug.h -> debug.h with ABC_H guard any.cpp including both abc.h and debug.h will see only one content Using both the header file name and identifier for the guard name and prefixing it additionally with a macro specific term should make the guard both follow the usual pattern for guards matching the file name and also add some namespacing to allow for similar named header files in bigger projects (e.g. "debug.h") which could be included in the same include tree. Reviewers: #frameworks, #build_system Subscribers: elvisangelaccio Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5866
2017-05-16Add or improve "Generated. Don't edit" messages and make consistentFriedrich W. H. Kossebau
Reviewers: #frameworks, #build_system, apol Reviewed By: apol Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5867
2017-05-08Change default pkgconfig install path for FreeBSDTobias C. Berner
Summary: FreeBSD, opposed to most other sytems, does not install pkgconfig files to lib/pkgconfig, but to libdata/pkgconfig. Reviewers: #freebsd, apol, kfunk Reviewed By: kfunk Subscribers: kfunk, #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5766
2017-04-21Sanitizers: Don't use GCC-like flags for e.g. MSVCKevin Funk
Summary: Fixes compiler warnings such as: ``` cl : Command line warning D9002 : ignoring unknown option '-fsanitize=address' cl : Command line warning D9002 : ignoring unknown option '-fno-omit-frame-pointer' ``` Reviewers: aacid, bcooksley Reviewed By: aacid, bcooksley Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5489
2017-04-20fix documentation, ecm_install_po_files_as_qm generates .qm, not .moHarald Sitter
2017-04-18Fix minor CMake warning (CMP0054)Kevin Funk
2017-04-11Don't include tests together with modulesAleix Pol
We have tests that go through the modules directory
2017-04-11Allow test to work with older versions of qmlplugindumpAleix Pol
2017-04-10Don't enable the test by defaultAleix Pol
The build isn't always reproducible and comparisons are unfair
2017-04-10Support older qmlplugindump versionsAleix Pol
2017-04-10Introduce ecm_generate_qmltypesAleix Pol
Summary: Introduces a function that allows to generate plugins.qmltypes files for our qml plugins using qmlplugindump much like Qt does. Test Plan: Introduced it locally on Purpose and it works Reviewers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5087
2017-03-11Fix ecm_generate_pkgconfig_file compatibility with new cmakeWeng Xuetian
Summary: CMP0053 specifies that: - Expansion of ``@VAR@`` reference syntax defined by the ``configure_file()`` and ``string(CONFIGURE)`` commands is no longer performed in other contexts. replace it with the $ variable syntax. Test Plan: manual Reviewers: #frameworks, dfaure Reviewed By: dfaure Subscribers: #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5017
2017-01-10ecm_add_app_icon : ignore SVG files silently when unsupportedR.J.V. Bertin
SVG files that fail to convert will still trigger a warning.
2017-01-10Update the ecm_add_app_icon documentationR.J.V. Bertin
Inform the user that SVG icons can now be provided in the macro call; on Mac the first that converts to .icns (if ksvg2icns is available) will provide the application icon. Other SVG files are ignored, idem on other platforms.
2017-01-09ecm_add_app_icon/Mac: accept SVG icons when KIconThemes is installedR.J.V. Bertin
KIconThemes comes with a ksvg2icns utility that converts .sgv and .sgvz files to native .icns icon files. Using this utility allows to create icons with optimum resolution regardless of the available .png images and of limitations of the host's iconutil application (limited to 256x256 on some Mac OS versions). REVIEW: 128162
2016-12-30Add Clang Sanitizer CMAKE_C_FLAGS for C projectLeslie Zhai
Test plan: Clang and GCC for simple C project, kcoreaddons, kjs, etc. BUG: 374195 REVIEW: 129708 Reviewers: #extracmakemodules, alexmerry Reviewed By: dfaure, aacid
2016-12-28Revert "Add Clang Sanitizer CMAKE_C_FLAGS for C project"Albert Astals Cid
This reverts commit 1e7f3d5ba91e79a47d69a48e8f991ee0e7794b53. It's breaking compilation of anything that uses pthreads
2016-12-28Add Clang Sanitizer CMAKE_C_FLAGS for C projectLeslie Zhai
BUG: 374195 REVIEW: 129708 Reviewers: #extracmakemodules, alexmerry Reviewed By: dfaure
2016-12-01Fix typoElvis Angelaccio
GIT_SILENT
2016-11-18Minor: Remove extra new lineKevin Funk
Triggered my OCD
2016-11-05Add ecm_win_resolve_symlinks module.Gleb Popov
REVIEW: 128112
2016-09-05ecm_process_po_files_as_qm: Skip fuzzy translationsAlexander Potashev
REVIEW: 128823
2016-09-02The default level for logging categories should be Info rather than Warning.David Faure
The whole point of Info is to be used by apps who want to print out some info for the user, not disabled by default. Example use case: ksmserver could output the name of the autostart files it's starting, so user can check their own scripts are started, and associate any errors with the corresponding script. In other words: Debug = debugging for the developer Info = debugging for the user :-) This commit shows the benefit of having a central place for changing this (many category definitions do not use this macro though) REVIEW: 128232
2016-08-31add full license textAllen Winter
REVIEW: 128780
2016-07-27Fix inclusion when there's no Qt5v5.25.0-rc1v5.25.0Aleix Pol
ECMQueryQmake will fail as it's designed to only work with Qt5. We don't want to terminate the execution there, just to spit a warning and leave. If we suggest qmake-qt5 as a command, we'll end up performing the call anyway. This will fix the ExecuteCoreModules test under latest-qt4 build.
2016-07-26Add a fallback method for query_qmake() when there's no Qt5 installationAleix Pol
Addresses its usage on systems where Qt5 isn't installed, it allows for modules using it to decide what they should do. REVIEW: 128488
2016-07-18Make sure ECMGeneratePriFile.cmake behaves like the rest of ECMAleix Pol
In KDEInstallDirs we have some code to make sure that qmake is asked when the project shares the prefix with the installed Qt, to make sure that if something was changed in the distribution it would reflect on the projects. Make sure PRI files are installed using the same reasoning. REVIEW: 128427
2016-04-03ecm_qt_declare_logging_category: improve error message when using without ↵David Faure
including If one subdir in the project includes this file, all others can use the function but they don't see the value of the variable, which leads to a strange error CMake Error at ECM/modules/ECMQtDeclareLoggingCategory.cmake:114 (configure_file): configure_file input location <srcdir> is a directory but a file was expected. Happened in KIO, with kio/gui doing include+function call, and then adding function call in kio/widgets. REVIEW: 127432
2016-03-29ECMEnableSanitizers: avoid linking runtime for Clangv5.21.0-rc2v5.21.0-rc1v5.21.0Peter Wu
Clang automatically adds its runtime library (librt) when given the -fsanitize options. Do not force the GCC runtime libraries (asan, tsan, lsan), this results in "Your application is linked against incompatible ASan runtimes." errors when using the library in an executable built using Clang. Acked by Mathieu Tarral REVIEW: 127513
2016-03-21Fix _ecm_update_iconcache to only update the install locationStephen Kelly
Use the CMAKE_INSTALL_PREFIX to ensure that only a file in the install location will be touched. Otherwise a user running make install as root would create root-owned files in the build directory. Use the cmake -E touch command to update the mtime of the directory. That command exists since late 2007, but this manual file creation workaround pre-dates that by a few months (kdelibs SVN revision 691973). There is no chance any calling code is already passing an absolute path here because later in the function it is already used together with a CMAKE_INSTALL_PREFIX. Inspired-by: REVIEW 127445
2016-03-20Revert "ECMQtDeclareLoggingCategory: Include <QDebug> with the generated file"Stephen Kelly
This reverts commit 1d4bc35cf9383177459544d6fcd9de35edf3e77d. QLoggingCategory has always included QDebug, so this has always been superfluous.
2016-01-31ECMAddAppIcon: Use absolute path when operating on icons.Gleb Popov
REVIEW: 126711
2016-01-13Use PATH_SUFFIXES in ecm_find_package_handle_library_components()Alex Richardson
This is required to find poppler without package config as all the headers are installed in a poppler subdirectory of the include directory
2015-12-21ECMQtDeclareLoggingCategory: Include <QDebug> with the generated fileMartin Klapetek
In order to use the logging categories created by ECM, the generated header file has to be included but then also #include <QDebug> must be added to make it usable at all for qCDebug/qCWarning stuff. So this puts the #include <QDebug> into the generated header file and thus allowing to include a single header for qCDebug/qCWarning instead of two. REVIEW: 126368
2015-12-18CMake: Cleanup: Strip text from endif/elseKevin Funk
REVIEW: 126414
2015-11-30Don't warn when SVG(Z) icons are provided with multiple sizes/level of detailJaroslaw Staniek
This technically works and is practiced, e.g. for some Breeze icons. Some SVG icons do not scale well down from 32 to 22 or up from 16 to 22. For such cases icons are typically specially crafted for 22 and 16, at least. Then there's no single icon that be marked as "sc". So warnings such as: CMake Warning at ..../ECMInstallIcons.cmake:272 (message): Fixed-size icon foo.svg is not PNG or MNG ... are misleading. This change adds SVG(Z) extensions to the list of allowed icons for specific sizes. REVIEW:126199
2015-11-30Make sure we load translations on the main thread.Alex Merry
Because the old implementation (accidentally) worked when you put the ecm_create_qm_loader call in a different CMakeLists.txt file to the target the file was added to, some projects did this. This won't work with build-time-generated files, though, like moc files. So we (ab)use QTimer events to make the loading happen on the main thread. BUG: 346188 REVIEW: 126000
2015-11-17Do not find XCB's XINPUT library by default.Alex Merry
The XINPUT library is unlikely to be available on many systems, including a lot of Linux distributions. This will warn developers in advance by (a) not searching for XINPUT unless it was explicitly requested, and (b) printing a warning if they do request it. REVIEW: 125935
2015-11-14Fix multiple calls to ecm_create_qm_loader.Alex Merry
Multiple ecm_create_qm_loader() with different catalog names would overwrite each other's generated files, causing the wrong catalog to be loaded at runtime for some targets. This puts the catalog name into the generated filename. Since the catalog name is the only difference between the generated files, this is sufficient to fix the runtime behaviour. REVIEW: 125999
2015-11-08Revert "Make sure we load translations on the main thread."Alex Merry
This broke the build for projects which used ecm_create_qm_loader in unusual ways. A better approach is coming, but won't be in e-c-m 5.16. This reverts commit 009c480413910e8c1a18f4d1420f4a517ea606e6. CCBUG: 346188 CCMAIL: release-team@kde.org CCMAIL: kde-buildsystem@kde.org
2015-11-04Warn instead of error if ecm_install_icons finds no icons.v5.16.0-rc1Alex Merry
The V1 syntax of ecm_install_icons searched for icons by globbing files with a particular naming pattern. If there were no such icons, this used to do nothing, but silently. Commit fb7b8eea7d accidentally made this an error. More sensible would be to make it a warning. BUG: 354610 REVIEW: 125931
2015-11-03Add BSD license to ECMQmLoader.cpp.in.Alex Merry
CCMAIL: kde-licensing@kde.org CCMAIL: agateau@kde.org
2015-11-03Make sure we load translations on the main thread.Alex Merry
BUG: 346188 REVIEW: 123726
2015-10-20Fix ECMInstallIconsTest.Alex Merry
ECMInstallIcons now updates the theme cache if gtk-update-icon-cache is available, producing files the test hadn't been expecting.. Updating the test revealed that the old-style ecm_install_icons call only updated the hicolor cache, and not any of the other themes. REVIEW: 125631
2015-10-03Update GTK icon cache when installing icons.v5.15.0-rc1v5.15.0Volker Krause
Despite the name, Qt is also using this, and it considerably speeds up icon lookup. REVIEW: 125192
2015-09-25ECMEnableSanitizers: The undefined sanitizer is supported by gcc 4.9Albert Astals Cid