aboutsummaryrefslogtreecommitdiff
path: root/tests/CMakeLists.txt
AgeCommit message (Collapse)Author
2022-02-05Don't run KDEInstallDirsTest.vars_in_sync_oldstyle_arg for KF6v5.91.0-rc1v5.91.0Ahmad Samir
Since KDEInstallDirs6 explicitly sets KDE_INSTALL_DIRS_NO_DEPRECATED to false.
2022-01-23Forward the Qt6 build option to the CMake test runsVolker Krause
Fixes a number of unit tests that rely on Qt in some form when using Qt6.
2022-01-23Adjust test build system to also support Qt6Volker Krause
With this we are no longer skipping a bunch of tests when using Qt6. This likely still misses forwarding the Qt option to the CMake calls of the actual tests, but that's for a subsequent change.
2022-01-18Rename ECMQMLModules.cmake to ECMFindQmlModule.cmakeArjen Hiemstra
To avoid ambiguity with ECMQmlModule.cmake. To preserve backward compatibility, we keep a version around of ECMQMLModules.cmake that warns a user of it being moved and includes the new file.
2022-01-18Introduce ECMQmlModule.cmakeArjen Hiemstra
This contains some helper functions to make it easier to create QML modules through CMake. It takes care of several things that currently need to be done manually. It adds four tests for the four primary ways that it can be used, either as shared/static library and with or without C++ plugin.
2021-02-26Fix ECMCheckOutboundLicenseTest to find the FindReuseTool.cmake filev5.80.0-rc1v5.80.0Friedrich W. H. Kossebau
2021-01-17ECMQtDeclareLoggingCategory: create .categories files in build, not configureFriedrich W. H. Kossebau
Ensures that the files * are re-created by build rule when accidentally deleted in the build dir * are not getting new timestamps on every cmake run, even when content has not changed
2020-09-26Introduce plausibility check for outbound licenesAndreas Cord-Landwehr
When creating a library or executable, several source files are combined into a binary artifact that has an outbound license of its own. This test generator allows to check if the combined source files are compatible with the desired outbound license. Requirements for using these tests: - input source files must contain the SPDX-License-Information tag - python3 must be available - the "reuse spdx" tool must be available
2020-07-10Add ecm_generate_dbus_service_fileHenri Chain
Summary: It serves as a replacement for `kdbusaddons_generate_dbus_service_file`. An application can be a DBus-activated service just fine without using KDBusAddons. Moreover, this new module uses named arguments for future-proofing, and adds support for specifying a `SystemdService`. It also cleans up the confusion on what the "path" is about: Rather than requiring to specify executable and path separately, we just extract the executable file name on Windows, if necessary. Usage: ``` ecm_generate_dbus_service_file(NAME org.kde.kded5 EXECUTABLE ${KDE_INSTALL_FULL_BINDIR}/kded5 SYSTEMD_SERVICE plasma-kded) ``` Test Plan: * Was able to generate a kded service file * Was able to generate a kded service file with `SystemdUnit` * Verified that it moaned when executable wasn't an absolute path * Untested on Windwos Reviewers: #frameworks, davidedmundson, kossebau, kfunk, habacker Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D29051
2020-07-10Introduce function ecm_install_configured_fileDavid Edmundson
Summary: This, as the name suggests, configures a file and installs it. It's not very complicated but it's a repeated pattern in plasma that gets quite messy dealing with temporary files. Test Plan: Used in a project Reviewers: #build_system Subscribers: apol, kossebau, pino, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D28355
2020-06-14extra-cmake-modules: Convert to SPDX license statementsAndreas Cord-Landwehr
2020-04-05ECM: attempt to fix KDEInstallDirsTest.relative_or_absolute on WindowsDavid Faure
Summary: Not passing CMAKE_INSTALL_PREFIX is a weird thing to do. The test shows "Installing in ." and some values like KDE_INSTALL_FULL_EXECROOTDIR become "/" which is considered relative on Windows. The test that passes /usr to CMAKE_INSTALL_PREFIX actually passes on Windows. Pass /tmp to the other test, remove the test without prefix. Test Plan: Passes on Linux, not tested on Windows, CI will do that Reviewers: kossebau, apol, cgiboudeaux Reviewed By: apol Subscribers: kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D28409
2019-10-10Add ECMGenerateExportHeader, for improved handling of deprecated APIFriedrich W. H. Kossebau
Summary: Generates additional macros in the export header which can be used for fine-grained disabling of warnings & visibility as well as excluding from the build. Reviewers: #frameworks, #build_system Subscribers: chehrlic, dfaure, cgiboudeaux, kde-frameworks-devel, kde-buildsystem Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D23789
2019-01-09Use more https in linksFriedrich W. H. Kossebau
2018-01-28ECMToolchainAndroidTest doesn't exist anymoreAleix Pol
BUG: 389519
2017-12-20Use readelf to find project dependenciesv5.42.0-rc1v5.42.0Aleix Pol
Summary: We were using a link.txt file that cmake used to generate, on newer cmake versions it doesn't anymore. Instead use readelf, much like androiddeployqt does, to extract the depenencies. Catch: It relies on having all the binaries being at the same subdirectory, which is the default in ECM since not long ago. Test Plan: Build kirigamigallery with it Reviewers: #frameworks, #build_system, aacid Reviewed By: aacid Subscribers: mart Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D8173
2017-08-09Include a module for finding qml imports as runtime dependenciesAleix Pol
Summary: Allows to check if a module is available on the system and sets it as a runtime dependency. This is useful for projects so that they can specify their qml dependencies easily and packagers and developers get to see what's missing by looking at the cmake output. Reviewers: #build_system, #frameworks, sitter Reviewed By: sitter Subscribers: dfaure, aacid Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D7094
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-06-04Fix KDEInstallDirsTest.relative_or_absolute_usr, avoid Qt paths being usedFriedrich W. H. Kossebau
Set KDE_INSTALL_USE_QT_SYS_PATHS explicitely to FALSE, to avoid it defaulting to TRUE if Qt is also installed to the /usr prefix
2017-04-10Add a test for _repository_name() a function added for fetch-translationsAleix Pol
Summary: It turns out it's more complex than it looks, it's always better to have tests. Reviewers: sitter, aacid Reviewed By: sitter Subscribers: #frameworks, #build_system Tags: #frameworks, #build_system Differential Revision: https://phabricator.kde.org/D5352
2016-11-07Skip Python bindings test if PyQt isn't installedDavid Faure
2016-11-07Only add the test if python is foundStephen Kelly
2016-10-31Don't require the python bindings dependencies for ECMStephen Kelly
It should be optional.
2016-10-31Add the PythonModuleGeneration moduleStephen Kelly
This can be used by KF5 libraries to generate python 2 and 3 bindings.
2016-08-31add full license textAllen Winter
REVIEW: 128780
2016-06-15Integrate relative library paths to APKv5.24.0-rc1v5.24.0Andreas Cord-Landwehr
Needed for many unit tests to add them to APK files. REVIEW: 128175
2016-01-31Add test for ECMAddAppIcon.v5.19.0-rc1v5.19.0Gleb Popov
REVIEW: 126711
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-11-22Overhaul the ECM build system.Alex Merry
It should now be easier to read, and more featureful. Among other tweaks, we now print a summary of dependencies and build options, and the documentation is generated with more sensible breadcrumbs and builds properly with Sphinx 1.3. REVIEW: 126075
2015-11-08Add unit test for ecm_create_qm_loader.Alex Merry
This is based on commit 6745bd7e4796560959bb67e33b7c7f86f96a5a94 (and the subsequent fix-up commits).
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-03Make sure we load translations on the main thread.Alex Merry
BUG: 346188 REVIEW: 123726
2015-08-18Add macro to generate logging category declarations for Qt5.Alex Merry
This makes life a bit easier for developers who use the categorised logging in Qt5 in the common case - rather than creating two new files, and remembering to put in the #ifdef for the default verbosity settings in Qt 5.4, they can just add a couple of lines to their CMakeLists.txt. REVIEW: 124595
2015-05-13Add unit tests for ECMAddTests module.Alex Merry
REVIEW: 123722
2014-12-28Add deprecation warnings for old-style variables.Alex Merry
REVIEW: 121646
2014-12-28Refactor KDEInstallDirs tests.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-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-10Introduce ECMGeneratePkgConfigFileAleix Pol
A new module has been introduced to generate pkgconfig files from cmake projects. REVIEW: 119798
2014-06-17Make ECM language-independent again, but make the tests use CAlex Merry
Setting the language for ECM's project() call to C had unanticipated side-effects - notably that the installed version file required the architecture to match the one used at build time. Instead, we make the tests a sub-project, setting up C as the language there (since most of the tests do use C, albeit slightly indirectly). REVIEW: 118498
2014-06-02Reorganize testsAlex Merry
Move the detailed testing of KDEInstallDirs from ExecuteKDEModules to a subdir of KDEInstallDirsTest. This is where you would expect to find it, and it also makes sure that other KDE modules are not affecting the test. This also makes the KDEInstallDirs/not_cache_variable regression test work the same way as the other tests, doing a double-configure and build. While not stricly necessary to catch the original issue, it does ensure that the problem does not appear when reconfiguring either.
2014-05-14Do not fail if vars like CMAKE_INSTALL_LIBDIR are defined as normal varsAurélien Gâteau
REVIEW: 118127
2014-05-04Add ECMPoQmTools moduleAurélien Gâteau
ecm_create_qm_from_po_files() was actually not very useful in practice. So that is deprecated, to be removed before ECM 1.0. Instead, the ECMPoQmTools provides several useful functions: ecm_create_qm_loader() (which already existed in ECMCreateQmFromPoFiles), ecm_process_po_files_as_qm() (which has the same signature as gettext_process_po_files() from the FindGettext module) and ecm_install_po_files_as_qm(), which is a convenience function mostly for the benefit of KDE Frameworks (although potentially useful for whatever other projects have the unusual requirement of a Gettext translation workflow but no Gettext usage in the code). NB: some clean-up to the documentation was done by Alex Merry <alex.merry@kde.org> as part of this commit. REVIEW: 117823
2014-04-25Split up module execution testsAlex Merry
Find module tests now use find_package(), and there is a version for when CMAKE_MODULE_PATH is set and a version for when ecm_use_find_modules() is used. KDE modules are also now tested. REVIEW 117658
2014-04-25Make ecm_setup_version interact well with CMP0048Alex Merry
When CMake policy CMP0048 (CMake 3.0) is set to NEW, the project() command is meant to manage the project's version variables. We therefore do not set the PROJECT_VERSION variables in this case. To make sure projects do not have to specify their version in multiple places, this also allows the keyword "PROJECT" to be passed to ecm_setup_version instead of an actual version number. In this case, the version passed to project() will be used. REVIEW: 117619
2014-04-25New syntax for ecm_install_icons()Alex Merry
This requires the icon files to be specified (which is better than globbing, because the build system will then be able to tell when files are added or removed and re-run CMake). It also removes the theme name from the filename pattern: the old code used a shorthand theme name for a small number of themes, and didn't allow any other themes. Extending this to arbitrary themes could cause problems with themes that have numbers or hyphens (or whatever other delimiter character was used) in their names. Most users are likely to just want to install to a single theme anyway (based on a random sampling of users of kde4_install_icons), so that is what the new syntax requires. The old syntax still works and behaves as before. ecm_update_iconcache is renamed to _ecm_update_iconcache - it was never documented as public API anyway. REVIEW: 117617
2014-02-16Improve the ECMGenerateHeaders API with a variable for generated filesAlex Merry
ecm_generate_headers() now allows/forces the caller to collect the paths of the generated headers, so that they can be passed to the install command. This avoids issues of unexpected files being in the CamelCase includes directory, both from previous builds and because of case-insensitive file systems. MODULE_NAME is removed, as it is no longer desirable or necessary. Instead, the headers are placed directly in the output directory (usually CMAKE_CURRENT_BUILD_DIR). Overall, this makes ecm_generate_headers() behave much more like other file generation macros (like the Qt ones). The old syntax is still supported for now, to make the porting effort easier. REVIEW: 115765
2011-12-18-enable testingAlex Neundorf
-add test ExecuteAllModules, which is the same as FindModulesExecuteAll in CMake: include (and execute) all *cmake files, to make sure they are not completely broken Alex