![]() In Qt 5, configure allowed you to build the host tools as well as the target tools and libraries in one step. A build environment for cross-compiling Qt applications requires Qt tools to be available on the host (think of moc, rcc), as well as Qt libraries to be built for the target. Cross-Compiling QtĬross-compilation is the act of compiling code for one computer system (the target) on a different system (the host). The -platform, -xplatform options are still available, but only used to set the defaults for the generated qmake tool. CMake does not use these, but instead relies on environment checks, and toolchain files (see also the CMake-toolchains documentation). In Qt 5, configure used so-called mkspecs to specify both the build and target platforms ( -platform, -xplatform, and -device options). Some dependencies like OpenSSL are also detected by logic within CMake: If OpenSSL is not picked up, you might need to set the OPENSSL_ROOT_DIR CMake variable so that it points to the installation directory. You can use the CMAKE_PREFIX_PATH variable to extend this path with custom locations. For most dependencies, this requires the third-party library to provide a CMake package in the CMake search path. In Qt 6, configure relies on CMake to resolve dependencies. ![]() These checks could be tweaked from the command line with various assignments like ICU_PREFIX, ICU_LIBS, etc. In Qt 5, configure optionally used pkg-config for this, but was also using various compile-time tests. One of the tasks of configure is to detect the availability of different third-party packages in the environment. Use ninja -t targets to see all available targets in the build. The build system of Qt 5 allowed you to run the build tool (for example make) in a sub-directory to do a partial re-build.ĬMake follows a different paradigm and requires you to build targets from the top-level directory, taking into account the whole build. The configure options above are not supported anymore. If you run configure with new options, the new options are merged into this file. Detected environment settings, but also selections done through other command-line arguments, are stored in a file called CMakeCache.txt. You also could use the -recheck, -recheck-all options to force a re-evaluation of cached tests.ĬMake and therefore configure in Qt 6 caches results even more aggressively. In Qt 5, configure cached various information from the environment between runs, but otherwise started from a clean state: You had to use -redo, or use the config.status shell script, to reuse arguments from a previous run. You sometimes want to re-run configure to test different configure options. The configure options -opensource, -commercial, and -confirm-license are ignored in Qt 6, and might be removed in future versions of Qt. The choice of licenses that are available to you depends on any legal contracts you have with The Qt Company, not on any artifacts. If you had multiple commercial licenses, you also had to select the license you wished to use. In Qt 5, configure required you to select whether you plan to use Qt under commercial or open-source licenses. See Building Qt Sources for a more detailed overview of the build requirements on different platforms. They are also available in the Qt Online installer. ![]() You must also have an up-to date version of the Ninja tool installed.īoth CMake and Ninja are open source tools that can be installed by various means. Starting with Qt 6.2, we require CMake 3.21 when building Qt as static libraries. You need a recent version of CMake to configure and build Qt. See also Qt Configure Options for an overview of the new configure API. However, we continue to recommend the configure command-line tool, which provides an arguably nicer interface, and additional error-checking. It is possible to configure Qt directly from the command-line by invoking cmake. You can still use qmake as a build tool for your applications. Note: This only affects users that want to build Qt from sources.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |