Commit Graph

104 Commits

Author SHA1 Message Date
Adriaan de Groot
2609e05898 CMake: remove unused module 2020-08-26 00:31:16 +02:00
Adriaan de Groot
c19866f887 [libcalamares] Add a module-weight to the module descriptor 2020-08-12 16:00:27 +02:00
Adriaan de Groot
f7102527a8 CMake: stop clobbering config files
When CMake runs, configure_file() will clobber the config files in
the build/ directory, which is annoying during testing: you need
to keep making the same edits, or edit the source.

- Introduce new behavior: the config file is **not** overwritten unless
  the source file is newer. This means that edits to config files
  in the build directory are preserved.
- If INSTALL_CONFIG is **on** then the files are clobbered anyway (the
  source is considered new regardless).
2020-08-05 00:51:08 +02:00
Adriaan de Groot
a8c4f5b758 CMake: fix up warnings from the LibPWQuality module
- don't include other find modules
- pkgconfig isn't totally necessary, it might work without
2020-08-04 23:09:51 +02:00
Adriaan de Groot
afb0b36f58 CMake: simplify QRC generation
Use configure_file() to avoid stomping on timestamps: if the list
of translations doesn't change, we don't need to rebuild the
translated QRC.
2020-07-29 10:07:57 +02:00
Adriaan de Groot
bfa1f618c7 CMake: Improve RCC version-checking
Previously, we check for RCC support every single time CMake runs.
This is slightly wasteful, and it wasn't being done right anyway.
But it's moot because:

- Calamares supports back to Qt 5.9
- Qt 5.9's version of rcc (at least, 5.9.7) **does** support the
  command-line argument `--format-version 1`
- Everything newer does too.

Simplify translations a little, too: just use autorcc rather than
building things by hand.
2020-07-29 10:05:01 +02:00
Adriaan de Groot
23810aae3d CMake: switch to autorcc from manual futzing 2020-07-24 11:29:47 +02:00
Adriaan de Groot
37ce49b001 CMake: stop overwriting branding settings in the build dir
- Only copy over branding files if they are newer

Typically I have KDevelop open while working on Calamares; if I
am editing settings in `branding.desc` in the build directory,
then every time KDevelop runs CMake in the background, my
changes (for testing branding things!) would be overwritten.
Don't do that.

For normal builds with a clean build directory, this doesn't change
anything since the target is missing; changing a file in the
source directory **will** copy it over the build directory version.
2020-07-07 14:11:16 +02:00
Adriaan de Groot
f218e2e9a6 CMake: handle Python modules built from subdirectory a/b 2020-06-12 12:05:35 +02:00
Adriaan de Groot
73f8c627bd CMake: support out-of-tree builds
- The variables that are set for out-of-tree builds are prefixed
  with  to avoid name clashes; make the module-infrastructure
  respect those instead of the in-tree variable names.
- .. and then duplicate the in-tree variables to the out-of-tree
  variables, so we only need one set of module instructions.
2020-06-12 11:35:23 +02:00
Adriaan de Groot
e6fe19df20 CMake: remove unused link libraries
- Nothing ever sets LIBRARY_QT5_MODULES (it would be a macro
  argument to calamares_add_library, if anything).
2020-06-10 01:38:27 +02:00
Adriaan de Groot
dc16afac4a CMake: massage IMPORTED targets and module path
- Add the Calamares CMake-modules to the search path automatically
- Export to CalamaresTargets.cmake and use namespace Calamares::
- Document imported targets
- Find Qt, because the translations machinery will need macros from that
- The installed lib links to IMPORTED libraries from KF5, so we need
  to find them (again) as well.
2020-06-10 01:37:54 +02:00
Callum Farmer
0d4642ca6a [CMakeModules] Update SPDX identifiers.
Update CalamaresAddTest.cmake

Update CalamaresAddLibrary.cmake

Update CalamaresAddBrandingSubdirectory.cmake

Update CalamaresAddTranslations.cmake

Update CalamaresAddPlugin.cmake

Update CalamaresAddModuleSubdirectory.cmake
2020-06-03 12:28:58 +01:00
Adriaan de Groot
c3d8112187 CMake: allow fine-tuning tests
- The Python configuration tests sometimes need extra setup, so
  do that through a CMakeTests.txt file in the test directory.
- Patch up existing tests:
  - grubcfg needs /tmp/calamares/etc/default to exist
  - rawfs won't work on FreeBSD because of differences in /proc
2020-05-15 14:38:45 +02:00
Adriaan de Groot
1ae38c8ebc CMake: add tests when there are test-configs
- If a module has tests/#.global or tests/#.job, these are used
  as arguments to a test-run of loadmodule (which reads them
  and runs the module with that configuration).
- This makes the old python-loading test and test-runner entirely
  obsolete, so remove them too.
2020-05-08 21:53:39 +02:00
Adriaan de Groot
0aaf24c4a5 CMake: tell tests where their source-dir is
- Abuse BUILD_AS_TEST to pass in the value as a string
2020-03-23 17:18:44 +01:00
Adriaan de Groot
fba1bf7072 CMake: add DEFINITIONS option to calamares_add_test
- There's a handful of tests that need this, it's possible
  there will be more, so just add it to the infrastructure.
2020-02-19 22:26:55 +01:00
Adriaan de Groot
6f996d8eed CMake: give yamlcpp a proper imported target
- This makes linking easier,
 - Adds the right includes (needed on FreeBSD),
 - Lets us drop silly GUI setting for non-GUI tests (I think this was
   a side-effect of compiling on FreeBSD, where UI would pull in
   /usr/local/include).
2020-02-17 14:55:12 +01:00
Adriaan de Groot
4495a4c739 CMake: Allow extra libraries in calamares_add_test
- Extra libraries specified via LIBRARIES part of CMake function
 - Convert all the other module tests
2020-02-17 14:36:52 +01:00
Adriaan de Groot
6bdc4a55de CMake: new convenience module CalamaresAddTest 2020-02-17 12:02:53 +01:00
Adriaan de Groot
96946a8447 Merge branch 'fix-unpackfs-progress'
This is an ugly hack, using Bill Auger's support for Job weights.
The unpackfs job is arbitrarily awarded a weight of 12. That makes it
(in a Netrunner install) use progress from 12% to 40% or so, overall,
as all the files are unpacked.

Also fixes bug reported by Kevin Kofler that unpackfs was only reporting
progress when it hit an exact multiple of 100 (instead of over 100).

SEE #1176
2020-01-25 11:53:31 +01:00
Adriaan de Groot
b0b9073b40 CMake: fix boost.python detection on FreeBSD 2020-01-25 02:45:52 +01:00
Adriaan de Groot
5ad73681c2 CMake: actually write the NO_CONFIG setting 2020-01-24 20:58:23 +01:00
Adriaan de Groot
fbb452f9bf CMake: add support for NO_CONFIG
- A C++ module should set NO_CONFIG to flag that it doesn't have a
   config file (this is an error if it secretly **does** have one)
2020-01-20 19:27:34 +01:00
Adriaan de Groot
8fc94900d3 CMake: add the tz_ translation files to the i18n build 2019-12-11 06:39:57 -05:00
Adriaan de Groot
4652df0643 CMake: allow required modules in calamares_add_plugin
- Add a REQUIRES keyword
 - Write out values to the descriptor
 - Add some documentation for the function as a whole
2019-08-01 12:36:40 +02:00
Adriaan de Groot
63d1378721 CMake: need to create dir before copying to it 2019-06-17 15:17:29 +02:00
Adriaan de Groot
a08e764467 CMake: add compiled branding translations to build dir
- Copy the .qm files (compiled translations) into the build
   dir as part of the build process. This is independent of
   **installing** those same translations, but does allow
   the translations to be used by Calamares when run from the
   build dir for testing.
2019-06-16 23:38:44 +02:00
Adriaan de Groot
ba7ee445c6 CMake: switch to using autouic on plugins
- Use autouic so that we can also pass in --include to add
   a code-warning-suppression to the generated code, just like
   we can do with moc.
2019-05-13 14:52:26 +02:00
Kevin Kofler
fa9aeb4a5d CMake: Fix BoostPython3.cmake for Fedora >= 30
CMakeModules/BoostPython3.cmake: Also try e.g. "python37" as the module
name, because Fedora 30 switched from the e.g. "python-py37" format to
that. Otherwise, Boost::Python3 cannot be found on Fedora without
manually setting CALAMARES_BOOST_PYTHON3_COMPONENT.
2019-05-05 21:53:23 +02:00
Adriaan de Groot
c9447d7794 CMake: add test for python modules
- Only Python modules have a loadmodule-test added. This will call
   run(), but with an empty configuration it should be a no-op.
2019-04-28 09:06:10 -04:00
Adriaan de Groot
1e391bda7e CMake: document intention to run more tests on modules
- Loading the module will check Python modules for syntax,
   and C++ modules for symbols. This would be a good idea,
   except for where it calls exec() and does things to the
   running system. Most modules are harmless with an empty
   config, but you never know (e.g. a process module).
2019-04-27 11:58:29 -04:00
Adriaan de Groot
6f9548af34 CMake: Check module interfaces
- Only allow meaningful interface strings
 - Improve documentation of which interfaces work for
   which module types.
2019-04-27 11:30:16 -04:00
Adriaan de Groot
bdb7bf71a8 Reduce warnings from moc-generated code
- The auto-generated code produces a lot of warnings from
   Clang 8; this obscures the more meaningful warnings from
   actual Calamares code, so tone the warnings down.
 - For Clang, set CALAMARES_MOC_OPTIONS.
 - Add convenience CMake function for automoccing. It applies
   the options as needed to a given target.
2019-04-18 12:06:09 +02:00
Adriaan de Groot
d7594860b0 CMake: fix calamares_add_library
- Remove the commented-out cruft and the whinging
 - Fix use of COMPILE_DEFINITIONS with a list passed in
 - Remove unused arguments (TYPE, TARGET)
 - Document calamares_add_library
 - Document how to use COMPILE_DEFINITIONS (in calamares_add_plugin)
2019-03-20 11:26:02 +01:00
Adriaan de Groot
82c51dec37 CMake: don't change cmake logging on release builds
- There is no real need to reduce the logging on release builds,
   it's just confusing that all the cmake-time output changes
   in a non-meaningful way.
2018-09-14 05:33:04 -04:00
Adriaan de Groot
4602b30264 [libcalamaresui] Use PYTHONQT_INCLUDE_DIRS
- document new variable from the CMake module
 - use it in libcalamaresui to simplify #include'ing the
   header for the "all" extension.

Suggested by Denis Proskurin.
2018-09-03 06:26:26 -04:00
Adriaan de Groot
54bee71b44 CMake: Search for PythonQt_QtAll.h
Suggested by Denis Proskurin.
2018-09-03 06:20:44 -04:00
Adriaan de Groot
9651c588bc CMake: Search for PythonQt headers in more places.
Suggested by Denis Proskurin.
2018-09-03 05:34:23 -04:00
Adriaan de Groot
2f6e80dc42 CMake: always copy the config files to the build directory.
Switching to INSTALL_CONFIG=OFF breaks tests by not having them
in the build directory. Some logic was coupling not-installing
to not-using-in-build-dir too closely.
2018-06-28 04:39:12 -04:00
Adriaan de Groot
d325366e92 CMake: fix plugin NO_INSTALL keyword
Although the NO_INSTALL keyword could be specified for
Calamares plugins, it didn't actually do anything. Now
it does. A NO_INSTALL module does not install configs
or libraries.
2018-06-15 07:19:02 -04:00
Adriaan de Groot
def459a29d [libcalamaresui] Read emergency setting from module.desc
- Read setting from the module descriptor
 - Document optional settings
 - Add EMERGENCY keyword to the CMake helper functions
2018-06-15 07:11:17 -04:00
Adriaan de Groot
0ffb6ed67c CMake: fix checks for supported rcc format versions 2018-06-14 06:41:08 -04:00
Adriaan de Groot
7eae99223e CMake: check if rcc supports --format-version
- The new format was introduced in Qt 5.7, and Qt 5.9 introduced
   the --format-version flag to rcc to switch back to the reproducible
   format 1. For distro's with Qt 5.7, don't use the new flag.
 - Reported from Neptune Linux, #979
2018-06-14 06:11:39 -04:00
Adriaan de Groot
733836839a CMake: remove module that duplicates what is in CMake proper 2018-05-17 12:00:06 +02:00
Adriaan de Groot
ace30e149a CMake: fix defaults-handling which was breaking in-tree build 2018-03-16 11:51:50 -04:00
Adriaan de Groot
abe05ac8ab CMake: document add_branding_subdirectory()
- add feature to allow (re)naming and to support greater
   directory depths.
2018-03-14 09:12:27 -04:00
Adriaan de Groot
b95fe2227f CMake: remove debugging from macro 2018-03-14 08:54:55 -04:00
Adriaan de Groot
d4f0be02d3 i18n: make build reproducible
The RCC output files in version 2 contain a timestamp of the
source file, which changes per build. Drop down to version 1,
which just removes the timestamp.

See reproducible builds note 'timestamps in source generated by rcc'.

FIXES #917
2018-03-12 09:09:29 -04:00
Adriaan de Groot
42ba505ceb CMake: add license headers, copyright
Since we install the CMake files now, also put license headers in them.
These files are intended to help plugin and branding component authors
write them in a simple Calamares-idiomatic way.
2018-03-09 11:13:42 -05:00