summaryrefslogtreecommitdiffstats
path: root/util/cmake
Commit message (Collapse)AuthorAgeFilesLines
* CMake: Improve mapping of librariesTobias Hunger2019-05-033-282/+272
| | | | | | | | | | | | | Merge all data related to mapping libraries into one data structure in helper.py. Use that data for everything related to library mapping. This change enables way more features now like e.g. adding find_package calls into generated files. Change-Id: Ibbd2a1063cbeb65277582d434a6a672d62fc170b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: configurejson2cmake: Do not generate useless OPTIONALsTobias Hunger2019-05-031-3/+2
| | | | | | | | | | Do not set properties of packages to type OPTIONAL. That is the default anyway. Update generator script and generated files. Change-Id: I7a4d043b69c93ce8c2929a2e27ac6a07e4e6d8cc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* cmake: Fix xcb_glx buildAlbert Astals Cid2019-05-031-0/+1
| | | | | | | Use the actual cmake library target name Change-Id: Icda1d232e3b920bf33ebceb00f39682050f7dedd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Write find_dependency() calls in Qt Module config filesAlexandru Croitor2019-05-022-7/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change introduces a new function called qt_find_package() which can take an extra option called PROVIDED_TARGETS, which associates targets with the package that defines those targets. This is done by setting the INTERFACE_QT_PACKAGE_NAME and INTERFACE_QT_PACKAGE_VERSION properties on the imported targets. This information allows us to generate appropriate find_dependency() calls in a module's Config file for third party libraries. For example when an application links against QtCore, it should also link against zlib and atomic libraries. In order to do that, the library locations first have to be found by CMake. This is achieved by embedding find_dependency(ZLIB) and find_dependency(Atomic) in Qt5CoreDependencies.cmake which is included by Qt5CoreConfig.cmake. The latter is picked up when an application project contains find_package(Qt5Core), and thus all linking dependencies are resolved. The information 'which package provides which targets' is contained in the python json2cmake conversion script. The generated output of the script contains qt_find_package() calls that represent that information. The Qt5CoreDependencies.cmake file and which which dependencies it contains is generated at the QtPostProcess stop. Note that for non-static Qt builds, we only need to propagate public 3rd party libraries. For static builds, we need all third party libraries. In order for the INTERFACE_QT_PACKAGE_NAME property to be read in any scope, the targets on which the property is set, have to be GLOBAL. Also for applications and other modules to find all required third party libraries, we have to install all our custom Find modules, and make sure they define INTERFACE IMPORTED libraries, and not just IMPORTED libraries. Change-Id: I694d6e32d05b96d5e241df0156fc79d0029426aa Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Make freetype a required packageAlexandru Croitor2019-05-011-1/+1
| | | | | | | | | With qmake if we don't find a system package, we use the bundled one. With CMake we don't provide a bundle freetype, hence it's required to find a system one (or custom provided one). Change-Id: I00a5e2ac55459957dae0729f89bafa792a102152 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge commit 'dev' into 'wip/cmake-merge'Tobias Hunger2019-04-162-6/+20
| | | | Change-Id: I176c40d031be26a1dd1cf08843e448a660598783
* CMake: Map xkbcommon_supportTobias Hunger2019-04-121-0/+1
| | | | | | | Qt 5.12 comes with xkbcommon_support now. Map that accordingly. Change-Id: Id10708349d377f6bdfed654428ebcef0b533bd69 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: pro2cmake.py: Fix handling of libraries in QTTobias Hunger2019-04-121-9/+7
| | | | | Change-Id: I5737a285ca0575a454e60fad231435d96b2f1be7 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Inherrit VPATH from parent scopesTobias Hunger2019-04-121-4/+8
| | | | | Change-Id: I95b62fdf3a4cba674bef5a58f0d414464daa3b0c Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Handle setting a key with $$key in the valueTobias Hunger2019-04-121-10/+18
| | | | | Change-Id: I86552ed2a30f07f8c6060b2bad04fd5489b1d482 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Configurejson2cmake: Always enable system-pcre2 and handle dlopenTobias Hunger2019-04-121-2/+4
| | | | | | | Handle dlopen properly. Code is ifdef-ed on it, so we need it:-/ Change-Id: I7f35d24b97530796a4cdcdc1acbe139757170215 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Support /nolink librariesTobias Hunger2019-04-102-2/+7
| | | | | | | | | | | | | Add a helper function to QtBuild that generates Foo_nolink versions of Foo library targets. Map 'Foo/nolink' libs found in qmake to Foo_nolink. Automatically run helper function to create _nolink targets as part of extend_target. Change-Id: I4c23ea68b3037d23c9a31d4ac272a6bd0565f7c0 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix mappings in helper.py - WUIASLiang Qi2019-04-091-1/+1
| | | | | | | This amends 9afc605eb5dea636d3805b0a4e14294030595da3. Change-Id: If246811d267d091c692875a1645c96767f781010 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: pro2cmake.py: Fix plugin type only prints first letterTobias Hunger2019-04-091-1/+1
| | | | | Change-Id: Ib8989d2c13199d804d0c069903ca1c5eb61763e6 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: Fix mappings in helper.pyTobias Hunger2019-04-091-6/+3
| | | | | | | | Some of the Qt names were wrong. Fix them and remove the work-arounds in the library mappings. Change-Id: I9b9afa3fb35c578e5c8d9cdef77224eb072ec8da Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Move defines from QMAKE_CXX_FLAGS into DEFINESTobias Hunger2019-04-091-3/+2
| | | | | Change-Id: If3bfe715032b21dc046e63a79b0318a161d7a371 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Better separation between public and private librariesTobias Hunger2019-04-091-30/+67
| | | | | Change-Id: I95a941ae92a77e049437d3cdd7d06eece11588f4 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Strip '-D' from compile optionsTobias Hunger2019-04-091-0/+2
| | | | | Change-Id: I8239d36dc6af1b5eeded7f293dd6c151c10e289f Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Fix handling of file pathsTobias Hunger2019-04-091-156/+173
| | | | | | | | | | | | | | | | | | | | This patch makes sure to store unchanged filenames as taken from qmake into the scopes it creates. The scopes are then kept longer: Merging/including scopes is handled by adding the scope to a private _included_children member of the parent scope. The methods to access data from scopes are then changed to take the _included_children into account and a new "get_files" method is added, that does all the necessary mapping to handle scope-dependent things like $$PWD, etc. This makes sure src/network is converted correctly incl. all the .pri-files it includes as well as src/platformsupport/themes.pro. Both have been troublesome before. Change-Id: I28e92b7bcee1b91b248c17201c2729a54a3ce4a1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Better representation of scopes as strTobias Hunger2019-04-091-2/+4
| | | | | | | | | Include the current directory in the scope __repr__ output to make it easier to understand where things wrt. include or file names go wrong. Change-Id: I09a6c17c6d8d547f1f64801bcde3c2e10c925ee1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Better handling of debug featuresTobias Hunger2019-04-091-2/+4
| | | | | | | Improve way that debug features are detected. Change-Id: Ic0f0e74885e6d1e7f236c9efe4c77482ac212dbc Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Fix typing informationTobias Hunger2019-04-091-1/+1
| | | | | Change-Id: Iaa6ea69c3c72eb1b626a976fcdb16243f15c609e Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: Map linuxaccessibility_supportPrivate to Qt::LASPTobias Hunger2019-04-091-0/+1
| | | | | Change-Id: I6066f69c74c39fb97a286eb92748b5c4172b1efd Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Add script to print out list of unconverted .pro filesAlexandru Croitor2019-04-081-0/+218
| | | | | | | Also prints some statistics. Change-Id: Ieb55618c0d39604ca76d7a44390e61e02824a01f Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix architecture conditionsAlexandru Croitor2019-04-031-2/+2
| | | | | | | | | | | The actual variable that contains the architecture is TEST_architecture_arch. TEST_architecture only contains the value if the test was performed or not. Fix the conversion script and all the generated files. Change-Id: Icb3480832cab894948f4fef03b8bc8187cab6152 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Map cups to Cups::Cups, vulkan_support_private to ↵Tobias Hunger2019-04-031-0/+3
| | | | | | | Qt::VulkanSupportPrivate Change-Id: Id03942becb08ca3ece589479ffe515f68034ddd4 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* Fix simplification of conditions involving appleAlexandru Croitor2019-04-021-1/+1
| | | | | | | | | | | | | | | | | | Previously a condition like APPLE AND (NOT APPLE_OSX) got simplified to APPLE, which is wrong. This happened by accident due to some sub-family simplifications involving BSD, which APPLE was part of. Technically APPLE is BSD derived, but for the purposes of the conversion script consider APPLE not to be a BSD (hopefully there should be no cases of using the bsd scope for apple machines in qmake files. Also regenerate the fontdatabase project, where the issue was found. Change-Id: I18dcf4f29ffbff48c183ba95ca2a2e5cd5325d86 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* CMake: Set define for default QPA platformTobias Hunger2019-04-021-3/+0
| | | | | | | | | | This is used to set the default QPA platform and without it all Gui applications trigger an assert in QString:-/ This is way simpler than going through configure.json. Change-Id: I2c053e95c0f7e99e97a0b2918d8e4ac13d3494fd Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Handle QDBUSXML2CPP_*_HEADER_FLAGSTobias Hunger2019-03-291-0/+8
| | | | | Change-Id: Ib5d34a6bf550a11154109064e4e718d0c79c722b Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: pro2cmake.py: Improve handling of dbus interfaces/adaptor sourcesTobias Hunger2019-03-291-0/+2
| | | | | Change-Id: I3b642e1ae31996a81618e312183f4cc168bbbe1b Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: pro2cmake.py: Handle $$PWD betterTobias Hunger2019-03-291-0/+3
| | | | | Change-Id: I2e28b652c60d3490138ae0548b32d010faccc5a4 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map odbc to ODBC::ODBCTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: I55cf506cca87ac3e3fe9e0e1803f5118b46bf818 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map SQLite3 to SQLite::SQLite3Tobias Hunger2019-03-291-1/+2
| | | | | | | Fix sqlite maping while at it. Change-Id: I712ca562fa362a7f5857047346e8b3083f901bfb Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map glx_support and glx_supportPrivateTobias Hunger2019-03-291-0/+2
| | | | | Change-Id: I777ea84a080a6856961d644a0290e4d73e07c518 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map psql to PostgreSQL::PostgreSQLTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: I8332d2120e8b629c8722b5c9a95b47950b327d4c Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: pro2cmake.py: deduplicate and sort librariesTobias Hunger2019-03-291-2/+8
| | | | | Change-Id: I924cfac365a0b4ba18c2579820bc37729f1ea8d9 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* CMake: Map atspi2 to PkgConfig::ATSPI2Tobias Hunger2019-03-291-0/+1
| | | | | Change-Id: Ifd21eb278e06a6166ab87106c442d8ec94d92dc5 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map tslib, mtdev, libinput and xkbcommen_evdevTobias Hunger2019-03-291-0/+4
| | | | | Change-Id: If144a8969904b63a3de3884370baaeca1cb4242a Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map fontconfig to Fontconfig::FontconfigTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: I2761ef23cffefbee57da6bb1a07d06b2232d1c57 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* CMake: Map libudev to PkgConfig::LibudevTobias Hunger2019-03-291-0/+1
| | | | | Change-Id: Iac5d0fbf336f0c3905a3dca20524f90432227cf4 Reviewed-by: Albert Astals Cid <albert.astals.cid@kdab.com>
* Fix exception when parsing tests.proJędrzej Nowacki2019-03-281-2/+12
| | | | | | | | | The ParseResults may be a nested list of list. Now the code doesn't raise exceptions, but it fails in do_include as includes that doesn't provide resolved path will fail. Anyway step in the right direction. Change-Id: Ice44e4c10d221293cc6c1facca30abd5495791be Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Do not overwrite CMakeLists.txt when running run_pro2cmakeJędrzej Nowacki2019-03-281-2/+26
| | | | | | | | | | | | One directory may contain many pro files. The generator was happily generating the same CMakeLists.txt for all of them (overwriting). This patch implements a different logic. It tries to find the main pro file and skips others assuming that somehow implicitly they will be incorporated (for example through SUBDIRS). Change-Id: Ie07d75e900a96dd48bf981a896c9dfb920f39a23 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Do not validate file existence if path contains variablesJędrzej Nowacki2019-03-281-0/+7
| | | | | | | | | | We do not need to validate everything, while converting project files. Some checks can be left to building step. It fixes some false positive NOTFOUND errors. Change-Id: I81ff2421fdea13add0bfc03086152a47bce39908 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix turned logic in RemoveOperationJędrzej Nowacki2019-03-282-6/+67
| | | | | | | | | | | It is regression caused by a0a94576fae26bcbbf3823a6ee4b554886e84925 ("Fix RemoveOperation"). Add unit test for all operation types to make sure this code actually works:-) Change-Id: I97c94cb3411f05de89422e3fa2222f2217a09e49 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Fix RemoveOperationJędrzej Nowacki2019-03-261-0/+3
| | | | | | | | | The operation was using an empty set as a base, so it was not really functional. Change-Id: I98fd80c1ede31994857aa1f0c8947ca7b9f76649 Reviewed-by: Tobias Hunger <tobias.hunger@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Speedup run_pro2cmakeJędrzej Nowacki2019-03-261-11/+23
| | | | | | | | | | We can use all cores. Sadly it doesn't balance cores well as corelib.pro takes most of the time anyway, but the speedup is visible from ~15 to 5 min. Change-Id: Id8209c58491b38d19c6e9f1163d366c3e33a182c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
* Temporarily disable the opengles2 feature on WIN32Alexandru Croitor2019-03-211-0/+3
| | | | | | | | | | | | | | | | | | The feature used to be implicitly enabled because qt source ships with ANGLE sources, and thus ANGLE could always be built. Yet because the CMake port of ANGLE is not done yet, and because the feature is implicitly enabled, the build failed when trying to find GLES headers. To provide a nicer out-of-the-box configuring of the Windows build, disable the opengles2 feature on Windows, to default to a desktop GL build. It can be re-enabled once (if) ANGLE porting is done. After this change, you shouldn't need to pass any additional custom FEATURE_foo options to cmake to build qtbase on Windows. Change-Id: I94c96d8ef70cf671d2ce0198311f70b55fa642b1 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Fix sub-architecture (instruction sets / SIMD) handlingAlexandru Croitor2019-03-211-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | In qmake there are at least 2 things to know regarding sub-architectures and instruction sets. Which instruction sets does the compiler know to compile for, represented by the various config.tests and features in qtbase/configure.json. And which instructions sets are enabled by the compiler by default, represented by the configure.json "architecture" test and accessed via QT_CPU_FEATURES.$$arch qmake argument. Before this patch there was some mishandling of the above concepts in CMake code. The former can now be checked in CMake with via TEST_subarch_foo and QT_FEATURE_foo (where foo is sse2, etc). The latter can now be checked by TEST_arch_${TEST_architecture_arch}_subarch_foo (where foo is sse2, etc and the main arch is dynamyicall evaluated). The configurejson2cmake script was adjusted to take care of the above changes, and the cmake files were regenerated as well. Change-Id: Ifbf558242e320cafae50da388eee56fa5de2a50c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* CMake: pro2cmake.py: Report more qmake variables as usedTobias Hunger2019-03-201-6/+10
| | | | | | | | Report some more qmake variables as used when they are used to decide which kind of target to write. Change-Id: Id2602bb8cc07130456c04c53148acb73f21b0f21 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>
* CMake: pro2cmake.py: Handle "target.path" and "INSTALLS = target"Tobias Hunger2019-03-201-1/+9
| | | | | | | | Add installation location information into CMakeLists.txt files if available in CMake. Change-Id: I498deac71b1cc33c7d30790e32da236afdcb23af Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io>