Commit Graph

370 Commits

Author SHA1 Message Date
Martchus a43affa81a Avoid `global.h` changing depending on target prefix/suffix
Just using the project name should be sufficient and this avoid `global.h`
from changing when a different target prefix/suffix is used.
2024-02-22 19:41:15 +01:00
Martchus bc00bdcdc9 Apply cmake-format 2024-01-30 22:38:52 +01:00
Martchus a7fdc1af1b Allow writing public compile definitions to a header file
This is useful as it makes consuming libraries less dependent on using the
CMake module or pkg-config file correctly. This should especially decrease
the likelihood of running into linker errors when consuming a static build
of the libraries where e.g. `CPP_UTILITIES_STATIC` needs to be defined.
2024-01-30 22:13:25 +01:00
Martchus 27043d2be0 Fix typo in comment 2024-01-30 00:44:54 +01:00
Martchus 995c315377 Allow semicolons in categories and additional entries for desktop file
Pass these variables as multi-value arguments to get more than just the
part before the first semicolon.
2024-01-27 02:54:27 +01:00
Martchus d08794b11d Allow setting `DESKTOP_FILE_ADDITIONAL_ENTRIES` manually 2024-01-27 02:51:41 +01:00
Martchus 8d460380f1 Apply cmake-format 2023-12-05 11:42:42 +01:00
Martchus 35f56d486c Fix enabling AppStream tests 2023-11-30 19:44:08 +01:00
Martchus b1f89d78c3 Allow building without CppUnit-based tests 2023-11-25 23:14:36 +01:00
Martchus 8fb7de6fe0 Enable AppStream tests only by default via `ENABLE_DEVEL_DEFAULTS`
This test already fails on deprecations so it is likely not a good idea to
run it in general as it would cause needless failures.
2023-11-22 12:59:40 +01:00
Martchus a1bed55eda Enable tidy tests only by default via `ENABLE_DEVEL_DEFAULTS`
This test is only relevant for development. Additionally, the behavior of
clang-format differs slightly between versions so this can really cause
needlessly failures.
2023-11-22 12:57:59 +01:00
Martchus 05570c5c71 Improve status messages about CXX11-ABI 2023-11-22 12:54:04 +01:00
Martchus 762131acf9 Fix AppStream validation tests 2023-11-14 02:14:26 +01:00
Martchus 7dff72d0bd Apply cmake-format 2023-10-15 16:57:29 +02:00
Martchus 938da48da0 Skip configuration of tests unless `BUILD_TESTING` is set
See https://github.com/Martchus/tagparser/issues/26
and https://cmake.org/cmake/help/latest/module/CTest.html
2023-09-16 22:01:32 +02:00
Martchus 18d92fee40 Fix typo in CLI wrapper code 2023-08-18 22:55:42 +02:00
Martchus c4024ce00e Avoid CMake deprecation warning by bumping version 2023-07-23 21:18:25 +02:00
Martchus 7bcc66be0d Avoid warning "current scope has no parent" 2023-07-06 00:50:45 +02:00
Martchus 5ebbd0eb3f Improve logic for finding CppUnit
* Avoid forcefully setting cache variables; use a normal variable
  instead
* Use the imported target generated from the pkg-config which hopefully
  works better than using the variables directly
* Avoid warning when the find module was used; this is the case for
  vcpkg and there the provided CppUnit library is good enough
2023-07-05 14:18:32 +02:00
Martchus 30cefc2fd3 Add version details to config header 2023-06-17 22:53:48 +02:00
Martchus 831c083e5f Add flags for static linkage when building CLI wrapper as well
Otherwise the wrapper might depend on `libgcc` or `libstdc++` on builds
that link against these libraries otherwise statically. Not sure why this
is only an issue on 32-bit builds. (The different exeption handling can
only explain `libgcc` but not `libstdc++`.)
2023-06-10 18:29:18 +02:00
Martchus 3bec473775 Enable clang-format and cmake-format only by default if present
Enabling both depending on `ENABLE_DEVEL_DEFAULTS` limits the usefulness of
`ENABLE_DEVEL_DEFAULTS` because it can then only be used of both tools are
installed (and especially `cmake-format` might not be installed). It makes
more sense to simply enable those targets depending on whether the tools
are installed or not. If they are explicitly enabled it is still a hard
error if the tools cannot be found.
2023-06-10 16:41:07 +02:00
Martchus 0057e49a0d Fix linking against static OpenSSL on GNU/Linux
Judging by the code the CMake find module actually attempts to cover this
case but it doesn't seem to work in practice - at least not when there are
only static libs and thus we find those static libs without explicitly
specifying `OPENSSL_USE_STATIC_LIBS`.
2023-06-07 23:58:49 +02:00
Martchus a19ee41a39 Apply cmake-format and clang-format 2023-05-16 21:39:10 +02:00
Martchus 0d0685d4c7 Simplify workaround for starting console and CLI-wrapper
* Disable workaround by default; with the CLI-wrapper available it makes no
  sense to run this code unnecassarily when the main executable is invoked
    * Remove check for Mintty; with the workaround disabled by default it
      is no longer necassary to avoid it
* Simplify the CLI-wrapper to rely on main application for enabling UTF-8
  and virtual terminal processing as it relies on it for attaching to the
  parent's console anyways
2023-05-09 00:16:28 +02:00
Martchus c6396f92fc Ignore warnings for use of legacy CRT functions when compiling with MSVC for now
There's no warning about these when compiling for other targets so let's
ignore them for now.
2023-05-07 21:52:06 +02:00
Martchus c60584e122 Allow compilation of Windows resource file when using MSVC as well 2023-05-07 21:34:46 +02:00
Martchus f3cb406ebe Add CLI-wrapper for Windows
Starting the console from a GUI application is not working very
well - so let's just provide a 2nd executable for the CLI. It
will be a simple console application that merely invokes the main
application passing all standard I/O. Unfortunately this does not
mean the existing hacks can be removed. Without them the wrapper
still doesn't get any I/O from the GUI application.
2023-05-07 21:32:21 +02:00
Martchus bcd5816d23 Apply clang-format and cmake-format 2023-03-25 18:52:13 +01:00
Martchus 7a5a02976a Fix symbol visibility when building Android apps 2023-03-19 20:02:32 +01:00
Martchus 65b86d71f6 Set QT_ANDROID_VERSION_NAME for Android target 2023-03-11 19:59:09 +01:00
Martchus 2a9949ce77 Tweak app target creation for Android deployment via Qt 6 helpers 2023-03-11 17:04:41 +01:00
Martchus 2b6f26895d Support multiple source directories in `srcdirref` file
* Locate test files in all source directories specified in `srcdirref`
* Allow overriding contents of `srcdirref` so the directory of another
  component (within the same repository) can be appended to share testfiles
2023-02-27 18:29:31 +01:00
Martchus 7d6fc9721a Apply clang-format/cmake-format 2023-02-03 13:31:18 +01:00
Martchus b9b8bfc62a Fix and improve code for finding CppUnit
* Remove `FORCE` in initialization of cache variables as this makes the
  library/include dir effectively *not* configurable
* Try using `find_package()` as the vcpkg package provides a CMake module
2023-01-31 22:37:06 +01:00
Martchus da830dcef5 Apply clang-format and cmake-format 2023-01-28 20:20:47 +01:00
Martchus b6fa13f8dd Use C++ 20 when compiling with MSVC as it requires it for designated initializers 2023-01-26 22:23:46 +01:00
Martchus 81618a3468 Expose package version via `use_package` function 2023-01-22 23:01:10 +01:00
Martchus 23ca57740b Apply cmake-format 2022-12-24 23:15:47 +01:00
Martchus c48816b243 Move CMake code for enabling warnings into separate module and function 2022-12-24 23:15:24 +01:00
Martchus d9eb99fca1 Allow to keep CMake's CXX_STANDARD property empty
This can be useful to e.g. specify the standard manually or to just stick
to the compiler's default.
2022-12-23 20:52:00 +01:00
Martchus 1aba9f5f6f Allow setting Windows/MacOS icon paths to avoid conversion
This makes it possible to have an own version of the icon for those
platforms instead of relying on an automatic conversion from the generic
PNG icon.
2022-12-22 23:28:05 +01:00
Martchus 913b6e7d65 Apply CMake format 2022-10-16 15:04:52 +02:00
Martchus e502269d50 Run cmake-format on tests specified via `QT_TESTS` variable 2022-10-16 15:04:38 +02:00
Martchus 3f072549a6 Detect whether GPL license version is "-or-later" automatically 2022-10-13 00:03:04 +02:00
Martchus aa31d441d7 Avoid guessing release data for AppStream file, rely on explicit meta-data 2022-10-12 22:55:56 +02:00
Martchus 804852b95e Do not exclude appstream validation from checks as errors should be handled 2022-10-11 21:03:17 +02:00
Martchus d05677e3b5 Prevent AppStream validation error `asv-release-time-missing`
* Avoid hard-coding and additional steps in the release workflow by simply
  considering the day of the last modification the release date
* See https://github.com/Martchus/syncthingtray/issues/158
2022-10-11 21:00:16 +02:00
Martchus da431580d4 Prevent AppStream validation error `asv-cid-desktopapp-is-not-rdns`
See https://github.com/Martchus/syncthingtray/issues/158
2022-10-11 20:58:21 +02:00
Martchus 4a7a9ec32d Add build system check to validate appstream files
* Exclude new tests from `check` target for now as they are currently
  failing
* See https://github.com/Martchus/syncthingtray/issues/158
2022-10-11 19:25:17 +02:00