Martchus
e14b5bf335
Remove unused CMake variable
2019-08-20 22:08:47 +02:00
Martchus
f9bd0b5987
Don't use @META_CONFIG_SUFFIX@ in APP_SPECIFIC_QT_TRANSLATION_FILES
...
See a40d2974e0
2019-08-09 23:20:10 +02:00
Martchus
c483dcc7bf
Remove obsolete code for handling static targets
2019-08-06 17:43:12 +02:00
Martchus
99bc257755
Apply cmake-format
2019-08-06 00:02:38 +02:00
Martchus
d168717023
Configure install destinations already in BasicConfig.cmake
...
It might be already useful before the library config is applied.
2019-08-05 23:46:09 +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
eb34ce610d
Add domain to ApplicationInfo
2019-07-20 20:57:56 +02:00
Martchus
d184370fea
Add note about project()
...
So I don't get the bright idea to revert recent
changes again in some future refactoring.
2019-07-20 18:04:10 +02:00
Chih-Hsuan Yen
9264f1ac76
Add icons (*.icns) for Mac OS X/macOS .app bundles
2019-07-20 12:14:30 +08:00
Chih-Hsuan Yen
6f3a1fa086
Make .app bundles work on macOS
...
By setting CMake variables for Info.plist generation. Some of them are
necessary and others are good to have.
2019-07-17 17:53:16 +08:00
Martchus
d318585fb2
Add EXCLUDED_FILES variable
...
When adding source files to the _FILES variables conditionally
those are so far not being formatted or translated. Adding
these files at least to the EXCLUDED_FILES will fix this.
Replaces DOC_ONLY_FILES which served the same purpose but was
limited to documentation.
2019-07-13 14:01:25 +02:00
Chih-Hsuan Yen
ee31e5c1d1
Fix building with Xcode
2019-07-13 10:22:21 +08:00
Martchus
81a3d4fa94
Don't skip entire use_pkg_config_module if target exists
...
Otherwise the same library can not be added to another library
variable.
2019-07-09 18:36:28 +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
fd531bdd6a
Prefix most of the macros in global.h
2019-06-12 20:34:25 +02:00
Martchus
6c9a956a4f
Apply cmake-format
2019-06-10 22:43:42 +02:00
Martchus
93bdf5b4f1
Do not error-out if file system lib not found
2019-06-07 16:45:06 +02:00
Martchus
d9b4ca5381
Fix build when not file system library required
2019-06-06 15:20:42 +02:00
Martchus
aebd324cf4
Add CMake function to use std::filesystem
2019-06-05 23:48:01 +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
01f21e63c9
Fix appdata.xml.in
2019-05-19 14:14:25 +02:00
Martchus
6489cae19e
Apply cmake-format
2019-05-15 15:52:29 +02:00
Martchus
1a478411d6
Default to C++17
2019-05-11 18:42:38 +02:00
Martchus
e114b24d3c
Add helper to use pkg-config modules
...
This basically creates imported targets from those
pkg-config modules. It also supports static linkage.
The main effort here is that those imported targets
are also exported appropriately. This is implemented
by letting the config script re-run pkg-config as
required.
2019-05-09 19:27:10 +02:00
Martchus
b4cf641cfd
Fix setting library version
2019-05-07 16:49:19 +02:00
Martchus
a1267f2015
Fix handling undefined INTERFACE_REQUIRED_PACKAGES
2019-05-06 16:22:35 +02:00
Martchus
0443905986
Fix creation of desktop files
2019-05-05 23:19:05 +02:00
Martchus
02bd9f7c06
Add new fields to ApplicationInfo
2019-05-05 18:35:40 +02:00
Martchus
fa961b21bc
Adapt translatin search path to new config feature
2019-05-05 18:35:13 +02:00
Martchus
a17f322f3c
Apply cmake-format
2019-05-04 20:57:56 +02:00
Martchus
1480d9ab63
Support installing multiple configurations within the same prefix
2019-05-04 01:59:45 +02:00
Martchus
8ffe0e6a51
Polish CMake code
2019-04-22 22:19:08 +02:00
Martchus
e9cc26478b
Don't mix building static and shared libraries
2019-04-22 20:42:48 +02:00
Martchus
716af584c5
Use CMakeParseArguments for add_custom_desktop_file()
2019-04-13 20:33:39 +02:00
Martchus
6088f6bb43
Don't include Qt-specific config in config.h
2019-04-13 20:33:39 +02:00
Martchus
0bd53c77b5
Query install directory for Qt plugins from qmake
2019-02-27 21:05:23 +01:00
Martchus
86f3bf8b3b
Apply cmake-format
2019-02-06 17:30:52 +01:00
Martchus
42dd86a16e
Support cmake-format via tidy target
2019-02-05 22:51:07 +01:00
Martchus
b2bf0a002b
Allow to add default cppunit test application
...
To get rid of the boilderplate file "cppunit.cpp" in each
project using cppunit for tests.
2019-01-13 22:14:42 +01:00
Martchus
f66aa33d61
Reduce indentation in TestTarget.cmake
2019-01-13 22:01:52 +01:00
Martchus
22795dac8a
Remove code for Android ECM module
...
Use module provided by qtutilities instead
2018-12-22 02:07:49 +01:00
Martchus
b16d91287d
Track dependencies of Windows resource file
...
So changing the icon will cause the resource file
to be recompiled.
2018-12-22 00:40:38 +01:00
Martchus
8ed1a03f92
Consider *.c and *.hpp files formattable as well
2018-12-08 19:06:01 +01:00
Martchus
2f0a7050ac
Auto-detect bugtracker on Gitea
2018-12-08 19:04:48 +01:00
Martchus
26496c310e
Make path of Git executable configurable
2018-12-08 19:04:01 +01:00
Martchus
c0f74e4c89
Add BOOST_IOSTREAMS_DYN_LINK to compile defs
...
if linking dynamically against Boost.Iostreams
2018-10-21 20:24:55 +02:00
Martchus
c66420b1dc
Remove target to launch tests with wine
...
This wasn't of much use. One can just use `make
check` and set WINEPATH before manually.
2018-10-07 20:04:31 +02:00
Martchus
749eea2ab6
Support NativeFileStream via Boost.Iostreams
...
So it can also be enabled when not using libstdc++.
2018-09-30 13:55:30 +02:00
Martchus
3c02ad6d92
Fix check for source files
2018-09-24 22:39:09 +02:00
Martchus
3a65e3ecdd
Adjust CMake modules for better Android support
2018-09-16 00:25:04 +02:00
Martchus
93d6fb5d88
Reduce indentation in ListToString
2018-07-27 16:30:11 +02:00
Martchus
35ebac1cac
Add static-check target for executing clang-tidy
2018-07-27 16:19:16 +02:00
Martchus
2e2b66e398
Add mingw-w64 specific targets only when using mingw-w64
2018-07-27 16:18:27 +02:00
Martchus
6dcd39f1ac
Set CXX_STANDARD on header-only lib target for Qt Creator
2018-06-26 00:05:26 +02:00
Martchus
3a6bbb0115
Allow enabling GUI config even when no specific sources present
...
Useful when GUI specific code is only wrapped using #ifdef so
there are no extra files.
2018-06-24 20:47:19 +02:00
Martchus
79679c0f42
Improve fake target for Qt Creator
...
This target is required so files for header-only libs
show up in Qt Creator. So far it was just a custom target.
However, this way include directories and build flags are
not correctly passed to the code model. So creating an
actual library now.
2018-06-24 20:43:08 +02:00
Martchus
b77607f3e0
Rename META_REQUIRED_FEATURES
...
Because those features are actually not required.
2018-06-03 22:15:20 +02:00
Martchus
4a69db787d
Allow to create header for feature detection
...
The header will only contain some preprocessor conditions.
CMake will *not* do checks with the current compiler.
2018-06-03 21:49:01 +02:00
Martchus
52bf075317
Move creation of srcdirref and testfiles dir to BasicConfig
...
Those make testing more convenient and are also useful when
there's no test target, eg. when testing syncthingtray with
mocked configuration.
2018-05-01 23:59:28 +02:00
Martchus
7cafdd551e
Fix wrong negation to enable Doxygen target
2018-03-21 22:33:12 +01:00
Martchus
9a352e0b8f
Do not add source files to Doxygen target
...
Adding the files only has the effect that the files
are shown in the IDE. However, the files should be present
anyways and adding them again causes Qt Creator to
accidently use the wrong target for the code model.
2018-03-19 20:38:10 +01:00
Martchus
19332033ec
Format all GUI-only files
2018-03-11 18:58:26 +01:00
Martchus
9e8ec0fcd5
Split Qt-specific config from other config
...
So adding Qt-specific config does not require a change
in c++utilities anymore.
2018-03-07 18:23:51 +01:00
Martchus
8a83870ac7
Allow variable number of digits in license versions
2018-02-28 18:01:17 +01:00
Martchus
d684e20bfc
Add launchable to appdata.xml
2018-02-22 00:01:01 +01:00
Martchus
0dcbb3de55
Improve coding style in CMake modules
2018-02-21 23:07:51 +01:00
Martchus
eea5aa57bc
Fix reading version of static Qt 5 modules
2018-02-21 22:41:13 +01:00
Martchus
7c8580d579
Add license to config
2018-02-21 22:14:22 +01:00
Martchus
e57e79f9c9
Stringify meta data in template
2018-02-21 22:07:05 +01:00
Martchus
486c99f7fd
Determine project license automatically
2018-02-21 21:58:27 +01:00
Martchus
989d1d20c8
Allow using templated appdata body
2018-02-21 21:55:52 +01:00
Martchus
6300e37924
Install shared/static config
2018-02-19 19:45:07 +01:00
Martchus
486a09c1c5
Add basic template for meta info
2018-02-18 20:18:00 +01:00
Martchus
3fcbaf7fff
Split shared and static configuration
2018-02-16 23:56:29 +01:00
Martchus
5950aed7ec
Adjust use of llvm-cov to LLVM 5
2018-01-29 16:20:09 +01:00
Martchus
18e7154c03
Allow test target to be intended for manual testing
...
So those test targets which only setup an environment for
manual testing can be excluded from eg. `make check`.
2018-01-28 00:36:46 +01:00
Martchus
a67805cb0f
Allow providing a special include dir for build
2018-01-20 20:43:18 +01:00
Martchus
5c6207c6fa
Do not try to strip header only libs
2018-01-20 17:44:14 +01:00
Martchus
60a762f514
Allow configuring static Qt Widget style plugins
...
Required since the platform styles have been
pluginized in Qt 5.10
See 4f3249f32d
2017-12-15 20:18:17 +01:00
Martchus
9744efda70
Ensure default testfiles directory for working copy exists
2017-11-17 23:36:36 +01:00
Martchus
684e97ce2a
Allow customizing the config header file
...
by setting the 'META_CUSTOM_CONFIG' variable
2017-11-17 20:36:34 +01:00
Martchus
a4e7cbd5c3
Make target 'interface_sources_for_qtcreator' unique
2017-11-16 01:59:43 +01:00
Martchus
e283eea1f0
Prevent using executable of header-only lib for coverage
2017-11-15 19:13:36 +01:00
Martchus
a7880e3d0c
Remove *.qm files from targets when built-in translations enabled
...
This prevents updating *.ts files twice and in parallel leading to
build errors.
2017-11-02 00:10:06 +01:00
Martchus
2bb4aa36a4
Let tests find the testfiles from sources without extra args
...
Currently the path of the testfiles always had to be specified
either manually using the -p argument or by running the tests
via the build system targets. The first option is annoying and
the second option not so nice when using Qt Creator and the
debugger.
This commit allows tests to find the testfiles from the source
directory automatically (as fallback). This is achieved by
creating a file containing the path of the source directory
with CMake. Note that this file can only be found if the working
directory is set to the binary directory (default in Qt Creator).
2017-10-30 23:01:07 +01:00
Martchus
2203e0a335
Set dependencies of tidy target correctly
2017-10-24 01:01:29 +02:00
Martchus
a869aa8def
Do not add sources to header-only libs
2017-10-23 01:12:51 +02:00
Martchus
d25265fee1
Don't add include path for config.h to header-only libs
...
This causes CMake errors and CMake is acutally right, it makes
no sense because the config header is only available during build
but a header-only lib is not being built.
2017-10-23 01:08:25 +02:00
Martchus
cb02d5c733
Add target for building all tests
...
This allows to build all tests at once without
adding them to "all" target. In contrast to the
check target, the tests are not executed.
2017-10-19 16:20:49 +02:00
Martchus
ae249140bc
Use also actual lib name to check whether dependency is public
...
In accordance to 'Fix adding public Qt modules in pkg-config'
in qtutilities (b2e3506ff59ae4b610c91bd9ee96333871fa5864).
2017-10-08 20:24:48 +02:00
Martchus
472e0296d0
Fix adding public static lib dependencies
2017-10-08 19:42:55 +02:00
Martchus
05605a1b25
Filter files for tidy
2017-09-09 21:35:55 +02:00
Martchus
6df6474840
Allow configuring supported image formats
...
This allows to add an option for linking against static Qt
image format plugins in qtutilities.
2017-09-03 17:53:20 +02:00
Martchus
7754cf82d8
dependency info: Support prefixed static Qt 5 modules
2017-09-03 17:50:23 +02:00
Martchus
9c8bb44843
Fix mingw-w64 targets
2017-08-31 02:16:05 +02:00
Martchus
f8c7a0a0a8
Do not set BUNDLE DESTINATION unless platform is MacOS X
...
Because that seems to prevent executables from being installed
when using install-binary target
2017-08-31 02:15:56 +02:00
Martchus
032111eef0
Distinguish exporting/enabling resources of static libs
...
Required because we now allow to provide dynamic libs as
dependencies of static libs
2017-08-31 02:15:46 +02:00
Martchus
17a08baeb5
Fix including config when building app as testlib
2017-08-30 22:53:35 +02:00
Martchus
11e2c48c06
Prevent usage of include_directories
...
Rather use target_include_directories
2017-08-23 23:10:05 +02:00
Martchus
a475ef8693
Make creating overall test coverage depend on awk script
2017-08-17 17:59:08 +02:00
Martchus
b45fe7eaeb
Allow providing a shared lib as dependency for a static lib
...
Previously the case when the dependency of a static library
was provided by a dynamic library has not been handled
correctly leading to linker errors when building the final
application.
2017-08-06 00:35:11 +02:00
Martchus
86e12a1164
Fix include dirs for build interface
...
* The project directory is part of the include
directives, eg. #include <c++utilities/...
* So the include search path must be one level
above the project directory.
2017-08-05 18:41:41 +02:00
Martchus
b7381eb55c
Do not use -static under MacOS
2017-08-05 18:38:02 +02:00
Martchus
6ed336bf94
Allow specifying install destination for bundles
...
* Install destination for bundles can be set via
cache variable BUNDLE_INSTALL_DESTINATION
* Default is the dir used for regular applications
2017-08-05 18:33:57 +02:00
Martchus
15bf2779c5
Make pkg-config file for both, dynamic and static target
2017-07-30 00:56:12 +02:00
Martchus
e4709099d2
Prevent error in coverage target when building only static libs
2017-07-28 17:34:28 +02:00
Martchus
c966e3fb1b
Improve finding cppunit
...
* Add include dir
* Make library/include dir configurable via cache variable
2017-07-22 15:33:41 +02:00
Martchus
36b2498dd6
Allow disabling install targets
...
Might be useful if install targets cause
problems, eg. under MacOS
2017-07-20 01:43:10 +02:00
Martchus
326551ee02
Allow to force use of external iconv
2017-07-20 01:25:13 +02:00
Martchus
73f11eeb2a
detecting 3rdparty libs: Fix overriding cache variables
2017-07-20 01:24:35 +02:00
Martchus
942c14ce3d
Fix target include dirs
...
* Add include path of own header files for build
and external use via imported target. Previously
only include dirs required for external libs were
added.
* Using global include dirs is no longer required.
* When PUBLIC_SHARED_INCLUDE_DIRS is empty, adding
"${PUBLIC_SHARED_INCLUDE_DIRS}" to public include dirs
does not leave INTERFACE_INCLUDE_DIRECTORIES property
empty. Instead the source dir is added. So just don't
use quotes here.
2017-07-11 22:02:27 +02:00
Martchus
28f76db46e
Add install target for 'extra-files'
...
So additional files like tests/calculateoverallcoverage.awk
and coding-style.clang-format are installed and can be used
by other projects, too.
2017-07-11 19:34:38 +02:00
Martchus
442f7a9b25
Exclude generated files from coverage
...
* So files generated by moc or qdbusxml2cpp are not
part of coverage statistics
* When filtering files, llvm-cov prints multiple tables
showing coverage on function level.
-> Generate overall coverage stats via awk.
2017-07-09 23:38:11 +02:00
Martchus
6f146072ea
Allow overriding 3rd party libs/includes
...
So passwordfile can be told to use legacy OpenSSL
header in accordance with Qt 5 which still requires
OpenSSL 1.0
2017-07-04 22:44:32 +02:00
Martchus
a4fc4024b5
Make tidy and coverage optional and disabled by default
...
* Prevent warnings about required tools being unavailable
when tidy/coverage targets aren't desired anyways (eg.
when packaging)
* Do not automatically execute tidy check when packaging
in unclean environment
2017-06-20 23:38:45 +02:00
Martchus
57d5d04d9f
Merge prof data of subprocesses created when executing tests
...
So coverage is accounted correctly when tests create subprocesses
of the application to be tested using execApp().
2017-06-20 23:19:49 +02:00
Martchus
1e14b09e64
Fix passing application path to tests
2017-06-19 14:15:44 +02:00
Martchus
64572e6860
Add general coverage target
2017-06-19 14:01:33 +02:00
Martchus
6807d899d2
Enable source code based coverage analysis
2017-06-18 16:17:44 +02:00
Martchus
2174dc516a
Allow specifying target compile options via variable
2017-06-18 16:14:45 +02:00
Martchus
5e67a9b691
Make check target depend on .clang-format file
2017-06-01 18:24:14 +02:00
Martchus
ecce539a18
Do not set global include dirs
...
TODO: Set include dirs on target level
2017-05-24 23:29:17 +02:00
Martchus
ac348ee3b9
Find cppunit via pkg-config
2017-05-23 00:49:45 +02:00
Martchus
13ac2305d5
Allow not to link tests against cppunit
2017-05-23 00:10:27 +02:00
Martchus
04c1f98361
Format test code, too
2017-05-02 23:31:12 +02:00
Martchus
7e49d3994f
Allow skipping creation of tidy target
2017-05-01 03:03:20 +02:00
Martchus
2ef55c439c
Add tidy test
2017-05-01 02:57:58 +02:00
Martchus
7e0f65ed78
Call clang-format with all src files
2017-05-01 02:57:58 +02:00
Martchus
b74327d961
Move creation of check target to BasicConfig.cmake
...
* So other tests like tidy check can be added
* Even if there are no tests after all, the
check target shoudn't cause any problems
2017-05-01 02:57:58 +02:00
Martchus
8799698f01
Adapt global.h.in to new coding style
2017-05-01 02:57:58 +02:00
Martchus
d76ead0483
Add tidy target using clang-format
2017-05-01 02:57:58 +02:00
Martchus
ead0fadac3
Unset version info when not available
2017-04-15 23:33:52 +02:00
Martchus
6042336038
Allow checking whether external lib is used
2017-04-15 23:20:27 +02:00
Martchus
b8c2e79e3d
Use meta-data provided in CMake config for version info
...
* Don't set custom meta-data on targets
* It isn't exported anyways
* Remove version on application target because itcauses
CMake to create symlinks
2017-04-15 23:02:41 +02:00
Martchus
be03e5ad4c
Provide meta-data in CMake config
2017-04-15 22:39:41 +02:00
Martchus
412e725309
Append Git revision to version
...
* Append Git revision and ID of latest commit
to version displayed via --help
* Can be turned off via option
* Has no effect if the source dir is not
a Git checkout or Git is not installed
* Implements
https://github.com/Martchus/tageditor/issues/13
2017-04-15 01:45:03 +02:00
Martchus
91e5a8b0b0
Show version of used libraries in --help
...
* Include only own libraries and Qt 5 modules
so far
* First step to implement
https://github.com/Martchus/tageditor/issues/13
2017-04-15 01:10:38 +02:00
Martchus
bfa12a9870
Allow creation of header-only library
...
* Create interface target if only headers present
* Include workaround to show header files in Qt Creator
2017-04-14 23:30:46 +02:00
Martchus
2e0df8aa6a
Allow linking only tests in 3rdParty macros
...
So tagparser tests can link against OpenSSL
for computing checksums
2017-04-08 18:29:21 +02:00
Martchus
f86a8b3700
Fix adding dependencies of install-mingw-w64 target
2017-04-04 01:01:03 +02:00
Martchus
cb82630665
Add general target for generating API doc
2017-04-04 01:00:17 +02:00
Martchus
663b31c5fe
Allow skipping install targets
...
* via variable META_NO_INSTALL_TARGETS
* since this is just to silence some warnings
no need to bump minor version
2017-04-01 16:18:32 +02:00