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
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
23ca57740b
Apply cmake-format
2022-12-24 23:15:47 +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
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
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
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
072b7b5136
Apply cmake-format
2021-10-03 23:06:20 +02:00
Hannah Rittich
3730830880
Added namespace for file names
2021-10-02 21:08:10 +02:00
Martchus
9c9a47e551
Define `QT_STATICPLUGIN` when building static Qt plugins
...
This requirement is documented here:
https://doc.qt.io/qt-5/plugins-howto.html#creating-static-plugins
2021-09-16 18:36:35 +02:00
Martchus
3a52ae5e22
Prevent attempt to strip import lib for static plugin
2021-09-16 01:05:41 +02:00
Martchus
48c7906bf6
Do not export include dirs for plugins
...
Plugins don't have headers and the non-existant
include directory leads otherwise to configuration
errors when trying to link against a static plugin.
2021-09-16 01:04:19 +02:00
Martchus
1b6ffb561a
Fix locating files which are directly under the data dir (and not in the cmake dir)
2021-08-25 19:38:43 +02:00
Martchus
b3ebe5ce38
Fix typos found via `codespell --skip .git -w`
2021-07-03 19:07:49 +02:00
Martchus
d1e3a28277
Apply cmake-format
2021-01-08 00:51:49 +01:00
Martchus
cabcc11d3e
Incorporate extra target suffix used when targeting MinGW in pkg-config file
2021-01-08 00:43:51 +01:00
Martchus
7fb2a9ed73
Avoid duplicating the `lib` prefix in the pkg-config file
...
This is in accordance with omitting the `lib` prefix of the target if the
project name already starts with `lib`.
2021-01-08 00:39:08 +01:00
Martchus
0be639ea97
Use `-lfoo` form in pkg-config file if dependency doesn't look like a path
...
So e.g. `-lpthread` is added to the pkg-config file instead of just
`pthread`.
2021-01-08 00:37:14 +01:00
Martchus
b1b0c10366
Prevent reading library properties from interface library targets
2021-01-07 20:06:12 +01:00
Martchus
9fb3bbe179
Export a target for using only headers of a library
...
Some backend libraries of Syncthing Tray and Reflective RapidJSON only use
certain headers of qtutilities/c++utilities. The current solution did not
really work because it did not distinguish between the build and install
interface and also did not take compile definitions and options into
account.
2021-01-01 18:42:22 +01:00
Martchus
47f7252bc0
Remove leftover message from debugging
2021-01-01 18:35:49 +01:00
Martchus
8a9d72bee9
Disable linking against default Qt plugins
...
This change would obviously better go into qtutilities. However, it is
easier done here and doesn't pull in any dependency on Qt anyways.
2020-12-20 17:53:37 +01:00
Martchus
a40ee3aa7e
Use query_qmake_variable_path if available
2020-11-11 18:51:50 +01:00
Martchus
e2f170ddd5
Fix install-mingw-w64-strip (and underlying targets)
...
* Fix escaping issues with Ninja
* Use `$<TARGET_LINKER_FILE_NAME:tgt>` to avoid hard-coding
library extensions
2020-10-10 16:45:58 +02:00
Martchus
98e6f360af
Apply cmake-format
2020-10-10 01:07:06 +02:00
Martchus
0b267c7959
Avoid duplicating the "lib" prefix
...
if the target name already starts with "lib"
2020-09-23 22:48:28 +02:00
Martchus
84011c2768
Apply CMake format
2020-07-07 12:14:05 +02:00
Martchus
d0076e24a7
Get rid of WINDOWS_EXT completely as it is now no longer used
2020-07-04 15:21:55 +02:00
Martchus
b03332f37a
Add "SOVERSION" as suffix to shared libraries for mingw-w64 targets
...
* Also enable the "lib" prefix which CMake would add by default again; it
has only been removed to preserve compatibility with qmake when switching
from qmake to CMake
* None of these changes are enabled by default to preserve compatibility
2020-07-04 14:43:26 +02:00
Martchus
fe5dc5e6a7
Apply cmake-format 0.6.10
2020-04-27 22:59:06 +02:00
Martchus
e241d718ce
Apply cmake-format
2020-03-05 19:05:33 +01:00
Martchus
2b3adc3a6f
Don't prefix CMAKE_INSTALL_DATAROOTDIR; it might be absolute
...
Same as https://github.com/Martchus/cpp-utilities/issues/18 but for
the share directory.
2020-02-14 22:29:07 +01:00
Martchus
e9803a41dc
Fix inconsistent variables for compile options/definitions
...
So these options/definitions should no longer be missing in some
places, e.g. the pkg-config file.
2020-02-14 13:22:47 +01:00
Martchus
4dd2179f19
Fix remaining install dirs to use GNUInstallDirs consistently
2020-02-13 11:32:28 +01:00
Martchus
b2a2773cdf
Support passing absolute path to CMAKE_INSTALL_INCLUDEDIR
...
See https://github.com/Martchus/cpp-utilities/issues/18
2020-02-13 11:19:36 +01:00
Martchus
dcb1d896c2
Apply cmake-format
2020-02-04 15:24:13 +01:00
Martchus
c97dfbfd4c
Use GNUInstallDirs
...
See https://github.com/Martchus/cpp-utilities/issues/17
2020-02-01 00:01:26 +01:00
Martchus
f5e275288d
Reformat CMake files with cmake-format 0.6.7
2020-01-26 19:24:04 +01:00
Martchus
a9cb91bee2
Set default visibility explicitely to hidden
...
Hidden default visibility is already expected to be handled by
users of the library because it is the default under Windows.
2020-01-10 18:05:55 +01:00
Martchus
1ce06517cc
Apply cmake-format 0.6.5
2019-12-27 01:45:30 +01:00
Martchus
3fb40baebc
Reformat CMake scripts against cmake-format 0.6.3
2019-12-15 18:58:42 +01:00
Martchus
6376819c07
Apply cmake-format v0.6.0
2019-11-30 17:58:01 +01:00
Martchus
ea2804f147
Allow user to append custom libs to linker line
...
Use-case is explained in the documentation. This implementation
takes care that the additional libs actually occur at the end
of the linker line despite the use of imported targets with
INTERFACE_LINK_LIBRARIES. It might still not be perfect but
sufficient for current use-cases.
2019-08-24 13:00:32 +02:00
Martchus
f9e545abdc
Remove surplus whitespace
2019-08-21 22:31:04 +02:00
Martchus
e14b5bf335
Remove unused CMake variable
2019-08-20 22:08:47 +02:00
Martchus
99bc257755
Apply cmake-format
2019-08-06 00:02:38 +02:00
Martchus
de2d6f6d98
Improve pkg-config file generation
...
* Prevent imported library paths pointing to build directory
ending up in pkg-config file
* Handle targets which reference other targets but have not pkg-config
module
* Fix check for BUNDLED_TARGETS
2019-08-05 23:45:08 +02:00
Martchus
79855f285d
Improve pkg-config file generation
...
* Don't refer to bundles libraries via its imported location
* Add dependencies of imported targets
2019-08-05 19:07:49 +02:00