diff --git a/.gitignore b/.gitignore index 224e7f0..fa70692 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,13 @@ -.pc/ +# default build dir +/build* + +# Eclipse project files +/.project +/.cproject +/.settings +/.pydevproject +*.user + +# Output from example builds +examples/intltool-demo/po/Makefile.in.in +examples/intltool-demo/po/POTFILES.in diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..337c10d --- /dev/null +++ b/AUTHORS @@ -0,0 +1,21 @@ +Allan LeSage +Charles Kerr +Dalton Durst +Daniel Holbach +Florian Leeber +Ivan Semkin +James Henstridge +Larry Price +Luca Weiss +Marius Gripsgard +Michael Hudson-Doyle +Michael Vogt +Michihenning +Michi Henning +Mike Gabriel +Pete Woods +Ratchanan Srirattanamet +Robert Tari +Rodney +Rodney Dawes +Stephen M Webb diff --git a/CMakeLists.txt b/CMakeLists.txt index 0af3cc5..2d082c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0.2) -project(cmake-extras) +project(cmake-extras VERSION 1.7) include(GNUInstallDirs) diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..4769839 --- /dev/null +++ b/ChangeLog @@ -0,0 +1,857 @@ +2023-10-15 Mike Gabriel + + * Release 1.7 (HEAD -> main, tag: 1.7) + +2022-11-21 Mike Gabriel + + * Merge branch 'personal/peat-psuwit/fight-lp1986665' into 'main' + (99aab45) + +2022-11-22 Ratchanan Srirattanamet + + * GMock: find pre-packaged GTest only after we cannot find sources + (d4183c1) + +2022-10-10 Mike Gabriel + + * Merge branch 'pr/add-g-dbus-codegen' into 'main' (0a7595d) + +2022-10-10 Robert Tari + + * Add GdbusCodegen (fea173a) + +2022-03-11 Marius Gripsgard + + * Merge branch 'gmock-cmake' into 'main' (5f56466) + +2022-01-12 Dalton Durst + + * Back to development (1e9b2c6) + * Release cmake-extras 1.6 (a7bfb6f) (tag: 1.6) + +2021-04-04 Luca Weiss + + * GMock: Use GMock targets from CMake if possible (548ab2d) + * GMock: Extract version detection code into function (a3cdd9a) + +2021-05-28 Rodney + + * Merge branch 'personal/peat-psuwit/gmock-old-names' into 'main' + (87ffd0d) + +2021-05-28 Ratchanan Srirattanamet + + * GMock: add old variable names (a3a8770) + +2021-05-12 Rodney + + * Merge branch 'personal/peat-psuwit/gtest-var-name' into 'main' + (6833785) + +2021-05-12 Ratchanan Srirattanamet + + * GMock: rename pkg_check_modules variable name (a81e565) + +2021-05-11 Rodney + + * Merge branch 'personal/peat-psuwit/gmock-imported' into 'main' + (102d2f1) + +2021-05-11 Ratchanan Srirattanamet + + * GMock: switch from INTERFACE to IMPORTED library (b7bd24f) + +2021-05-06 Rodney + + * Merge branch 'personal/peat-psuwit/gmock-as-shared-lib' into 'main' + (ecd9b3a) + +2021-04-15 Rodney + + * Merge branch 'pr/fix-gmock-location' into 'main' (4a73b17) + +2021-04-15 Robert Tari + + * Fix GMock location search (c0fb302) + +2021-04-13 Marius Gripsgard + + * Merge branch 'qmlplugindump' into 'main' (8799c5b) + +2021-04-04 Luca Weiss + + * Add search hint for qmlplugindump (eaf6644) + +2021-04-01 Ratchanan Srirattanamet + + * GMock: support building GMock as shared libs (3b9322c) + * GMock: make sure gmock_main is independent (567bfd9) + +2021-03-28 Marius Gripsgard + + * Merge branch 'mr/sync-with-GMock.config-from-Debian' into 'main' + (4fd8a40) + +2021-03-22 Rodney + + * Merge branch 'personal/peat-psuwit/start-building-master' into + 'main' (15da831) + * Merge branch 'personal/peat-psuwit/bionic-patches' into 'main' + (27400e5) + +2019-07-24 Rodney Dawes + + * Get more complete gcc version info. (16a60b0) + +2021-03-22 Ratchanan Srirattanamet + + * Move Jenkinsfile to debian/ per the new guideline (3b00744) + * Update Jenkinsfile to use the shared library (d54df9f) + * Update Debian changelog and bump version (01e2108) + +2021-03-04 Marius Gripsgard + + * Merge branch 'pr/add-gi-and-vala' into 'master' (addbf80) + +2021-02-04 Robert Tari + + * Add gobject-introspection and vala (0fd0f0b) + +2020-10-24 Mike Gabriel + + * debian/tests/control: Require pkg-config and libgtest-dev for gmock + autopkgtest. (c405e6c) + * src/GMock/GMockConfig.cmake: Fix GMock detection for googletest + 1.10.0. (e27ac2a) + +2020-09-28 Marius Gripsgard + + * Merge branch 'gmock-fixes' into 'master' (1842866) + +2020-08-17 Marius Gripsgard + + * [GMock] Add support for >=1.8.1 and provide version varable + (9a3d444) + * git push origin "master"Merge branch 'mwhudson-patch-1' (f6b455d) + * Merge branch 'patch-1' of https://github.com/mwhudson/cmake-extras + into mwhudson-patch-1 (850b95f) + +2020-08-04 Michael Hudson-Doyle + + * Add #include of to examples/intltool-demo/src/main.cpp + (490c8b0) + +2020-02-25 Marius Gripsgard + + * Cleanup bzr ashes (a90eeed) (tag: 1.5) + +2019-02-18 Rodney + + * Merge pull request #10 from ubports/master_-_clean-coverage + (4db1e08) + +2019-02-18 Rodney Dawes + + * Move clean-coverage definition. (ccae5ad) + +2018-10-02 Rodney + + * Merge pull request #5 from ubports/bionic (f50570d) + +2018-10-02 Rodney Dawes + + * Use the u-t-sounds Jenkinsfile. (658abce) + +2018-10-01 Rodney Dawes + + * Remove arm references. (c3f2115) + * Bump the version. (8f0095d) + * Add a Jenkinsfile (1aa1b38) + +2018-09-29 Rodney + + * Merge pull request #4 from z3ntu/patch-1 (a0aaadf) + +2018-09-29 Luca Weiss + + * Fix error message in QmlPluginsConfig.cmake (fd96066) + +2018-09-20 Rodney Dawes + + * Enable doxyqml by default. (a711a56) + +2018-05-30 Florian Leeber + + * Merge pull request #1 from ubports/vanyasem-patch-1 (820b661) + +2018-05-29 Ivan Semkin + + * Add LICENSE (2d64028) + +2017-04-16 michihenning + + * Merge pull request #1 from bregma/add-readme (9d76947) + +2017-04-15 Stephen M. Webb + + * README.md: new file (d621974) + +2017-04-05 Bileto Bot + + * Releasing 1.4+17.04.20170405-0ubuntu1 (a03bc13) + +2017-04-05 Pete Woods + + * Intltool filtering should filter out files that match any regex. + (faa1f9f) + +2017-04-05 Larry Price + + * Allow passing in an argument to specify alternative programming + language to xgettext. (LP: #1675865) (e4cb3dd) + +2017-04-05 Bileto Bot + + * Drop deprecated modules now that no-one is using them any more, + fixing bug (LP: #1563573). (333f0e7) + +2017-04-03 Pete Woods + + * Merge fix-filtering branch to avoid conflicts (72eb8cf) + * Drop deprecated macros (14eeaf8) + +2017-03-28 Larry Price + + * Test alternative language (python) translations (39f1ff7) + +2017-03-27 Larry Price + + * Add an additional filter item (breaks old test, fixed by this MP) + (124fe00) + +2017-03-24 Larry Price + + * Add option to check multiple programming langauges with xgettext + (ea248fb) + * Filter out items that match any regex (e73dc3b) + +2017-03-10 Bileto Bot + + * Releasing 1.3+17.04.20170310-0ubuntu1 (1c41e1d) + * Make GDBus source name generation work like more conventional + macros. (9fe3c46) + +2017-03-10 Pete Woods + + * Switch to conventional generated source appending for GDbus macros. + (0702497) + +2017-02-28 Bileto Bot + + * Releasing 1.2+17.04.20170228-0ubuntu1 (916f3e8) + * Add function to compile GSettings schemas. (LP: #1664714. + Handle merging translations into non-ini file types. (LP: + #1664325); Append file globs for translation template + function. (LP: #1664345); Use already unique translation + template as target name.; Add a GDbus module for using + gdbus-codegen in cmake projects. (3a52a89) + +2017-02-28 Rodney Dawes + + * Add a module for using gdbus-codegen code with cmake. (5604735) + * Don't use the gettext unique target magic for pot files. (e2a366f) + * Append file globs rather than resetting the variable. (LP: + #1664345) (6ead42e) + * Handle other style options for merging, and no translations for xml + style. (LP: #1664325) (77242a5) + * Refactor GSettings module to provide a compile_schemas macro. (LP: + #1664714) (c41715e) + * Cleanups per review. (5480cf4) + * Quote the target names. (84c84b5) + * Initialize the strings. (3443207) + +2017-02-27 Rodney Dawes + + * Bump the version to 1.2. (880fbed) + * Fix typo. (ad4ea0a) + * Add BYPRODUCTS so the generated sources get flagged as such. + (1c1b8bf) + +2017-02-24 Rodney Dawes + + * Add a module for using gdbus-codegen code with cmake. (040ee8a) + +2017-02-22 Rodney Dawes + + * Don't use the gettext unique target magic for pot files. (aab6dbd) + * Append file globs rather than resetting the variable. (163473a) + * Fix indentation. (554cdf1) + * Fix the tests. (33ad663) + * Merge up with more-gsettings. (c91f238) + * Don't comment out the trap line. (d0ec9af) + * Fix issues with gsettings test command. Always need to copy the + schema file to binary dir. (454ac68) + * Fix comment typo. (a82e8e3) + * Restore the pot file. (f79620d) + * Restore building properly. Install and compile the schemas for the + dep8 test. (6584e1d) + +2017-02-21 Rodney Dawes + + * Merge up more-gsettings fixes. (abe8c8c) + * Need to find_package in the install code segment. (61e7c72) + * Merge up gsettings fixes. (3b88008) + * Build the merge targets always in the example demo. (7243cc9) + * Run make test in the dep8 test too. (fd9cb4a) + * Ensure a target exists for gschema files. Add the validation as a + test rather than a target. (20be2f7) + +2017-02-17 Rodney Dawes + + * Need gettext now for gsettings. (84c41a3) + * Reduce unrelated changes. (f1b58dd) + * Remove unused variable. (9df0446) + * Merge gsettings fixes. (d22afa8) + * Switch back to function with custom command and target. (af9c9b7) + * Rename the validation target and add a comment to it. Need to get + the property for schemas compiling depends. (2908664) + * Merge up gsettings changes. (e5fe61a) + * Add some more newlines. (a5b0b39) + +2017-02-16 Rodney Dawes + + * Add ALL to the validation target too. (a0668fa) + * Convert the macros to functions and use targets. (9c0e702) + * Quote the variables in the gsettings test. (371406d) + +2017-02-15 Rodney Dawes + + * Refactor INTLTOOL_MERGE_TRANSLATIONS into a macro. Handle other + style options for merging, and no translations for xml + style. (3edea2e) + * Must use DESTINATION with file COPY. (76c3f50) + * Refactor GSettings module to provide a compile_schemas macro. + (f727951) + +2017-02-13 Bileto Bot + + * Releasing 1.2+17.04.20170213-0ubuntu1 (1c3be9b) + * Add autopkgtest for gsettings macro.; Handle generated gschema + files. (LP: #1661686) (e64afba) + +2017-02-13 Rodney Dawes + + * Fix the version number. (658bc2e) + +2017-02-10 Rodney Dawes + + * Add changelog entry. (e5a99aa) + * Make the gsettings test work and verify the results. (89ddd79) + * Check for gsettings schema file in binary dir first. Add + autopkgtest for testing the gsettings module. (5589f87) + +2017-02-09 Bileto Bot + + * Releasing 1.1+17.04.20170209-0ubuntu1 (3073762) + * Add FILTER argument to intltool macros. (d2b6d0b) + * Add IncludeChecker macro. (6f2754f) + +2017-02-09 Pete Woods + + * Remove unnecessary custom check target (84f28e8) + * Add a bunch more test scenarios by adding CMake parameters + (af65a48) + * Fix missing comma in debian/tests/control (85879dd) + * Run pep8 and pyflakes on include_checker.py, and fix the errors + (df4c4f6) + +2017-02-08 Pete Woods + + * Add FILTER argument to intltool macros. (74b46e7) + * Add IncludeChecker macros (37f2dde) + +2017-01-10 Bileto Bot + + * Releasing 1.0+17.04.20170110.1-0ubuntu1 (ed06d8d) + +2017-01-10 Pete Woods + + * Add autopkgtest for DoxygenBuilder macros (803c0ca) + * Add autopkgtest for intltool macros (1702caa) + * Add autopkgtest for DoxygenBuilder (279f33f) + +2017-01-09 Pete Woods + + * Add language-pack-en dependency (13299fd) + * Add first autopkgtest for intltool macros (0015ebe) + +2016-12-08 Bileto Bot + + * Releasing 0.10+17.04.20161208.1-0ubuntu1 (7c1bf5e) + * Migrate all modules to unversioned cmake directory. (15196fc) + +2016-12-08 James Henstridge + + * Move coverage report code to use find_package(CoverageReport) + rather than include(EnableCoverageReport). (c20dce1) + * Fix typo in deprecation message. (4e7c7d8) + +2016-12-07 Pete Woods + + * Migrate cmake modules into unversioned cmake directory (cd0ff8e) + +2016-12-06 James Henstridge + + * Tweak deprecation message a bit. (dcc53ca) + +2016-12-05 James Henstridge + + * Move initial setup code to CoverageReportConfig.cmake, and ensure + CoverageReport_FOUND is set: this means + find_package(CoverageReport REQUIRED) should fail if none + of the tools are available. (07ddd0a) + * Move coverage report code to use find_package(). (838474c) + +2016-12-02 Bileto Bot + + * Releasing 0.9+17.04.20161202.1-0ubuntu1 (5161455) + * Added CopyrightTest module. (d2ccb40) + +2016-12-02 James Henstridge + + * Move some of the modules out of ${CMAKE_ROOT} and in to the + unversioned /usr/share/cmake/ directory. (67ebc24) + * Add an autopkgtest for the find_package(GMock) macro. (19c3eff) + +2016-12-02 Rodney Dawes + + * Simplify the INSTALL_TRANSLATIONS command to avoid regenerating po + files. (LP: #1645856) (9e8a866) + +2016-12-02 Michi Henning + + * Use ctest -V and set -e. (3ee7de4) + * Adjustment for different behavior of licensecheck on xenial, where + it won't look at CMakeLists.txt by default. (4a2e7b8) + * Fixes for autopkg tests that fail due to broken licensecheck on + zesty. (aa3eac7) + +2016-12-01 Michi Henning + + * Review comments from James. (2b5417c) + * Separate deps for autopkg tests. (42d1122) + * Fixed lintian warning. (50ce7e5) + * Removed redundant explicitly listed files. (5a980ce) + * And another test without IGNORE_DIR. (58eb541) + * Added one more test. (ad7fb57) + * Added autopkg tests. (fa59dfe) + * Merged lp:~jamesh/cmake-extras/gmock-autopkgtest (f0cc58e) + * Re-ordered stanzas to put the specific one at the end. Files: now + catches everything in the general stanza. (2087c8c) + * Added INCLUDE_PATTERN. (7007f20) + * Some review comments from James. (fd3257c) + * Added doc. Added .bzrignore. Merged dependent branch. Updated + changelog. (0d3cc1d) + * Now works with one level of escaping. (cc15f3f) + * Copyright test. Still need two levels of escaping for regex meta + characters. (f6dede3) + +2016-11-30 James Henstridge + + * Update copyright file for moved files. (1e20160) + * Move Find*.cmake modules to non-versioned cmake directory where + they can be discovered by the "config" mode of + find_package(). (c6ca863) + * Add autopkgtest for find_package(GMock) that tries to build the + example project. (198116f) + * Add an example project that uses find_package(GMock) (07cc347) + +2016-11-29 Rodney Dawes + + * Simplify the INSTALL_TRANSLATIONS command to avoid regenerating po + files. (c783289) + +2016-11-25 Bileto Bot + + * Releasing 0.8+17.04.20161125-0ubuntu1 (0788c7c) + * More appropriate fix for gtest 1.8, backward compatible with 1.7. + (677913b) + +2016-11-25 Michi Henning + + * Don't leak variables. (4c8e4af) + +2016-11-24 Michi Henning + + * Updated changelog and bumped version. (bc558a6) + * Fixed incorrect include path and added missing dependencies for + parallel builds. (2813270) + * Better fix to deal with both 1.7 and 1.8 versions of gtest/gmock. + (54a33bb) + +2016-11-23 Bileto Bot + + * Releasing 0.7+17.04.20161123.5-0ubuntu1 (1665237) + +2016-11-23 Michi Henning + + * Fixes for gtest 1.8.0. (LP: #1644062) (LP: #1644062) (7c99540) + * [ Timo Jyrinki, Martin Pitt ]; Fix versioning for upper cmake + version [ Martin Pitt, Gianfranco Costamagna ]; Enforce a + particular cmake runtime dependency, because the installed + files have an hardcoded version directory, so we need to + no-change rebuild at each new cmake release.; Rebuild + against new cmake 3.7.; No change rebuild for cmake 3.6 + (LP: #1635613) (2103a9e) + * Fix typo. (53a94fd) + * Fixes for libgtest-dev 1.8.0. (bfebde4) + +2016-05-13 CI Train Bot + + * Releasing 0.7+16.04.20160513-0ubuntu1 (61d30b3) + +2016-05-13 Pete Woods + + * Add optional `formatcode' test and rule for comparing code to, and + reformatting code to, a style guide standard. Approved by: + Pete Woods, Michi Henning (c4cb36e) + * Sync with distro (629e78e) + * Add formatcode module (f888a95) + * Sync with distro (81838db) + +2016-04-23 Charles Kerr + + * updat the 'make formatcode' rule and formatcode test to use the new + filter (bb7e15d) + * when installing our modules, preserve the source files' + permissions. needed for the formatcode.in script. + (8dea393) + * fix formatting errors (39d1501) + * try adapting the formatcode filter from unity-scopes-api (ba5d67a) + * initial formatcode filter file. doesn't do anything yet. (e8e8332) + * use astyle's linux linefeed option instead of reformatting with sed + (c9d2fe6) + +2016-04-21 Charles Kerr + + * in unity-api's clang-format, add 'SortIncludes: false' (2ed1a34) + * in unity-api's astyle config, enable --pad-oper since it's been + fixed in astyle 2.05 (4ca2567) + * tyop fix: s/atyle/astyle/ (5ac9fd6) + +2016-04-20 Pete Woods + + * merge lp:~pete-woods/cmake-extras/formatcode-changes to use sed and + to include ParseArgs (1b311f4) + * Use sed, rather than dos2unix, which is installed by default + (7dd486f) + * Add parse arguments include (15327dd) + +2016-04-04 Charles Kerr + + * Better public documentation. In internal funcs, unset config file + variables if the config file can't be found. (7150a62) + * in FormatCode, use CMakeParseArguments intead of global variables + (7850975) + +2016-03-25 Charles Kerr + + * add rst documentation (12ab357) + * first draft of a 'formatcode' target + test to make it easier to + follow a house style (ed8a9c3) + +2016-02-15 CI Train Bot + + * Releasing 0.6+16.04.20160215-0ubuntu1 (e7c9042) + +2016-02-15 Pete Woods + + * Respect DESTINATION parameter in QmlPlugins.cmake + Fixes: #1539314 + Approved by: Michał Sawicz (f03abe7) + +2016-02-08 Pete Woods + + * Fix usage of completely wrong variable name (269c8a1) + * Respond again (f10114f) + +2016-02-03 Pete Woods + + * Respond to review comments (d1239d8) + +2016-02-01 Pete Woods + + * Update changelog (d4613f6) + * Add NO_INSTALL option to QmlPlugins.cmake (d5b9164) + +2016-01-29 Pete Woods + + * Respect DESTINATION paramater in QmlPlugins.cmake (f6266e3) + +2016-01-13 CI Train Bot + + * Releasing 0.5+16.04.20160113-0ubuntu1 (2b6ce6e) + +2016-01-13 Michi Henning + + * Add -g to compile flags for gtest/gmock, otherwise we don't + necessarily get debug info if a test needs debugging with + gdb. Also added warning suppressions to stop the noise + from the build if the caller has additional warnings + enabled. Approved by: Pete Woods (78d9872) + +2015-10-26 CI Train Bot + + * Releasing 0.5+16.04.20151026-0ubuntu1 (6f4bbe6) + +2015-10-26 Pete Woods + + * No change rebuild for cmake 3.3 (37b5ae9) + * No change rebuild for cmake 3.3 (325dcb7) + +2015-10-21 CI Train Bot + + * Releasing 0.5+15.10.20151021-0ubuntu1 (fce03c1) + +2015-10-21 Pete Woods + + * Don't assume anything about the doxygen examples directory. Only + build docs when input files have changed. + Fixes: #1476487, + #1476488 (622ab52) + * Update changelog (8a3f60b) + * Don't assume anything about the doxygen examples directory. Only + build docs when input files have changed. (7c4996b) + +2015-10-20 CI Train Bot + + * Releasing 0.4+15.10.20151020-0ubuntu1 (be39565) + +2015-10-20 Michi Henning + + * Append with a space to compile flags (fixes lp:1469952). + Fixes: + #1469952 Approved by: Pete Woods (e450c57) + +2015-09-18 CI Train Bot + + * Releasing 0.4+15.10.20150918-0ubuntu1 (4216c9c) + +2015-09-18 Pete Woods + + * Fix failure when no COPYRIGHT_HOLDER argument provided (d0b3241) + +2015-09-17 Pete Woods + + * Fix failure when no COPYRIGHT_HOLDER argument provided (316469e) + +2015-09-15 Michi Henning + + * Fixed typo in gcc option. (3c380a7) + +2015-09-10 Michi Henning + + * Added -g and warning suppression flags for gtest/gmock, so they + build without noise and keep debug info for when a test + needs debugging with gdb. (6fed1be) + +2015-07-31 Michi Henning + + * Append with a space to compile flags (fixes lp:1469952). (b3bdf13) + +2015-06-22 CI Train Bot + + * Releasing 0.4+15.10.20150622.1-0ubuntu1 (0e93734) + +2015-06-22 Michi Henning + + * Fixes carried over from thumbnailer, made by James to correctly + filter XML coverage data, so we don't get tons of noise + about system files in the coverage report created by + Jenkins. Approved by: James Henstridge, Pete Woods, Michi + Henning (5a7cc43) + * Enable coverage with clang. If build type is coverage and clang is + used, clang emits coverage data in gcc format, so + gcovr/lcov can be used to generate the report. Approved + by: Pete Woods (0586ec0) + +2015-06-22 Pete Woods + + * Install modules using CMake to allow detection of CMake version + + Fixes: #1467030 (ec678bd) + * Add missing cmake build-depends (7d0a1ec) + * Fix intltool path exclude function (d120323) + +2015-06-19 Pete Woods + + * Perform installation using CMake, to allow version-detection + (4ee8516) + +2015-06-18 CI Train Bot + + * Releasing 0.4+15.10.20150618-0ubuntu1 (6516089) + +2015-06-18 Pete Woods + + * Move scripts to cmake-3.2 dir for compatibility with Wily (c25e633) + * Install in cmake-3.2 dir for compatability with wily (6d61bf6) + +2015-05-29 Michi Henning + + * More fixes made by James for thumbnailer: (f7aa3b2) + +2015-05-23 Michi Henning + + * Fixes carried over from thumbnailer, made by James to correctly + filter XML coverage data, so we don't get tons of noise + about system files in the coverage report created by + Jenkins. (2341320) + * Merged parent branch. [ Pete Woods ]; Add QmlPlugin macros.; Add + Doxygen macro added: UseDoxygen.Doxyfile.in + UseDoxygen.cmake; Add GSettings macro added: + UseGSettings.cmake [ Michi Henning ]; Added + clean-coverage target (d8f8888) + +2015-05-13 CI Train Bot + + * Releasing 0.4+15.04.20150513-0ubuntu1 (e97aea5) + +2015-05-13 Pete Woods + + * Add Doxygen macro (717258b) + * Add GSettings macro (99eabc4) + * Enhancements to intltool and add qml plugin (6ddf841) + +2015-05-13 Michi Henning + + * Added clean-coverage target (26f8c1a) + +2015-05-13 Pete Woods + + * Address michi's review comments (8ed207b) + +2015-05-11 Michi Henning + + * Enable coverage with Clang. (38b729f) + +2015-05-07 Pete Woods + + * Get paranoid about paths (3c0b03a) + * Handle filters being longer than paths (076aade) + * Don't derive plugin install path from qmake, or it will break + cross-builds (1cecdfe) + * Tabs to spaces (101a36d) + * Fix typos (d42f079) + * Add Doxygen macro (8d04353) + +2015-05-06 Pete Woods + + * Add GSettings macro (66217ca) + +2015-05-01 Michi Henning + + * Added coverage flags to link phase for targets in the TESTS + parameter. (921968c) + * Added clean-coverage target. Added -g --coverage flags to compile + and link flags. (56b57e3) + +2015-04-28 Pete Woods + + * Convenience function for QML plugins (85d06fb) + * Support COPYRIGHT_HOLDER and make POTFILE_TEMPLATE truly optional + (8bf5f7f) + * And QML plugin macros (9e936b8) + +2014-12-04 CI Train Bot + + * Releasing 0.3+15.04.20141204-0ubuntu1 (e24ecf2) + +2014-12-04 Pete Woods + + * Add intltool macros Approved by: Michał Sawicz, Marcus Tomlinson + (5e9c6ff) + * Add GMock support Approved by: Jussi Pakkanen (c00f5b8) + +2014-12-04 Daniel Holbach + + * Move files to /usr/share/cmake-3.0. + Fixes: #1394648 Approved by: + Jussi Pakkanen (97a02c9) + +2014-12-04 Michael Vogt + + * Sync changes from archive: (3241499) + +2014-12-04 Pete Woods + + * More docs (1dcac31) + * Fix broken dependencies due to non-absolute paths, exlude files + from binary dir, include N_ in SDK defaults (f874980) + +2014-12-03 Pete Woods + + * Support Ubuntu SDK defaults, and overriding the list of extensions + (1c1ea82) + * Use _PO_DIRECTORY variable (1a5d259) + * Remove debug code (63b0ebc) + * Parse the POTFILES.in, generate POTFILES.in, generate + Makefile.in.in (e42456f) + * Don't need this function (61526e4) + * Spelling (610d387) + * Improve docs (85bee20) + * Add QML and js (25e0cd3) + +2014-12-03 Michael Vogt + + * Sync archive changes (619a4c0) + +2014-12-03 Pete Woods + + * More docs (dafb6ea) + * Add Intltool macros (e62e460) + * Add docs and update debian version (c87feef) + +2014-12-02 Pete Woods + + * GMock support (786298e) + +2014-11-20 Daniel Holbach + + * fix install path (0b5b20e) + +2014-09-10 CI bot + + * Releasing 0.2+14.10.20140910-0ubuntu1 (0139642) + +2014-09-10 Pete Woods + + * Support plural forms (1bcad9e) + +2014-09-09 Pete Woods + + * Support plural forms (db335ff) + +2014-09-05 CI bot + + * Releasing 0.2+14.10.20140905-0ubuntu1 (1f49c5f) + +2014-09-05 Pete Woods + + * Add translation macros (c4398a0) + * Use built in macros (44a9de4) + * Add XGettext translation macros (ebe8cb2) + +2014-05-27 CI bot + + * Releasing 0.1+14.10.20140527-0ubuntu1 (c6b85ae) + * Null merge to release initial CMake extras. (5ca9dc8) + +2014-05-27 Allan LeSage + + * Corect version number to 0.1. (fd4a731) + * Added debian/install for cmake macros. (3361a79) + * Added coverage macro files, added debian/copyright LGPL-3. + (1a959e7) + * Add control entry for cmake-extras, add debian/compat. (8f5c8a5) + * Initial commit. (c745f0c) diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 156be73..0000000 --- a/Jenkinsfile +++ /dev/null @@ -1,42 +0,0 @@ - -pipeline { - agent any - stages { - stage('Build source') { - steps { - sh '/usr/bin/build-source.sh' - stash(name: 'source', includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt') - cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true) - } - } - stage('Build binary - all') { - steps { - parallel( - "Build binary - all": { - node(label: 'arm64') { - cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true) - unstash 'source' - sh '''export architecture="arm64" - build-binary.sh''' - stash(includes: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo,lintian.txt', name: 'build-all') - cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true) - } - } - ) - } - } - stage('Results') { - steps { - cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true) - unstash 'build-all' - archiveArtifacts(artifacts: '*.gz,*.bz2,*.xz,*.deb,*.dsc,*.changes,*.buildinfo', fingerprint: true, onlyIfSuccessful: true) - sh '''/usr/bin/build-repo.sh''' - } - } - stage('Cleanup') { - steps { - cleanWs(cleanWhenAborted: true, cleanWhenFailure: true, cleanWhenNotBuilt: true, cleanWhenSuccess: true, cleanWhenUnstable: true, deleteDirs: true) - } - } - } -} diff --git a/debian/changelog b/debian/changelog index 946ab50..db4a1ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,31 @@ +cmake-extras (1.7-2) unstable; urgency=medium + + * debian/patches: Add patch to workaround cmake bug (closes: #1058503) + (closes: #1058341) + * debian/control: Add myself as uploader + + -- Marius Gripsgard Tue, 30 Jan 2024 01:28:47 +0100 + +cmake-extras (1.7-1) unstable; urgency=medium + + * New upstream release. + * debian/control: + + Bump Standards-Version: to 4.6.2. No changes needed + * debian/copyright: + + Add auto-generated copyright.in template file for later tracking of + copyright changes. + + Update copyright attributions. + + -- Mike Gabriel Sun, 19 Nov 2023 16:42:49 +0100 + +cmake-extras (1.6-1) unstable; urgency=medium + + * New upstream release. + * debian/patches: + + Drop patches 1002, 1003, 1005, 1006 and 1007. All integrated upstream. + + -- Mike Gabriel Wed, 02 Feb 2022 14:02:57 +0100 + cmake-extras (1.5-8) unstable; urgency=medium * debian/patches: diff --git a/debian/control b/debian/control index 506cb84..604a5a1 100644 --- a/debian/control +++ b/debian/control @@ -6,9 +6,10 @@ Uploaders: Ayatana Packagers , Debian CMake Team , Debian UBports Team , + Marius Gripsgard , Build-Depends: cmake, debhelper-compat (= 13), -Standards-Version: 4.6.0 +Standards-Version: 4.6.2 Rules-Requires-Root: no Homepage: https://gitlab.com/ubports/core/cmake-extras/ Vcs-Git: https://salsa.debian.org/debian-ayatana-team/cmake-extras.git diff --git a/debian/copyright b/debian/copyright index 3f459be..a3c1b2e 100644 --- a/debian/copyright +++ b/debian/copyright @@ -2,16 +2,124 @@ Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: cmake-extras Source: https://gitlab.com/ubports/core/cmake-extras/ -Files: * -Copyright: Canonical Ltd. +Files: .gitignore + AUTHORS + CMakeLists.txt + ChangeLog + README.md + examples/copyrighttest-demo/no_copyright.cpp + examples/copyrighttest-demo/no_copyright.h + examples/doxygenbuilder-demo/CMakeLists.txt + examples/doxygenbuilder-demo/doc/CMakeLists.txt + examples/doxygenbuilder-demo/doc/pages/mainpage.dox + examples/doxygenbuilder-demo/examples/example-1.cpp + examples/doxygenbuilder-demo/src/my-namespace/my-class.h + examples/findgmock-demo/CMakeLists.txt + examples/findgmock-demo/test-suite.cpp + examples/gdbus-demo/CMakeLists.txt + examples/gdbus-demo/main.cpp + examples/gdbus-demo/org.freedesktop.DBus.xml + examples/gsettings-demo/CMakeLists.txt + examples/gsettings-demo/generated.gschema.xml.in + examples/gsettings-demo/static.gschema.xml + examples/includechecker-demo/CMakeLists.txt + examples/includechecker-demo/include/demolib/bad/bad-header.h + examples/includechecker-demo/include/demolib/good-header.h + examples/includechecker-demo/include/demolib/internal/bar.h + examples/includechecker-demo/test/CMakeLists.txt + examples/includechecker-demo/test/demolib/CMakeLists.txt + examples/includechecker-demo/test/demolib/bad/bad-header-test.cpp + examples/includechecker-demo/test/demolib/good-header-test.cpp + examples/intltool-demo/CMakeLists.txt + examples/intltool-demo/po/CMakeLists.txt + examples/intltool-demo/po/POTFILES.in.in + examples/intltool-demo/po/en_AU.po + examples/intltool-demo/po/intltool-demo.pot + examples/intltool-demo/python/CMakeLists.txt + examples/intltool-demo/python/other_language_translations.py + examples/intltool-demo/src/CMakeLists.txt + examples/intltool-demo/src/foo.ini.in + examples/intltool-demo/src/main.cpp + examples/intltool-demo/src/translated.gschema.xml.in + examples/intltool-demo/test/test.cpp + src/CoverageReport/CoverageReportConfig.cmake + src/DoxygenBuilder/Doxyfile.in + src/FormatCode/unity-api.astyle + src/FormatCode/unity-api.clang-format + src/GSettings/GSettingsConfig.cmake + src/GdbusCodegen/GdbusCodegenConfig.cmake + src/IncludeChecker/deps + src/QmlPlugins/QmlPluginsConfig.cmake +Copyright: 2013-2017, Canonical Ltd License: LGPL-3 +Comment: + Missing license headers, assuming copyright holdership and + license from majority of other files and what Canonical Ltd. + used to ship in the original d/copyright file. -Files: src/gcovr/gcovrConfig.cmake +Files: examples/copyrighttest-demo/CMakeLists.txt + examples/copyrighttest-demo/copyright.cpp + examples/copyrighttest-demo/copyright.h + src/CopyrightTest/check_copyright.sh + src/CopyrightTest/CopyrightTestConfig.cmake + src/DoxygenBuilder/DoxygenBuilderConfig.cmake + src/FormatCode/formatcode.in + src/GDbus/GDbusConfig.cmake + src/GMock/GMockConfig.cmake + src/IncludeChecker/include_checker.py + src/Intltool/IntltoolConfig.cmake +Copyright: 2013, Canonical Ltd + 2013-2016, Canonical Ltd + 2014, Canonical Ltd + 2015, Canonical Ltd + 2017, Canonical Ltd +License: LGPL-3 + +Files: src/FormatCode/FormatCodeConfig.cmake + src/FormatCode/formatcode_common.cmake + src/FormatCode/formatcode_format.cmake.in + src/FormatCode/formatcode_test.cmake.in + src/IncludeChecker/IncludeCheckerConfig.cmake +Copyright: 2016, Canonical Ltd + 2017, Canonical Ltd +License: LGPL-3+ + +Files: src/CoverageReport/EnableCoverageReport.cmake src/Lcov/LcovConfig.cmake - src/CoverageReport/EnableCoverageReport.cmake -Copyright: 2010 Johannes Wienke + src/gcovr/gcovrConfig.cmake +Copyright: 2010, Johannes Wienke + 2011, Johannes Wienke +License: LGPL-3+ + +Files: src/Vala/ValaConfig.cmake +Copyright: Přemysl Janouch 2011 +License: BSD-2-clause + +Files: src/GObjectIntrospection/GObjectIntrospectionConfig.cmake +Copyright: 2010, Pino Toscano, +License: BSD-2-clause +Comment: + Exact license version is missing assuming CMake license. + +Files: debian/* +Copyright: 2013-2017, Canonical Ltd. + 2014-2023, Mike Gabriel License: LGPL-3 +Files: debian/tests/copyrighttest + debian/tests/doxygenbuilder + debian/tests/findgmock + debian/tests/gdbus + debian/tests/gsettings + debian/tests/includechecker + debian/tests/intltool +Copyright: 2016, Canonical Ltd. + 2017, Canonical Ltd. +License: LGPL-3 +Comment: + No licence in file headers, assuming Canonical Ltd.'s + original cmake-extras license. + License: LGPL-3 This file may be licensed under the terms of the GNU Lesser General Public License Version 3 (the ``LGPL''). @@ -21,5 +129,50 @@ License: LGPL-3 express or implied. See the LGPL for the specific language governing rights and limitations. . + You should have received a copy of the LGPL along with this + program. If not, go to http://www.gnu.org/licenses/lgpl.html + or write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + . On Debian/Ubuntu systems, the full text of the LGPL v3 can be found in `/usr/share/common-licenses/LGPL-3' + +License: LGPL-3+ + This file may be licensed under the terms of the + GNU Lesser General Public License Version 3 (the ``LGPL''), + or (at your option) any later version. + . + Software distributed under the License is distributed + on an ``AS IS'' basis, WITHOUT WARRANTY OF ANY KIND, either + express or implied. See the LGPL for the specific language + governing rights and limitations. + . + You should have received a copy of the LGPL along with this + program. If not, go to http://www.gnu.org/licenses/lgpl.html + or write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + . + On Debian/Ubuntu systems, the full text of the LGPL v3 can be found in + `/usr/share/common-licenses/LGPL-3' + +License: BSD-2-clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are met: + . + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + . + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' + AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, + THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY + OF SUCH DAMAGE. diff --git a/debian/copyright.in b/debian/copyright.in new file mode 100644 index 0000000..ab78b5d --- /dev/null +++ b/debian/copyright.in @@ -0,0 +1,172 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: FIXME +Upstream-Contact: FIXME +Source: FIXME +Disclaimer: Autogenerated by licensecheck + +Files: AUTHORS + CMakeLists.txt + README.md + debian/examples + debian/files + debian/patches/1008_src-DoxygenBuilder-Doxyfile.in-Create-Doxgen-documen.patch + debian/patches/README + debian/patches/series + debian/rules + debian/source/format + debian/tests/control + debian/upstream/metadata + debian/watch + examples/copyrighttest-demo/no_copyright.cpp + examples/copyrighttest-demo/no_copyright.h + examples/doxygenbuilder-demo/CMakeLists.txt + examples/doxygenbuilder-demo/doc/CMakeLists.txt + examples/doxygenbuilder-demo/doc/pages/mainpage.dox + examples/doxygenbuilder-demo/examples/example-1.cpp + examples/doxygenbuilder-demo/src/my-namespace/my-class.h + examples/findgmock-demo/CMakeLists.txt + examples/findgmock-demo/test-suite.cpp + examples/gdbus-demo/CMakeLists.txt + examples/gdbus-demo/main.cpp + examples/gdbus-demo/org.freedesktop.DBus.xml + examples/gsettings-demo/CMakeLists.txt + examples/gsettings-demo/generated.gschema.xml.in + examples/gsettings-demo/static.gschema.xml + examples/includechecker-demo/CMakeLists.txt + examples/includechecker-demo/include/demolib/bad/bad-header.h + examples/includechecker-demo/include/demolib/good-header.h + examples/includechecker-demo/include/demolib/internal/bar.h + examples/includechecker-demo/test/CMakeLists.txt + examples/includechecker-demo/test/demolib/CMakeLists.txt + examples/includechecker-demo/test/demolib/bad/bad-header-test.cpp + examples/includechecker-demo/test/demolib/good-header-test.cpp + examples/intltool-demo/CMakeLists.txt + examples/intltool-demo/po/CMakeLists.txt + examples/intltool-demo/po/POTFILES.in.in + examples/intltool-demo/po/en_AU.po + examples/intltool-demo/po/intltool-demo.pot + examples/intltool-demo/python/CMakeLists.txt + examples/intltool-demo/python/other_language_translations.py + examples/intltool-demo/src/CMakeLists.txt + examples/intltool-demo/src/foo.ini.in + examples/intltool-demo/src/main.cpp + examples/intltool-demo/src/translated.gschema.xml.in + examples/intltool-demo/test/test.cpp + src/CoverageReport/CoverageReportConfig.cmake + src/DoxygenBuilder/Doxyfile.in + src/FormatCode/unity-api.astyle + src/FormatCode/unity-api.clang-format + src/GSettings/GSettingsConfig.cmake + src/GdbusCodegen/GdbusCodegenConfig.cmake + src/IncludeChecker/deps + src/QmlPlugins/QmlPluginsConfig.cmake +Copyright: NONE +License: UNKNOWN + FIXME + +Files: src/CopyrightTest/check_copyright.sh + src/DoxygenBuilder/DoxygenBuilderConfig.cmake + src/FormatCode/formatcode.in + src/GDbus/GDbusConfig.cmake + src/GMock/GMockConfig.cmake + src/IncludeChecker/include_checker.py + src/Intltool/IntltoolConfig.cmake +Copyright: 2013, Canonical Ltd + 2013-2016, Canonical Ltd + 2014, Canonical Ltd + 2015, Canonical Ltd + 2017, Canonical Ltd +License: LGPL-3 + FIXME + +Files: debian/tests/copyrighttest + debian/tests/doxygenbuilder + debian/tests/findgmock + debian/tests/gdbus + debian/tests/gsettings + debian/tests/includechecker + debian/tests/intltool +Copyright: 2016, Canonical Ltd. + 2017, Canonical Ltd. +License: UNKNOWN + FIXME + +Files: src/FormatCode/FormatCodeConfig.cmake + src/FormatCode/formatcode_common.cmake + src/FormatCode/formatcode_format.cmake.in + src/FormatCode/formatcode_test.cmake.in + src/IncludeChecker/IncludeCheckerConfig.cmake +Copyright: 2016, Canonical Ltd + 2017, Canonical Ltd +License: LGPL-3+ + FIXME + +Files: examples/copyrighttest-demo/CMakeLists.txt + examples/copyrighttest-demo/copyright.cpp + examples/copyrighttest-demo/copyright.h +Copyright: 2015, Canonical Ltd. +License: LGPL-3 + FIXME + +Files: src/CoverageReport/EnableCoverageReport.cmake + src/Lcov/LcovConfig.cmake + src/gcovr/gcovrConfig.cmake +Copyright: 2010, Johannes Wienke + 2011, Johannes Wienke +License: LGPL-3+ + FIXME + +Files: src/Vala/ValaConfig.cmake +Copyright: Přemysl Janouch 2011 +License: BSD-2-clause + FIXME + +Files: LICENSE +Copyright: 2007, Free Software Foundation, Inc. +License: GPL-3 + FIXME + +Files: src/CopyrightTest/CopyrightTestConfig.cmake +Copyright: 2016, Canonical Ltd + header in this subtree are ignored. + header. + headers in files that + messages from licensecheck: any reports about files without +License: LGPL-3 + FIXME + +Files: debian/copyright +Copyright: 2010, Johannes Wienke + Canonical Ltd. +License: LGPL-3 + FIXME + +Files: debian/changelog +Copyright: LGPL-3. + format reference. + watch}: +License: LGPL-3 + FIXME + +Files: debian/patches/1004_switch-to-python3.patch +Copyright: 2017, Canonical Ltd +License: UNKNOWN + FIXME + +Files: ChangeLog +Copyright: LGPL-3. + file for moved files. (1e20160) + test. Still need two levels of escaping for regex meta +License: UNKNOWN + FIXME + +Files: src/GObjectIntrospection/GObjectIntrospectionConfig.cmake +Copyright: 2010, Pino Toscano, +License: UNKNOWN + FIXME + +Files: debian/control +Copyright: testing +License: UNKNOWN + FIXME + diff --git a/debian/patches/0001-GMock-Workaround-cmake-bug.patch b/debian/patches/0001-GMock-Workaround-cmake-bug.patch new file mode 100644 index 0000000..c275ff1 --- /dev/null +++ b/debian/patches/0001-GMock-Workaround-cmake-bug.patch @@ -0,0 +1,46 @@ +From 7132b262fc92b20ae4e8d13d1c51ecb8604293f4 Mon Sep 17 00:00:00 2001 +From: Marius Gripsgard +Date: Tue, 30 Jan 2024 01:02:25 +0100 +Subject: [PATCH] GMock: Workaround cmake bug + +I have no idea what is going on here, but adding the gmock/gtest +libraries twice seems to fix the issue where cmake does not wait for +gmock to be done building. This causes a race, but adding them twice +fixes this, this is harmless but confusing. +--- + src/GMock/GMockConfig.cmake | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/src/GMock/GMockConfig.cmake b/src/GMock/GMockConfig.cmake +index f982352..6f44575 100644 +--- a/src/GMock/GMockConfig.cmake ++++ b/src/GMock/GMockConfig.cmake +@@ -168,17 +168,17 @@ set_property(TARGET gmock_main PROPERTY IMPORTED_LOCATION ${findgmock_gmock_main + target_include_directories(gmock_main INTERFACE ${GMOCK_INCLUDE_DIRS}) + target_link_libraries(gmock_main INTERFACE gmock) + +-set(GTEST_LIBRARIES gtest) +-set(GTEST_MAIN_LIBRARIES gtest_main) +-set(GMOCK_LIBRARIES gmock_main gmock) ++set(GTEST_LIBRARIES gtest gtest) ++set(GTEST_MAIN_LIBRARIES gtest_main gtest_main) ++set(GMOCK_LIBRARIES gmock_main gmock gmock_main gmock) + set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) + + # Old names +-set(GTEST_LIBRARY gtest) +-set(GTEST_MAIN_LIBRARY gtest_main) +-set(GMOCK_LIBRARY gmock) +-set(GMOCK_MAIN_LIBRARY gmock_main) +-set(GMOCK_BOTH_LIBRARIES gmock_main gmock) ++set(GTEST_LIBRARY gtest gtest) ++set(GTEST_MAIN_LIBRARY gtest_main gtest_main) ++set(GMOCK_LIBRARY gmock gmock) ++set(GMOCK_MAIN_LIBRARY gmock_main gmock_main) ++set(GMOCK_BOTH_LIBRARIES gmock_main gmock gmock_main gmock) + # This used to be "${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES}", but + # I understand that you're not supposd to include gtest_main and gmock_main + # at the same time. +-- +2.43.0 + diff --git a/debian/patches/1002_fix-googletest-1_8_1-1.patch b/debian/patches/1002_fix-googletest-1_8_1-1.patch deleted file mode 100644 index 8062285..0000000 --- a/debian/patches/1002_fix-googletest-1_8_1-1.patch +++ /dev/null @@ -1,44 +0,0 @@ -Description: Make GMockConfig.cmake work with googletest/1.8.1-1 -Author: Mike Gabriel -Comment: - Original patch idea from: Shengjing Zhu -Abstract: - With googletest/1.8.1-1 and later a dependency of gmock on gmock_main - had been introduced. Reflecting this in the GMockConfig.cmake file. - ---- a/src/GMock/GMockConfig.cmake -+++ b/src/GMock/GMockConfig.cmake -@@ -57,8 +57,8 @@ - BINARY_DIR "${findgmock_bin_dir}" - BUILD_BYPRODUCTS "${findgmock_gtest_lib}" - "${findgmock_gtest_main_lib}" -- "${findgmock_gmock_lib}" - "${findgmock_gmock_main_lib}" -+ "${findgmock_gmock_lib}" - INSTALL_COMMAND "" - CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}") - -@@ -71,17 +71,17 @@ - target_include_directories(gtest_main INTERFACE ${GTEST_INCLUDE_DIRS}) - target_link_libraries(gtest_main INTERFACE ${findgmock_gtest_main_lib} gtest) - --add_library(gmock INTERFACE) --target_include_directories(gmock INTERFACE ${GMOCK_INCLUDE_DIRS}) --target_link_libraries(gmock INTERFACE ${findgmock_gmock_lib} gtest) -- - add_library(gmock_main INTERFACE) - target_include_directories(gmock_main INTERFACE ${GMOCK_INCLUDE_DIRS}) --target_link_libraries(gmock_main INTERFACE ${findgmock_gmock_main_lib} gmock) -+target_link_libraries(gmock_main INTERFACE ${findgmock_gmock_main_lib}) -+ -+add_library(gmock INTERFACE) -+target_include_directories(gmock INTERFACE ${GMOCK_INCLUDE_DIRS}) -+target_link_libraries(gmock INTERFACE ${findgmock_gmock_lib} gtest gmock_main) - - set(GTEST_LIBRARIES gtest) - set(GTEST_MAIN_LIBRARIES gtest_main) --set(GMOCK_LIBRARIES gmock gmock_main) -+set(GMOCK_LIBRARIES gmock_main gmock) - set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) - - unset(findgmock_cxx_flags) diff --git a/debian/patches/1003_fix-googletests_1_9.patch b/debian/patches/1003_fix-googletests_1_9.patch deleted file mode 100644 index a0a23df..0000000 --- a/debian/patches/1003_fix-googletests_1_9.patch +++ /dev/null @@ -1,20 +0,0 @@ -Description: Recent versions of googletest (observed for >= v1.9) install libgtest*.a and libgmock*.a to a lib/ dir now. -Author: Mike Gabriel - ---- a/src/GMock/GMockConfig.cmake -+++ b/src/GMock/GMockConfig.cmake -@@ -47,10 +47,10 @@ - set(findgmock_cxx_flags "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers -Wno-ctor-dtor-privacy -Wno-switch-default") - - set(findgmock_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/gmock") --set(findgmock_gtest_lib "${findgmock_bin_dir}/gtest/libgtest.a") --set(findgmock_gtest_main_lib "${findgmock_bin_dir}/gtest/libgtest_main.a") --set(findgmock_gmock_lib "${findgmock_bin_dir}/libgmock.a") --set(findgmock_gmock_main_lib "${findgmock_bin_dir}/libgmock_main.a") -+set(findgmock_gtest_lib "${findgmock_bin_dir}/lib/libgtest.a") -+set(findgmock_gtest_main_lib "${findgmock_bin_dir}/lib/libgtest_main.a") -+set(findgmock_gmock_lib "${findgmock_bin_dir}/lib/libgmock.a") -+set(findgmock_gmock_main_lib "${findgmock_bin_dir}/lib/libgmock_main.a") - - include(ExternalProject) - ExternalProject_Add(GMock SOURCE_DIR "${GMOCK_SOURCE_DIR}" diff --git a/debian/patches/1005_fix_intltool-demo.patch b/debian/patches/1005_fix_intltool-demo.patch deleted file mode 100644 index 19969e9..0000000 --- a/debian/patches/1005_fix_intltool-demo.patch +++ /dev/null @@ -1,13 +0,0 @@ -Description: Add #include of to examples/intltool-demo/src/main.cpp, fixing autopkgtest. -Author: Michael Hudson-Doyle - ---- a/examples/intltool-demo/src/main.cpp -+++ b/examples/intltool-demo/src/main.cpp -@@ -2,6 +2,7 @@ - #include - #include - #include -+#include - - using namespace std; - diff --git a/debian/patches/1006_fix-googletests-1_10_0.patch b/debian/patches/1006_fix-googletests-1_10_0.patch deleted file mode 100644 index 51ff947..0000000 --- a/debian/patches/1006_fix-googletests-1_10_0.patch +++ /dev/null @@ -1,99 +0,0 @@ ---- a/src/GMock/GMockConfig.cmake -+++ b/src/GMock/GMockConfig.cmake -@@ -25,32 +25,91 @@ - # ${GTEST_BOTH_LIBRARIES} - # ) - # -+# This also provides the following variables, with the version of the found gtest. -+# These are both set as c/c++ definitions and cmake varables -+# -+# GTEST_VERSION_MAJOR -+# GTEST_VERSION_MINOR -+# GTEST_VERSION_PATCH -+# -+# and required starting with 1.10: -+# GOOGLETEST_VERSION -+# - # NOTE: Due to the way this package finder is implemented, do not attempt - # to find the GMock package more than once. - - find_package(Threads) -+find_package(PkgConfig) - - if (EXISTS "/usr/src/googletest") -- # As of version 1.8.0 -+ # at least version 1.8.0 -+ set(GTEST_VERSION_STR "1.8.0") - set(GMOCK_SOURCE_DIR "/usr/src/googletest/googlemock" CACHE PATH "gmock source directory") - set(GMOCK_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/include" CACHE PATH "gmock source include directory") - set(GTEST_INCLUDE_DIRS "/usr/src/googletest/googletest/include" CACHE PATH "gtest source include directory") - else() -+ # fallback - set(GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory") - set(GMOCK_INCLUDE_DIRS "/usr/include" CACHE PATH "gmock source include directory") - set(GTEST_INCLUDE_DIRS "/usr/include" CACHE PATH "gtest source include directory") -+ set(GTEST_VERSION_STR "1.7.0") -+endif() -+message("-- Using ${GMOCK_SOURCE_DIR}/ as gmock source directory") -+ -+# get a gtest version string that the regex will match -+pkg_check_modules(GTEST "gtest") -+if (GTEST_FOUND) -+ set(GTEST_VERSION_STR ${GTEST_VERSION}) -+ set(GTEST_DETECTION_METHOD "pkg-config") -+elseif (DEFINED ENV{GTEST_VERSION}) -+ set(GTEST_VERSION_STR $ENV{GTEST_VERSION}) -+ set(GTEST_DETECTION_METHOD "GTEST_VERSION environment variable") -+else() -+ message(WARNING "Could not detect GTest version, Assuming v${GTEST_VERSION_STR} (or compatible) and hoping for the best") -+ add_definitions(-DGTEST_VERSION_UNKNOWN) -+ set(GTEST_DETECTION_METHOD "best guess, could not detect") -+endif() -+ -+string(REGEX MATCH -+ "([0-9]+)\\.([0-9]+)\\.([0-9]+)" GTEST_VERSION_PARSED -+ ${GTEST_VERSION_STR}) -+if (GTEST_VERSION_PARSED) -+ set(GTEST_VERSION_MAJOR ${CMAKE_MATCH_1}) -+ set(GTEST_VERSION_MINOR ${CMAKE_MATCH_2}) -+ set(GTEST_VERSION_PATCH ${CMAKE_MATCH_3}) -+ message("-- Using GTest v${GTEST_VERSION_MAJOR}.${GTEST_VERSION_MINOR}.${GTEST_VERSION_PATCH} (parsed from ${GTEST_DETECTION_METHOD})") -+else() -+ # fallback to 1.8.0 -+ message(WARNING "Could not parse GTest version: ${GTEST_VERSION_STR} (${GTEST_DETECTION_METHOD}), Assuming v1.8.0 (or compatible) and hoping for the best") -+ set(GTEST_VERSION_MAJOR 1) -+ set(GTEST_VERSION_MINOR 8) -+ set(GTEST_VERSION_PATCH 0) -+ add_definitions(-DGTEST_VERSION_UNKNOWN) - endif() - -+add_definitions(-DGTEST_VERSION_MAJOR=${GTEST_VERSION_MAJOR}) -+add_definitions(-DGTEST_VERSION_MINOR=${GTEST_VERSION_MINOR}) -+add_definitions(-DGTEST_VERSION_PATCH=${GTEST_VERSION_PATCH}) -+ - # We add -g so we get debug info for the gtest stack frames with gdb. - # The warnings are suppressed so we get a noise-free build for gtest and gmock if the caller - # has these warnings enabled. - set(findgmock_cxx_flags "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers -Wno-ctor-dtor-privacy -Wno-switch-default") - - set(findgmock_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/gmock") --set(findgmock_gtest_lib "${findgmock_bin_dir}/lib/libgtest.a") --set(findgmock_gtest_main_lib "${findgmock_bin_dir}/lib/libgtest_main.a") --set(findgmock_gmock_lib "${findgmock_bin_dir}/lib/libgmock.a") --set(findgmock_gmock_main_lib "${findgmock_bin_dir}/lib/libgmock_main.a") -+ -+if ("${GTEST_VERSION_MAJOR}.${GTEST_VERSION_MINOR}.${GTEST_VERSION_PATCH}" VERSION_LESS "1.8.1") -+ set(findgmock_gtest_libdir "${findgmock_bin_dir}/gtest") -+ set(findgmock_gmock_libdir "${findgmock_bin_dir}") -+else() -+ set(findgmock_gtest_libdir "${findgmock_bin_dir}/lib") -+ set(findgmock_gmock_libdir "${findgmock_bin_dir}/lib") -+endif() -+ -+set(findgmock_gtest_lib "${findgmock_gtest_libdir}/libgtest.a") -+set(findgmock_gtest_main_lib "${findgmock_gtest_libdir}/libgtest_main.a") -+set(findgmock_gmock_lib "${findgmock_gmock_libdir}/libgmock.a") -+set(findgmock_gmock_main_lib "${findgmock_gmock_libdir}/libgmock_main.a") - - include(ExternalProject) - ExternalProject_Add(GMock SOURCE_DIR "${GMOCK_SOURCE_DIR}" diff --git a/debian/patches/1007_fix-FTCBFS-of-googlemock-projects.patch b/debian/patches/1007_fix-FTCBFS-of-googlemock-projects.patch deleted file mode 100644 index 4dd4d33..0000000 --- a/debian/patches/1007_fix-FTCBFS-of-googlemock-projects.patch +++ /dev/null @@ -1,16 +0,0 @@ -Description: Fix FTCBFS when invoking the external project in GMockConfig.cmake. -Author: Helmut Grohne -Forwarded: https://gitlab.com/ubports/core/cmake-extras/-/merge_requests/4 - ---- a/src/GMock/GMockConfig.cmake -+++ b/src/GMock/GMockConfig.cmake -@@ -119,7 +119,8 @@ - "${findgmock_gmock_main_lib}" - "${findgmock_gmock_lib}" - INSTALL_COMMAND "" -- CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}") -+ CMAKE_ARGS "-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}" -+ "-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}") - - add_library(gtest INTERFACE) - target_include_directories(gtest INTERFACE ${GTEST_INCLUDE_DIRS}) diff --git a/debian/patches/series b/debian/patches/series index 9ff61bc..e1ba809 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,7 +1,3 @@ -1002_fix-googletest-1_8_1-1.patch -1003_fix-googletests_1_9.patch 1004_switch-to-python3.patch -1005_fix_intltool-demo.patch -1006_fix-googletests-1_10_0.patch -1007_fix-FTCBFS-of-googlemock-projects.patch 1008_src-DoxygenBuilder-Doxyfile.in-Create-Doxgen-documen.patch +0001-GMock-Workaround-cmake-bug.patch diff --git a/examples/intltool-demo/src/main.cpp b/examples/intltool-demo/src/main.cpp index a54cf4b..57b653f 100644 --- a/examples/intltool-demo/src/main.cpp +++ b/examples/intltool-demo/src/main.cpp @@ -2,6 +2,7 @@ #include #include #include +#include using namespace std; diff --git a/src/CoverageReport/EnableCoverageReport.cmake b/src/CoverageReport/EnableCoverageReport.cmake index d8712b6..4a5c958 100644 --- a/src/CoverageReport/EnableCoverageReport.cmake +++ b/src/CoverageReport/EnableCoverageReport.cmake @@ -37,7 +37,10 @@ # Bielefeld University FUNCTION(_CoverageReport_SET_GCC_VERSION) - EXECUTE_PROCESS(COMMAND gcc -dumpversion OUTPUT_VARIABLE GCC_VERSION) + EXECUTE_PROCESS( + COMMAND bash -c "gcc --version | grep ^gcc | sed 's/^.* //g'" + OUTPUT_STRIP_TRAILING_WHITESPACE + OUTPUT_VARIABLE GCC_VERSION) STRING(REGEX MATCHALL "[0-9]+" GCC_VERSION_COMPONENTS ${GCC_VERSION}) LIST(GET GCC_VERSION_COMPONENTS 0 GCC_MAJOR) LIST(GET GCC_VERSION_COMPONENTS 1 GCC_MINOR) diff --git a/src/GMock/GMockConfig.cmake b/src/GMock/GMockConfig.cmake index 2078030..f982352 100644 --- a/src/GMock/GMockConfig.cmake +++ b/src/GMock/GMockConfig.cmake @@ -16,6 +16,8 @@ # # Usage: # +# # Optional, only if your usecase requires shared libs GMock +# set(GMOCK_BUILD_SHARED_LIBS ON) # find_package(GMock) # # ... @@ -25,21 +27,86 @@ # ${GTEST_BOTH_LIBRARIES} # ) # +# This also provides the following variables, with the version of the found gtest. +# These are both set as c/c++ definitions and cmake varables +# +# GTEST_VERSION_MAJOR +# GTEST_VERSION_MINOR +# GTEST_VERSION_PATCH +# # NOTE: Due to the way this package finder is implemented, do not attempt # to find the GMock package more than once. +macro(add_gtest_version_defines) + # get a gtest version string that the regex will match + pkg_check_modules(GTEST_PKGCONFIG "gtest") + if (GTEST_PKGCONFIG_FOUND) + set(GTEST_VERSION_STR ${GTEST_PKGCONFIG_VERSION}) + set(GTEST_DETECTION_METHOD "pkg-config") + elseif (DEFINED ENV{GTEST_VERSION}) + set(GTEST_VERSION_STR $ENV{GTEST_VERSION}) + set(GTEST_DETECTION_METHOD "GTEST_VERSION environment variable") + else() + message(WARNING "Could not detect GTest version, Assuming v${GTEST_VERSION_STR} (or compatible) and hoping for the best") + add_definitions(-DGTEST_VERSION_UNKNOWN) + set(GTEST_DETECTION_METHOD "best guess, could not detect") + endif() + + string(REGEX MATCH + "([0-9]+)\\.([0-9]+)\\.([0-9]+)" GTEST_VERSION_PARSED + ${GTEST_VERSION_STR}) + if (GTEST_VERSION_PARSED) + set(GTEST_VERSION_MAJOR ${CMAKE_MATCH_1}) + set(GTEST_VERSION_MINOR ${CMAKE_MATCH_2}) + set(GTEST_VERSION_PATCH ${CMAKE_MATCH_3}) + message("-- Using GTest v${GTEST_VERSION_MAJOR}.${GTEST_VERSION_MINOR}.${GTEST_VERSION_PATCH} (parsed from ${GTEST_DETECTION_METHOD})") + else() + # fallback to 1.8.0 + message(WARNING "Could not parse GTest version: ${GTEST_VERSION_STR} (${GTEST_DETECTION_METHOD}), Assuming v1.8.0 (or compatible) and hoping for the best") + set(GTEST_VERSION_MAJOR 1) + set(GTEST_VERSION_MINOR 8) + set(GTEST_VERSION_PATCH 0) + add_definitions(-DGTEST_VERSION_UNKNOWN) + endif() + + add_definitions(-DGTEST_VERSION_MAJOR=${GTEST_VERSION_MAJOR}) + add_definitions(-DGTEST_VERSION_MINOR=${GTEST_VERSION_MINOR}) + add_definitions(-DGTEST_VERSION_PATCH=${GTEST_VERSION_PATCH}) +endmacro() + find_package(Threads) +find_package(PkgConfig) -if (EXISTS "/usr/src/googletest") - # As of version 1.8.0 +if (EXISTS "/usr/src/googletest/googlemock" AND EXISTS "/usr/src/googletest/googletest") set(GMOCK_SOURCE_DIR "/usr/src/googletest/googlemock" CACHE PATH "gmock source directory") set(GMOCK_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/include" CACHE PATH "gmock source include directory") set(GTEST_INCLUDE_DIRS "/usr/src/googletest/googletest/include" CACHE PATH "gtest source include directory") -else() + set(GTEST_VERSION_STR "1.8.0") +elseif(EXISTS "/usr/src/gmock") + # fallback set(GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory") set(GMOCK_INCLUDE_DIRS "/usr/include" CACHE PATH "gmock source include directory") set(GTEST_INCLUDE_DIRS "/usr/include" CACHE PATH "gtest source include directory") + set(GTEST_VERSION_STR "1.7.0") +else() + # Try using CMake targets provided by GTest + find_package (GTest) + if(GTest_FOUND AND TARGET GTest::gmock) + set(GTEST_LIBRARIES GTest::gtest) + set(GTEST_MAIN_LIBRARIES GTest::gtest_main) + set(GMOCK_LIBRARIES GTest::gmock_main GTest::gmock) + set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) + + add_gtest_version_defines() + return() + endif() + + set(GMock_FOUND FALSE) + return() endif() +message("-- Using ${GMOCK_SOURCE_DIR}/ as gmock source directory") + +add_gtest_version_defines() # We add -g so we get debug info for the gtest stack frames with gdb. # The warnings are suppressed so we get a noise-free build for gtest and gmock if the caller @@ -47,45 +114,80 @@ endif() set(findgmock_cxx_flags "${CMAKE_CXX_FLAGS} -g -Wno-old-style-cast -Wno-missing-field-initializers -Wno-ctor-dtor-privacy -Wno-switch-default") set(findgmock_bin_dir "${CMAKE_CURRENT_BINARY_DIR}/gmock") -set(findgmock_gtest_lib "${findgmock_bin_dir}/gtest/libgtest.a") -set(findgmock_gtest_main_lib "${findgmock_bin_dir}/gtest/libgtest_main.a") -set(findgmock_gmock_lib "${findgmock_bin_dir}/libgmock.a") -set(findgmock_gmock_main_lib "${findgmock_bin_dir}/libgmock_main.a") + +if ("${GTEST_VERSION_MAJOR}.${GTEST_VERSION_MINOR}.${GTEST_VERSION_PATCH}" VERSION_LESS "1.8.1") + set(findgmock_gtest_libdir "${findgmock_bin_dir}/gtest") + set(findgmock_gmock_libdir "${findgmock_bin_dir}") +else() + set(findgmock_gtest_libdir "${findgmock_bin_dir}/lib") + set(findgmock_gmock_libdir "${findgmock_bin_dir}/lib") +endif() + +if (GMOCK_BUILD_SHARED_LIBS) + message(STATUS "Building GMock as shared libraries.") + set(findgmock_lib_suffix ".so") + set(findgmock_lib_type SHARED) +else() + set(findgmock_lib_suffix ".a") + set(findgmock_lib_type STATIC) +endif() + +set(findgmock_gtest_lib "${findgmock_gtest_libdir}/libgtest${findgmock_lib_suffix}") +set(findgmock_gtest_main_lib "${findgmock_gtest_libdir}/libgtest_main${findgmock_lib_suffix}") +set(findgmock_gmock_lib "${findgmock_gmock_libdir}/libgmock${findgmock_lib_suffix}") +set(findgmock_gmock_main_lib "${findgmock_gmock_libdir}/libgmock_main${findgmock_lib_suffix}") include(ExternalProject) ExternalProject_Add(GMock SOURCE_DIR "${GMOCK_SOURCE_DIR}" BINARY_DIR "${findgmock_bin_dir}" BUILD_BYPRODUCTS "${findgmock_gtest_lib}" "${findgmock_gtest_main_lib}" - "${findgmock_gmock_lib}" "${findgmock_gmock_main_lib}" + "${findgmock_gmock_lib}" INSTALL_COMMAND "" - CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}") + CMAKE_ARGS "-DCMAKE_CXX_FLAGS=${findgmock_cxx_flags}" -DBUILD_SHARED_LIBS=${GMOCK_BUILD_SHARED_LIBS}) -add_library(gtest INTERFACE) +add_library(gtest ${findgmock_lib_type} IMPORTED) +set_property(TARGET gtest PROPERTY IMPORTED_LOCATION ${findgmock_gtest_lib}) target_include_directories(gtest INTERFACE ${GTEST_INCLUDE_DIRS}) -target_link_libraries(gtest INTERFACE ${findgmock_gtest_lib} ${CMAKE_THREAD_LIBS_INIT}) +target_link_libraries(gtest INTERFACE ${CMAKE_THREAD_LIBS_INIT}) add_dependencies(gtest GMock) -add_library(gtest_main INTERFACE) +add_library(gtest_main ${findgmock_lib_type} IMPORTED) +set_property(TARGET gtest_main PROPERTY IMPORTED_LOCATION ${findgmock_gtest_main_lib}) target_include_directories(gtest_main INTERFACE ${GTEST_INCLUDE_DIRS}) -target_link_libraries(gtest_main INTERFACE ${findgmock_gtest_main_lib} gtest) +target_link_libraries(gtest_main INTERFACE gtest) -add_library(gmock INTERFACE) +add_library(gmock ${findgmock_lib_type} IMPORTED) +set_property(TARGET gmock PROPERTY IMPORTED_LOCATION ${findgmock_gmock_lib}) target_include_directories(gmock INTERFACE ${GMOCK_INCLUDE_DIRS}) -target_link_libraries(gmock INTERFACE ${findgmock_gmock_lib} gtest) +target_link_libraries(gmock INTERFACE gtest) -add_library(gmock_main INTERFACE) +add_library(gmock_main ${findgmock_lib_type} IMPORTED) +set_property(TARGET gmock_main PROPERTY IMPORTED_LOCATION ${findgmock_gmock_main_lib}) target_include_directories(gmock_main INTERFACE ${GMOCK_INCLUDE_DIRS}) -target_link_libraries(gmock_main INTERFACE ${findgmock_gmock_main_lib} gmock) +target_link_libraries(gmock_main INTERFACE gmock) set(GTEST_LIBRARIES gtest) set(GTEST_MAIN_LIBRARIES gtest_main) -set(GMOCK_LIBRARIES gmock gmock_main) +set(GMOCK_LIBRARIES gmock_main gmock) set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) +# Old names +set(GTEST_LIBRARY gtest) +set(GTEST_MAIN_LIBRARY gtest_main) +set(GMOCK_LIBRARY gmock) +set(GMOCK_MAIN_LIBRARY gmock_main) +set(GMOCK_BOTH_LIBRARIES gmock_main gmock) +# This used to be "${GTEST_BOTH_LIBRARIES} ${GMOCK_BOTH_LIBRARIES}", but +# I understand that you're not supposd to include gtest_main and gmock_main +# at the same time. +set(GTEST_ALL_LIBRARIES ${GTEST_LIBRARY} ${GMOCK_BOTH_LIBRARIES}) + unset(findgmock_cxx_flags) unset(findgmock_bin_dir) +unset(findgmock_lib_suffix) +unset(findgmock_lib_type) unset(findgmock_gtest_lib) unset(findgmock_gtest_main_lib) unset(findgmock_gmock_lib) diff --git a/src/GObjectIntrospection/GObjectIntrospectionConfig.cmake b/src/GObjectIntrospection/GObjectIntrospectionConfig.cmake new file mode 100644 index 0000000..2073c3c --- /dev/null +++ b/src/GObjectIntrospection/GObjectIntrospectionConfig.cmake @@ -0,0 +1,61 @@ +# - try to find gobject-introspection +# +# Once done this will define +# +# INTROSPECTION_FOUND - system has gobject-introspection +# INTROSPECTION_SCANNER - the gobject-introspection scanner, g-ir-scanner +# INTROSPECTION_COMPILER - the gobject-introspection compiler, g-ir-compiler +# INTROSPECTION_GENERATE - the gobject-introspection generate, g-ir-generate +# INTROSPECTION_GIRDIR +# INTROSPECTION_TYPELIBDIR +# INTROSPECTION_CFLAGS +# INTROSPECTION_LIBS +# +# Copyright (C) 2010, Pino Toscano, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +macro(_GIR_GET_PKGCONFIG_VAR _outvar _varname) + execute_process( + COMMAND ${PKG_CONFIG_EXECUTABLE} --variable=${_varname} gobject-introspection-1.0 + OUTPUT_VARIABLE _result + RESULT_VARIABLE _null + ) + + if (_null) + else() + string(REGEX REPLACE "[\r\n]" " " _result "${_result}") + string(REGEX REPLACE " +$" "" _result "${_result}") + separate_arguments(_result) + set(${_outvar} ${_result} CACHE INTERNAL "") + endif() +endmacro(_GIR_GET_PKGCONFIG_VAR) + +find_package(PkgConfig) +if(PKG_CONFIG_FOUND) + if(PACKAGE_FIND_VERSION_COUNT GREATER 0) + set(_gir_version_cmp ">=${PACKAGE_FIND_VERSION}") + endif() + pkg_check_modules(_pc_gir gobject-introspection-1.0${_gir_version_cmp}) + if(_pc_gir_FOUND) + set(INTROSPECTION_FOUND TRUE) + _gir_get_pkgconfig_var(INTROSPECTION_SCANNER "g_ir_scanner") + _gir_get_pkgconfig_var(INTROSPECTION_COMPILER "g_ir_compiler") + _gir_get_pkgconfig_var(INTROSPECTION_GENERATE "g_ir_generate") + _gir_get_pkgconfig_var(INTROSPECTION_GIRDIR "girdir") + _gir_get_pkgconfig_var(INTROSPECTION_TYPELIBDIR "typelibdir") + set(INTROSPECTION_CFLAGS "${_pc_gir_CFLAGS}") + set(INTROSPECTION_LIBS "${_pc_gir_LIBS}") + endif() +endif() + +mark_as_advanced( + INTROSPECTION_SCANNER + INTROSPECTION_COMPILER + INTROSPECTION_GENERATE + INTROSPECTION_GIRDIR + INTROSPECTION_TYPELIBDIR + INTROSPECTION_CFLAGS + INTROSPECTION_LIBS +) diff --git a/src/GdbusCodegen/GdbusCodegenConfig.cmake b/src/GdbusCodegen/GdbusCodegenConfig.cmake new file mode 100644 index 0000000..552a8d4 --- /dev/null +++ b/src/GdbusCodegen/GdbusCodegenConfig.cmake @@ -0,0 +1,36 @@ +cmake_minimum_required(VERSION 3.13) +if(POLICY CMP0011) + cmake_policy(SET CMP0011 NEW) +endif(POLICY CMP0011) + +find_program(GDBUS_CODEGEN NAMES gdbus-codegen DOC "gdbus-codegen executable") +if(NOT GDBUS_CODEGEN) + message(FATAL_ERROR "Executable gdbus-codegen not found") +endif() + +macro(add_gdbus_codegen outfiles name prefix service_xml) + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c" + COMMAND "${GDBUS_CODEGEN}" + --interface-prefix "${prefix}" + --generate-c-code "${name}" + "${service_xml}" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${ARGN} "${service_xml}" + ) + list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c") +endmacro(add_gdbus_codegen) + +macro(add_gdbus_codegen_with_namespace outfiles name prefix namespace service_xml) + add_custom_command( + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.h" "${CMAKE_CURRENT_BINARY_DIR}/${name}.c" + COMMAND "${GDBUS_CODEGEN}" + --interface-prefix "${prefix}" + --generate-c-code "${name}" + --c-namespace "${namespace}" + "${service_xml}" + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${ARGN} "${service_xml}" + ) + list(APPEND ${outfiles} "${CMAKE_CURRENT_BINARY_DIR}/${name}.c") +endmacro(add_gdbus_codegen_with_namespace) diff --git a/src/QmlPlugins/QmlPluginsConfig.cmake b/src/QmlPlugins/QmlPluginsConfig.cmake index d7b2876..63143b0 100644 --- a/src/QmlPlugins/QmlPluginsConfig.cmake +++ b/src/QmlPlugins/QmlPluginsConfig.cmake @@ -2,7 +2,7 @@ # target before loading this plugin. if(NOT TARGET qmlplugindump) - find_program(qmlplugindump_exe qmlplugindump) + find_program(qmlplugindump_exe qmlplugindump HINTS /usr/lib/qt5/bin/) if(NOT qmlplugindump_exe) message(FATAL_ERROR "Could not locate qmlplugindump.") diff --git a/src/Vala/ValaConfig.cmake b/src/Vala/ValaConfig.cmake new file mode 100644 index 0000000..a638735 --- /dev/null +++ b/src/Vala/ValaConfig.cmake @@ -0,0 +1,57 @@ +# - Find Vala +# This module looks for valac. +# This module defines the following values: +# VALA_FOUND +# VALA_COMPILER +# VALA_VERSION +# VAPI_GEN +# VAPI_GEN_VERSION + +#============================================================================= +# Copyright Přemysl Janouch 2011 +# All rights reserved. +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' +# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY +# OF SUCH DAMAGE. +#============================================================================= + +find_program (VALA_COMPILER "valac") + +if (VALA_COMPILER) + execute_process (COMMAND ${VALA_COMPILER} --version + OUTPUT_VARIABLE VALA_VERSION) + string (REGEX MATCH "[.0-9]+" VALA_VERSION "${VALA_VERSION}") +endif (VALA_COMPILER) + +find_program (VAPI_GEN "vapigen") + +if (VAPI_GEN) + execute_process (COMMAND ${VAPI_GEN} --version + OUTPUT_VARIABLE VAPI_GEN_VERSION) + string (REGEX MATCH "[.0-9]+" VAPI_GEN_VERSION "${VAPI_GEN_VERSION}") +endif (VAPI_GEN) + +include (FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS (Vala + REQUIRED_VARS VALA_COMPILER + VERSION_VAR VALA_VERSION) + +mark_as_advanced (VALA_COMPILER VALA_VERSION VAPI_GEN) +