Commit Graph

353 Commits

Author SHA1 Message Date
7bcc66be0d Avoid warning "current scope has no parent" 2023-07-06 00:50:45 +02:00
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
30cefc2fd3 Add version details to config header 2023-06-17 22:53:48 +02:00
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
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
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
a19ee41a39 Apply cmake-format and clang-format 2023-05-16 21:39:10 +02:00
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
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
c60584e122 Allow compilation of Windows resource file when using MSVC as well 2023-05-07 21:34:46 +02:00
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
bcd5816d23 Apply clang-format and cmake-format 2023-03-25 18:52:13 +01:00
7a5a02976a Fix symbol visibility when building Android apps 2023-03-19 20:02:32 +01:00
65b86d71f6 Set QT_ANDROID_VERSION_NAME for Android target 2023-03-11 19:59:09 +01:00
2a9949ce77 Tweak app target creation for Android deployment via Qt 6 helpers 2023-03-11 17:04:41 +01:00
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
7d6fc9721a Apply clang-format/cmake-format 2023-02-03 13:31:18 +01:00
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
da830dcef5 Apply clang-format and cmake-format 2023-01-28 20:20:47 +01:00
b6fa13f8dd Use C++ 20 when compiling with MSVC as it requires it for designated initializers 2023-01-26 22:23:46 +01:00
81618a3468 Expose package version via use_package function 2023-01-22 23:01:10 +01:00
23ca57740b Apply cmake-format 2022-12-24 23:15:47 +01:00
c48816b243 Move CMake code for enabling warnings into separate module and function 2022-12-24 23:15:24 +01:00
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
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
913b6e7d65 Apply CMake format 2022-10-16 15:04:52 +02:00
e502269d50 Run cmake-format on tests specified via QT_TESTS variable 2022-10-16 15:04:38 +02:00
3f072549a6 Detect whether GPL license version is "-or-later" automatically 2022-10-13 00:03:04 +02:00
aa31d441d7 Avoid guessing release data for AppStream file, rely on explicit meta-data 2022-10-12 22:55:56 +02:00
804852b95e Do not exclude appstream validation from checks as errors should be handled 2022-10-11 21:03:17 +02:00
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
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
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
faaa40100c Allow using functions for adding desktop/appstream file independently 2022-10-08 21:55:24 +02:00
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
3a9a9c6f36 Apply cmake-format 2022-08-22 21:47:19 +02:00
70e6ef4b7b Avoid redundant definition of appstream file path 2022-08-22 21:47:08 +02:00
9141fcdfd8 Skip creation of desktop/appstream files if not building with GUI support 2022-08-20 18:13:08 +02:00
fea69428d1 Apply cmake-format 2022-08-11 23:29:37 +02:00
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
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
58c3506ca0 Add opt-out for enforcing static linkage (when generally aiming for static linkage) 2022-04-03 00:51:33 +02:00
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
f20ea87f32 Fix using arguments in configure_test_target 2021-11-02 17:49:28 +01:00
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
11574209b3 Add experimental support for generating coverage report via gcc/gcov/lcov 2021-11-01 18:20:51 +01:00
37c2b920d0 Remove obsolete check when configuring coverage with Clang
Building shared and static libraries at the same time has been removed as
of version 5 so this message would never be printed and it is not clear
anymore what the actual problem was.
2021-11-01 14:10:22 +01:00
5563776061 Expose test name (created via TestTarget.cmake) for fixing downstream bug
This allows to set test properties in other projects as needed to fix
https://github.com/Martchus/syncthingtray/issues/116.
2021-10-12 23:38:54 +02:00
5509caff89 Remove unused META_CONFIG_PREFIX
This variable was never actually used. I suppose I've been adding it for
places where the config should be added as a prefix. However, this would be
inconsistent and now would also mean a confusing overlap with the
namespacing feature. So let's just remove it.
2021-10-03 23:11:14 +02:00
072b7b5136 Apply cmake-format 2021-10-03 23:06:20 +02:00