D
D
Denis2021-11-08 19:52:00
CMake
Denis, 2021-11-08 19:52:00

How to set up Qt creator + conan?

There is a project on cmake, I decided to use conan to manage dependencies.
If you collect from the console, then everything is ok:

conan install ..
cmake ..
cmake --build .


When building via Qt creator, an error occurs:
Unknown CMake command "conan_basic_setup".
it is cured if the command is executed from the assembly location
conan install -s build_type=Debug --build=missing /path/to/conanfile.txt


The question is:
How do I set up Qt creator to work with conan?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2021-11-09
@D3Nd3R

Found a solution:
In the main CMakeLists.txt, it's better to call the conan installation right after the project (...)

execute_process(COMMAND conan install --update --build=missing ${CMAKE_SOURCE_DIR})

and after that work with conan:
include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup(TARGETS)

A
Alexander Ananiev, 2021-11-08
@SaNNy32

https://doc.qt.io/qtcreator/creator-project-conan.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question