A qmake generator will generate a
conanbuildinfo.pri file that can be used for your qmake builds.
$ conan install . -g qmake
CONFIG and include the file in your existing project
# ... CONFIG += conan_basic_setup include(conanbuildinfo.pri)
This will include all the statements in
conanbuildinfo.pri in your project.
Include paths, libraries, defines, etc. will be set up for all requirements you have defined in
If you’d rather like to manually add the variables for each dependency, you can do so by skipping the CONFIG statement and only include
# ... include(conanbuildinfo.pri) # you may now modify your variables manually for each library, such as # INCLUDEPATH += CONAN_INCLUDEPATH_POCO
qmake generator allows multi-configuration packages, i.e. packages that contains both debug and release artifacts. Lets see an example:
There is a complete example in https://github.com/memsharded/qmake_example This project will depend on a multi-configuration (debug/release) “Hello World” package, that should be installed first:
$ git clone https://github.com/memsharded/hello_multi_config $ cd hello_multi_config $ conan create . user/channel
This hello package is created with cmake, but that doesn’t matter, it can be consumed from a qmake project:
Then, you can get the qmake project and build it, both for debug and release (this example has been tested on linux):
$ git clone https://github.com/memsharded/qmake_example $ cd qmake_example $ conan install . $ qmake $ make $ ./helloworld > Hello World Release! # now lets build the debug one $ make clean $ qmake CONFIG+=debug $ make $ ./helloworld > Hello World Debug!
Check the Reference/Generators/qmake for the complete reference.