Conan: Toolchain file included multiple times

Created on 15 Apr 2019  路  3Comments  路  Source: conan-io/conan

Hello,

I encountered the problem that my toolchain file seems to be included multiple times after conan install with conan version 1.14.3:

In conanfile.py I have the following lines:
cmake = CMake(self)
cmake.configure()
cmake.build()

whereas I call conan with
set CONAN_CMAKE_TOOLCHAIN_FILE=D:/scripts/Toolchain/Toolchain-conan.cmake
set CONAN_CMAKE_GENERATOR=NMake Makefiles
conan install . -b=package -if=D:__OUT -pr D:/scripts/Conan/profil_linux_armv7.txt

In my Toolchain-File"Toolchain-conan.cmake" I have a debug message which I would expected to be printed only once. Anyways - I can see it twice or more times. The Toolchain is included in no other kind of way, just by the conan call above.

Maybe you can help me whether there is an issue or I am just doing something wrong?

Best regards!

question

All 3 comments

Hi there,
I have observed such a behaviour too with toolchain files and CMake.
Without using Conan you will see the same message multiple times.

This is a CMake "issue". At CMake configuring phase there are serval steps which include the toolchain files by themself, what will print your message(s) each time.

Have a look at these search results: web search results

Hi @mario19911

Yes, the Conan recipe build() method will be called just once to build the package (and won't be called if reusing the binary), so the issue shouldn't be because of Conan.

Thanks very much @Johnnyxy for the help and the pointers.

So it seems that is a CMake thing, nothing from Conan, so it seems this issue can be closed. Please re-open or comment if necessary, thanks!

Hello,

thank you for the answers and the pointers :) this really helped me quite a lot.

Was this page helpful?
0 / 5 - 0 ratings