Commit Graph

358 Commits

Author SHA1 Message Date
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
Martchus faaa40100c Allow using functions for adding desktop/appstream file independently 2022-10-08 21:55:24 +02:00
Martchus 353a74fa96 Avoid separating version parts with dots in DLL name
It looks better to not use dots here as a dot already separates the
extension.
2022-09-11 13:45:07 +02:00
Martchus 3a9a9c6f36 Apply cmake-format 2022-08-22 21:47:19 +02:00
Martchus 70e6ef4b7b Avoid redundant definition of appstream file path 2022-08-22 21:47:08 +02:00
Martchus 9141fcdfd8 Skip creation of desktop/appstream files if not building with GUI support 2022-08-20 18:13:08 +02:00
Martchus fea69428d1 Apply cmake-format 2022-08-11 23:29:37 +02:00
Martchus aa4be0ef70 Fix build errors with CMake 3.24.0
See note in comment; concrete example of build error (when building
syncthingtray against qtforkawesome built with CMake 3.24.0):

```
CMake Error at plasmoid/lib/CMakeLists.txt:15 (find_package):
  Found package configuration file:

    /usr/share/qtquickforkawesome-git/cmake/qtquickforkawesome-gitConfig.cmake

  but it set qtquickforkawesome-git_FOUND to FALSE so package
  "qtquickforkawesome-git" is considered to be NOT FOUND.  Reason given by
  package:

  The following imported targets are referenced, but are missing:
  qtforkawesome-git
```
2022-08-09 20:51:42 +02:00
Martchus c1e93738b6 Fix condition for avoiding `-static` flag
There's no `LINUX`; I suppose `UNIX` is specific enough as well.
2022-04-05 22:10:16 +02:00
Martchus 58c3506ca0 Add opt-out for enforcing static linkage (when generally aiming for static linkage) 2022-04-03 00:51:33 +02:00
Martchus 28a35e9673 Remove project name from headers dir if it already starts with it
This is useful if the repo contains headers in a directory called like the
project itself and should not have any effect on other projects.
2022-03-22 22:02:50 +01:00
Martchus f20ea87f32 Fix using arguments in `configure_test_target` 2021-11-02 17:49:28 +01:00
Martchus 9cbff29c9e Fix passing application path when invoking tests
We need to pass the application's path here; not the path of the test
itself.
2021-11-02 17:48:09 +01:00