![]() ![]() If you have several Qt installations, make sure to select the same toolchain as the one you specified in CMAKE_PREFIX_PATH.įor more information about Windows toolchains, refer to the MinGW or MSVC section of our Windows Tutorial. In CLion, go to Settings( Control+Alt+S), navigate to Build, Execution, Deployment | Toolchain and select the toolchain that matches your Qt installation. When installing Qt on Windows, pick the distributive that matches the environment you are using in CLion, MinGW or MSVC.įor MinGW, both the version and the bitness (32-bit MinGW or MinGW-w64) should match with your toolchain setup. Target_link_libraries(helloworld Qt5::Widgets) Setting up a Qt project in CLion Toolchains on Windows ![]() CMakeLists.txt for a Qt projectĪdd the find_package command to locate the required libraries and header files. Take the following steps to configure CMakeLists.txt for your Qt project. CMake-based Qt projectsįor CMake version 3.0 and newer, Qt ships the modules that let CMake find and use Qt4 and Qt5 libraries. ![]() You can generate compile_commands.json for your qmake project with the help of scan-build or via the Build | Generate Compilation Database action in Qt Creator, then open this file as a project in CLion and add custom build targets and custom Run/Debug configurations for it. You can also create a CMake-based Qt project in CLion using the New Project wizard.Īnother option to open a Qt project is to use a compilation database. However, when converted into CMake, it can be opened and managed as a regular CMake application. Qt uses its own build system, qmake, and also supports building with CMake starting from the version Qt4.Ī pure Qmake project can't be imported in CLion directly. Qt is a cross-platform C++ framework for creating GUI applications. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |