Commit Graph

108 Commits

Author SHA1 Message Date
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
Martchus 3d47869bcd Use META_PLUGIN_CATEGORY within build directory
The *.so file might not be found when not in the right
subdirectory.
2019-07-26 22:01:00 +02:00
Martchus 7249751d30 Apply clang-format and cmake-format 2019-06-16 16:54:26 +02:00
Martchus 869a3b2ae2 Don't try to install Qt plugins outside of the install prefix
Even if QMake tells us that would be the right location because
it breaks development setups which use a custom install prefix
and set QT_PLUGIN_PATH accordingly.
2019-06-16 16:54:00 +02:00
Martchus fc9e1ff703 Add version header to libraries 2019-06-16 15:33:10 +02:00
Martchus 5607691251 Deal with "bundled" dependencies
* Allow exporting targets from 3rd party projects which are
  built within my own projects. This is required if the build
  scripts of these 3rd party projects don't have an export on
  their own but are used in the public interface or as a dependency
  of a static library.
* Add those libraries to the pkg-config file as well.
2019-06-15 15:30:56 +02:00
Martchus 6c9a956a4f Apply cmake-format 2019-06-10 22:43:42 +02:00
Martchus bfdd6ada2b Disable mingw-w64 packaging specific code by default 2019-06-01 16:32:21 +02:00
Martchus bc0d7af67f Apply cmake-format 0.5.1
* Disable autosort as it messes with add_library and
  add_executable calls
2019-06-01 12:14:30 +02:00
Martchus e120a897c5 Add use_package to 3rdParty 2019-05-30 14:04:04 +02:00
Martchus a865522e67 Use existing TARGET_INCLUDE_DIRECTORY_BUILD_INTERFACE 2019-05-28 17:55:28 +02:00
Martchus 6489cae19e Apply cmake-format 2019-05-15 15:52:29 +02:00