Set(CMAKE_PREFIX_PATH /usr/local/Trolltech/Qt-5.15.7-64)įind_package(Qt5 COMPONENTS Core REQUIRED) Project(helloworld VERSION 1.0.0 LANGUAGES CXX) Suppose we have a source file main.cpp with the following contents:Īnd a CMakeLists.txt with the following contents: However, when I copy one of the compiler calls used by Xcode for our real project and execute it on the command line, I get the warning, and when I change “-F” to “-iframework” I do not get the warning. So far I haven’t been able to create a small example that also shows the above warning. I created a small example that shows the “-F”/"-iframework" difference. When building the project on the command line with CMake/make, “-iframework” is used. The problem seems to be that Qt frameworks are included using the “-F” flag instead of the “-iframework” flag. This is a warning we explicitly enable, but we do not want to see warnings about the code of 3rd party libraries when we compile our project. Qvector.h:174:35: warning: implicit conversion loses integer precision: ‘typename iterator_traits::difference_type’ (aka ‘long’) to ‘const int’ When we use CMake to generate an Xcode project and then build the project, we get warnings for Qt code, usually QVector: We have a C++ project that uses Qt and we are in the process of switching from make/qmake to CMake as our build tool.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |