summaryrefslogtreecommitdiffstats
path: root/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Add global / top-level docs targetsAlexandru Croitor2020-03-182-1/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously you could use either module-specific or repo-specific 'docs' targets. For example 'ninja html_docs_qtbase' or 'ninja html_docs_Core'. Now there's a global / top-level target called 'docs', so 'ninja docs' works. For super builds it will build the documentation of all configured repositories. For a single repo build, it's equivalent to calling 'ninja docs_repo_name'. Also for consistency, add the "docs_Core" target, which was missing before. So now a 'docs' target exsits for repo names AND targets. New global target names are - docs - prepare_docs - generate_docs - html_docs - qch_docs - install_html_docs_docs - install_qch_docs_docs - install_docs_docs Amends 0095ff4e0659906595d281b37c3b7f89e37250af Change-Id: I686be1e0962e40cbce860e8ac2cabb056b360ac2 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Remove APPLE prefix from platform namesTor Arne Vestbø2020-03-168-19/+19
| | | | | | | None of the other platforms have it. Change-Id: Ib448c2c03ba03f711b507ef391977c0e6aa7c192 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Fix naming when referring to Apple macOSTor Arne Vestbø2020-03-164-4/+4
| | | | | Change-Id: Iafb5e448d0d65d42f788464fc600594a5666f9af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix Windows VM Test RunsLeander Beernaert2020-03-161-26/+8
| | | | | | | | | | | | | | | | | | | | Simplify the handling of simd specific sources. The previous implementation was causing simd instructions to bleed into the main library. The tests were failing because the avx instruction were leaking into Qt6Gui due to the previous problem. This in turn caused any test which required Qt6Gui code run to crash since it is not possible to run avx instruction in the VMs. This patch also disables PCH for the simd sources as they result in warnings related related to using PCH header not compiled for the architecture in question. The latter can cause the build to fail in conjunction with warnings as errors. Change-Id: I1be98f2f5e967f33793d6a2e6134a24ef1709566 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Don't make a private module depend 1kk times on the public oneAlexandru Croitor2020-03-131-1/+2
| | | | | | | | | The exported INTERFACE_LINK_LIBRARIES property now looks a lot more sane. Change-Id: I093fcb242607023dd0b103298562b299cb803028 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Add default Info.plist for macOS with some important keysTor Arne Vestbø2020-03-133-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | The default Info.plist shipped with CMake lacks an NSPrincipalClass entry, which is crucial for making macOS apps run in full resolution on retina screens. We make sure the file is only picked up on macOS, not iOS and friends, since those platforms require another principal class. If needed we can extract the value out as a CMake variable and use the same file for all Apple platforms. Doing so would assume all keys are single-platform only, so if that's not the case we need platform-specific files. We should probably extract the package type out as a variable too, so that the file can be used for both apps, plugins, and frameworks, but doing so requires setting up that variable somewhere based on the target type, which CMake doesn't allow in an easy way. The file itself is based on the file CMake ships, combined with keys inherited from Qt's existing plist templates for qmake, and adjusted to match what Xcode generates by default these days. Change-Id: I3f5109e5fff63cdbd109a99d4008948d4bd2102b Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* cmake: Disable GL deprecations on Apple platformsTor Arne Vestbø2020-03-121-0/+6
| | | | | Change-Id: I87b98ae68d996868cefaaf578722ac24be745145 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix incorrect argument in QtBuildInternalsAndroidAlexandru Croitor2020-03-121-2/+2
| | | | | | | | Uncovered while building qtdeclarative. Change-Id: If1a36f2640a3a5d765e7ca74b0ba1d39ef2a18f0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Install the QtBuildInternalsAndroid.cmake filleAlexandru Croitor2020-03-121-1/+5
| | | | | | | | | | It's needed when building qtdeclarative. Needs to be copy_or_install to support non-prefix builds as well. Change-Id: Ied59f6a1f8403be3721a0ad46f5a3b2f569028ca Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Don't build tests and examples by default on Android and iOSAlexandru Croitor2020-03-121-2/+2
| | | | | | Change-Id: Ia31733e2cadfb52d11426c40f3543bedc48342c4 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Propagate minimum required C++ standard to consumers of QtAlexandru Croitor2020-03-122-0/+11
| | | | | | | | | Aka the version of C++ that needs to be supported when compiling applications that use Qt headers (C++17 at the moment). Change-Id: I64dec297e8329f31b1d9864f216a95782049ed06 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* rcc: Teach rcc the --no-zstd optionAlexandru Croitor2020-03-121-0/+10
| | | | | | | | | | | | It is needed when cross-building Qt using CMake, where the zstd feature might have different values between the host and target, in which case the build system tells rcc not to use zstd when the feature is disabled. Amends d20c9805763ab3dc504ebf2cefd33499d89ef22c Change-Id: I9dc55b59b1be5272b79aa5f1e2daf2b516a157d6 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* Fix spelling mistakesTor Arne Vestbø2020-03-111-1/+1
| | | | | Change-Id: I389727ce9b8d3ef2a54156b682ef5aeccb39ebd2 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Update instructions for developer builds with CMakeTor Arne Vestbø2020-03-111-1/+1
| | | | | Change-Id: I101a4b12bae393fa188bb2633cc2d74170adbb4c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Update the README regarding the minimum cmake version requiredAlexandru Croitor2020-03-101-2/+1
| | | | | | | | | | | The minimum required CMake version to build Qt on any platform is 3.16.0 at the moment. That's the first version that ships the implementation-specific AutogenInfo.json files, which we parse to implement the Qt moc --collect-json functionality. Change-Id: I6160cd74fa228aa330f4c1e512ffb766afc5f8a3 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Remove code for old 3rdparty mechanism handlingAlexandru Croitor2020-03-102-111/+0
| | | | | | | | | | The only two uses (QtHarfbuzz and QtDoubleConversion) have been removed, so now the code is not needed anymore. Change-Id: Id9ef628fa139f1431395bcdd1705463dfafb1051 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Remove old 3rdparty mechanism for double conversionAlexandru Croitor2020-03-101-10/+2
| | | | | | Change-Id: I2b20d4d9d95a1f7f59bc506046a1ebc20eb305f7 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle path components like INSTALL_LIBDIR more correctlyAlexandru Croitor2020-03-102-36/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | We recomputed INSTALL_LIBDIR for every new repo that is configured, which is incorrect due losing any custom provided libdir when configuring qtbase. Save that information (and all other path components) in QtBuildInternalsConfigExtra.cmake. Make sure not to-recompute that information when configuring a project other than QtBase. Allow providing absolute paths instead of relative paths for these variables. Note that only absolute paths pointing somewhere under the prefix will currently work, otherwise configuraion will fail. If we need to support such a use case, we'll have to carefully check all code that use these path components to make sure they handle absolute paths correctly (current assumption is relative paths everywhere). Use the computed paths when generating the qconfig.cpp file which is used for qmake -query. Task-number: QTBUG-81289 Change-Id: I331aa00e47988fe0ee4e533b5f95c4df11c4d96f Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Update cmake/README with newer informationAlexandru Croitor2020-03-091-88/+35
| | | | | Change-Id: Ia0e723bb24b8a60dc02d2d218f5a2b5dc2b24017 Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Port most of the configure summary supportAlexandru Croitor2020-03-095-3/+336
| | | | | | | | | | | | | | | | | | | | | | | | | Teaches configurejson2cmake about summaries / reports, so things like enabled features, configure sections, notes, etc. Add relevant CMake API for adding summary sections and entries, as well as configure reports. The commands record the passed data, and the data is later evaluated when the summary needs to be printed. This is needed, to ensure that all features are evaluated by the time the summary is printed. Some report and summary entries are not generated if they mention a feature that is explicitly exclduded by configurejson2cmake's feature mapping dictionary. This is to prevent CMake from failing at configure time when trying to evaluate an unknown feature. We should re-enable these in the future. A few custom report types are skipped by configurejson2cmake (like values of qmake CONFIG or buildParts). These will have to be addressed a case-by-case basis if still needed. Change-Id: I95d74ce34734d347681905f15a781f64b5bd5edc Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Set minimum deployment target for darwin platformsAlexandru Croitor2020-03-061-8/+22
| | | | | | | | | Same value as QMAKE_IOS_DEPLOYMENT_TARGET in mkspecs/macx-ios-clang/qmake.conf, etc. Change-Id: I1f6a07d73c2126d0286e8d26f7e61a690607c8ce Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Port the 'separate_debug_info' featureJoerg Bornemann2020-03-064-0/+100
| | | | | | | | | | | | | | | For this, we have to uninline the separate_debug_info configure test, because supporting the conversion of this in configurejson2cmake is not worth the hassle. Separate debug information can be turned on for a target by calling the function qt_enable_separate_debug_info. For Qt's shared libraries and tools separate debug information is generated if the 'separate_debug_info' feature is manually turned on. Change-Id: Ic2ffc15efef3794dc0aa42f3d853ef6d651a751c Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix Ninja Multi-Config framework buildsAlexandru Croitor2020-03-061-0/+1
| | | | | | | | | | | | | | | | | | Depends on a new bleeding edge feature in as-of-yet unreleased CMake 3.18, that allows building macOS frameworks using the Ninja Multi-Config generator targeting more than one configuration. It uses the new CMAKE_FRAMEWORK_MULTI_CONFIG_POSTFIX_DEBUG property which tells CMake to create properly named debug artifacts in the Multi-Config ninja file. Without it, both debug and release artifacts would have the same location (no _debug) postfix, so it would be unclear which file ends up being compiled as last (the debug or release variant). Change-Id: I3e10832551731a18317da8f9667d96cec3dc3028 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add QT_MODULE_SKIP_MODULE_INCLUDES propertyLeander Beernaert2020-03-052-1/+13
| | | | | | | | | | When a Qt module has this property set, when we generate the QtModuleDepends header file and find this module it will not be added. This is required to be able to create a Core_qobject module, as it does not have any headers. Change-Id: Iaea1080919d05ace12e48693e02d8c0f4c669339 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Handle conditions in third party find modules correctlyAlexandru Croitor2020-03-058-37/+45
| | | | | | | | | | | | | | | | | | | | | Previously the FindWrap modules checked for hardcoded features when deciding whether to use a bundled library or not. This proved not to work correctly because features were not available when the find modules were processed. Introduce a new CMake API call that needs to be manually called after an add_subdirectory call which declares a bundled library. The call will check for the existence of the bundled target, and will then set a cache variable QT_USE_BUNDLED_Bundled<TargetName>. The same variable is written into a FindWrapFooConfigExtra.cmake file which will be loaded by the appropriate FindWrap module. The module can that use that variable to decided whether to link against the bundled library or the system library. Change-Id: I75e9a4f4e14d88d4490916a79ad12f1ce57891e0 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Port the 'debug_and_release' featureJoerg Bornemann2020-03-051-0/+3
| | | | | | | | This feature is read-only. It's controlled by the multi-config feature of CMake. It mainly exists for the qmake support. Change-Id: I322459598fe92568eda4d42319ded444537e95d4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Adapt to latest upstream Ninja Multi-Config changesAlexandru Croitor2020-03-042-7/+7
| | | | | | | | Most of the NMC-specific variables were renamed to be more general. Change-Id: I8ee2874fecb9e57480ce51db9183c6cf3dd100af Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Fix stack-protector-strong test and featureJoerg Bornemann2020-03-041-2/+5
| | | | | | | | | And in order to do this we must teach qt_config_compile_test a COMPILE_OPTIONS argument. Change-Id: I66fa45142b544e3a2fc599af1c1a4c69b442b318 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Prepend prefix path after loading toolchain fileSamuli Piippo2020-02-281-3/+3
| | | | | | | | | The original toolchain file may set CMAKE_FIND_ROOT_PATH instead of appending it, which overrides the Qt's path. Change-Id: I69a4bf4be6a999854bb8a84cf5032c6a9b739b2e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Generate Win32 Resource FilesLeander Beernaert2020-02-251-2/+37
| | | | | | | | | | | | | | Add support to generate win32 resources files through CMake. The functionality is implemented via qt6_generate_win32_rc_file() in Qt6CoreMacros.cmake. Currently qt_add_test(), qt_add_module() and add_qt_gui_executable() call the above function when building on windows. The function itself has been written as part of the public API so it can be called from other locations if required. Change-Id: Id5388b3bf9a2068b36780d8268306326f990778c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add missing linker flags for MSVCLeander Beernaert2020-02-251-0/+6
| | | | | | | | This patch adds missing linker flags for MSVC in order to match qmake's msvc-desktop.conf. Change-Id: Ieb1206dae4517e8d9f36175f8fcebccd30e52d01 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Port the reduce-relocations featureJoerg Bornemann2020-02-251-0/+15
| | | | | | | | | | As reduce-relocations implies bsymbolic_functions, we also add the -Bsymbolic-functions linker flag. Also, handle the .dynlist files that are passed to the linker by bsymbolic_functions.prf in the qmake build. Change-Id: I535c33fba888596d2f8975b16864bbe9f0a7caa4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Allow building bundled 3rd party libraries in qtbaseAlexandru Croitor2020-02-2511-94/+287
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A few things are needed to accomplish that: - the python scripts do not ignore certain system_foo features anymore (it is a hardcoded list for now just to be safe) - configurejson2cmake now outputs qt_find_package(WrapSystemFoo) calls for bundled libraries (see below) - the harfbuzz .pro file is modified to accommodate pro2cmake not being able to correctly parse some conditional scopes - the freetype .pro file is modified to make sure linking of the library succeeds without duplicate symbol errors, which qmake doesn't encounter due to magical exclusion of cpp files that are included in other cpp files (presumably for include moc_foo.cpp support) - feature evaluation for Core, Gui, Network now happens in the qtbase/src directory, so that bundled libraries can be conditionally built - for each bundled library there are now two FindWrap scripts: - FindWrapSystemFoo which finds an installed library in the system - FindWrapFoo which either uses the system installed library or the built bundled one depending on a condition - projects that intend to use bundled libraries need to link against WrapFoo::WrapFoo instead of WrapSystemFoo::WrapSystemFoo targets (this is handled by pro2cmake). Unfortunately manually added qt_find_package(WrapFoo) calls might still be needed as is the case for WrapFreetype and others. - a new cmake/QtFindWrapHelper.cmake file is added that provides a macro to simplify creation of WrapFoo targets that link against a bundled or system library. The implementation is fairly ugly due to CMake macro constraints, but it was deemed better than copy-pasting a bunch of almost identical code across all FindWrapFoo.cmake files. - a qtzlib header-only module is now created when using bundled zlib, to provide public syncqt created headers for consumers that need them. These are projects that have 'QT_PRIVATE += zlib-private' in their .pro files (e.g. qtimageformats, qtlocation, qt3d, etc.) This is unfortunately needed due to QtNetwork using zlib types in its private C++ API. The change includes support for building the following bundled libraries: - zlib - libpng - libjpeg - Freetype - Harfbuzz-ng - PCRE2 The following 3rd party libraries are still using an old implementation within the CMake build system, and should be migrated to the new one in the near future: - double-conversion - Old harfbuzz The are a few libraries that are not yet ported: - system-sqlite - systemxcb - maybe others Among other things, this change allows building qtbase on Windows without requiring vcpkg. Task-number: QTBUG-82167 Change-Id: I35ecea0d832f66c1943c82e618de4a51440971a5 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Check for syncqt private headers directory before usingAlexandru Croitor2020-02-251-1/+7
| | | | | | | | | | | | | | | Only existing directory paths should be added to INTERFACE_INCLUDE_DIRECTORIES, otherwise projects fail to configure. If after running syncqt there is no private headers directory created (due to the module not having any _p.h files), such a path should not be added as an interface include path. This fixes consumers of QtZlib, where there are no private headers. Change-Id: I3fd1a7b5eb8f816d178d6d91223baa6f377e6f9f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
* CMake: Allow evaluating features before a module is processedAlexandru Croitor2020-02-251-17/+36
| | | | | | | | | | | | | | | Introduce an internal qt_feature_evaluate_features() function which takes a list of configure.cmake paths, and evaluates the features declared in those files, thus setting a bunch of cache variables. This is required to implement the equivalent of what qtbase/src.pro does, which includes the feature .pri files to decide whether bundled 3rd party libraries need to be built. Change-Id: I5552f488671c001eb3f204245b905ab981017a9f Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix FindWrapRt module when it's found multiple timesAlexandru Croitor2020-02-251-6/+9
| | | | | | | | | | | | | | | | | On Windows, when WrapRt is qt_find_pacakge()'d the first time, the result is "not found", whereas a second time it would claim that the package is found. This is due to the WrapRt target being always created even if it has no transitive dependencies, and thus a second search would check only for the existence of the target. Fix the module to only create the target if the relevant library is found. Change-Id: I5c838cbfbafb4029f96da815a0f72e4a8e6716b0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix 3rd party library installationAlexandru Croitor2020-02-251-3/+12
| | | | | | | | | | | | | | | | Libraries created with qt_add_3rdparty_library should be installed when the qmake 'installed' value is set in CONFIG. Introduce a new INSTALL option to handle that in CMake projects. If the value is provided, the library should always be installed regardless of whether it's a shared or static library. Fix the libraries to be installed to BINDIR/LIBDIR instead of the config install dir. Also install the CMake config files into the config install dir. Change-Id: I86f1ef47680f08669a77db77e0d986f47d5fae2d Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Allow creation of modules with no qtfoo-config.h fileAlexandru Croitor2020-02-251-2/+2
| | | | | | | | | | | | | Useful for header only modules that are declared in the same directory as a regular module, but which doesn't have any features and thus has no qtfoo-config.h file. Will be used for the qtzlib module, which is built when system_zlib feature is disabled. Change-Id: I60c5f73c3e2a3a481a16c5872e06d5d109a04b10 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Add functions to allow setting symbol visibility flagsAlexandru Croitor2020-02-251-0/+14
| | | | | | | | Needed for 3rd party library code. Change-Id: Ib994de1980515e849d4368249024d3d5e064fb46 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Allow disabling warnings similar to CONFIG += warn_offAlexandru Croitor2020-02-252-2/+29
| | | | | | | | | | | The QT_COMPILE_OPTIONS_WARNINGS_OFF property can be set on targets in order to disable adding the default compiler warnings flags. This is useful when building 3rd party library code. Change-Id: I9f58ca4543b5ea0d2051b7f94f0042d24c4e3a16 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Set minimum deployment target only for host macOSAlexandru Croitor2020-02-211-1/+2
| | | | | | | | A future change will come that sets it for iOS and friends. Change-Id: I74b688ee62d24137e3cdf5475e1a9e858698ccf0 Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Add missing compile flags for msvcLeander Beernaert2020-02-201-0/+24
| | | | | | | | | This patch adds a couple of missing compile flags that are defined in mkspecs/common/msvc-version.conf and mkspecs/common/msvc-desktop.conf that were not yet ported to CMake. Change-Id: I9ef0ef71cb0c063699fba4c067e90f6515169baf Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix use of compile define QT_NO_DEBUGLeander Beernaert2020-02-202-4/+2
| | | | | | | | | | | | Prior to this patch QT_NO_DEBUG would not be correctly set for generators which support multiple configurations such as Visual Studio and XCode. This patch also applies the define to all executables, which was previously missing. Change-Id: I16a911d15217a62093c68ba2b4c2545cdb8df1e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix PATH environment variable for CMake testsLeander Beernaert2020-02-191-1/+3
| | | | | | | | | | | | This patch fixes setting the correct value for the PATH environment value. Currently, due to Windows' ; path separator, every list entry was treated as a separate environment variable that need to be set instead of properly extending the PATH list. Change-Id: Ib2fc031397459370beec84f9cb4ec6df7db00df3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Only install tests data for prefix buildsLeander Beernaert2020-02-181-2/+2
| | | | | | | | | | If we install tests data for non-prefix builds it can cause tests to fail as they find the data in the wrong location. An example of this is tst_qsslkey. Change-Id: I55bd2ff4cb5a0857dc857cb2149ffe4436ec6f99 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Set qt_add_test WORKING_DIRECTORY to OUTPUT_DIRECTORYLeander Beernaert2020-02-181-0/+2
| | | | | | | | | If qt_add_test() is called with OUTPUT_DIRECTORY and no WORKING_DIRECTORY is specified, default the WORKING_DIRECTORY to the same value as OUTPUT_DIRECTORY._ Change-Id: If373fe590508ad58d4632e0598cd0d9dddb2ae16 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Set a default value for CMAKE_OSX_DEPLOYMENT_TARGETAlexandru Croitor2020-02-181-0/+15
| | | | | | | | | | This replicates the behavior of QMAKE_MACOSX_DEPLOYMENT_TARGET in qmake. Change-Id: I273cd26994f2edfc52dc7b6278252c37b65b2356 Reviewed-by: Cristian Adam <cristian.adam@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
* CMake: Use correct C++ standard flag when building standalone testsAlexandru Croitor2020-02-181-0/+5
| | | | | | | | | | | | | | Before the patch we set the standard flags in two places: - once when building qtbase - and always when including QtSetup (for every repo that is built) This change makes sure to also set the correct standards flag when building standalone tests, because QtSetup is called to early in that case. Change-Id: Iad130b731e9eb9605bb91637364c33fdd49ce3cb Reviewed-by: Leander Beernaert <leander.beernaert@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* cmake: C++17 is mandatoryOlivier Goffart2020-02-181-5/+1
| | | | | Change-Id: Ia0f2151d38fec84be31afc76fc380666861d7d80 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Fix c++ standard config tests with MSVCAlexandru Croitor2020-02-183-0/+22
| | | | | | | | | | | | Need to pass additional -Zc:__cplusplus flag when using MSVC, so that the __cplusplus define has correct values. Additionally make the option be propagated to consumers of Qt via the public Platform target, which QtCore links against. Change-Id: Ie1283c25334b93f993529beb7fb32bdb001627f5 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>