Conan: install_folder usage in CMakeDefinitionsBuilder can break custom generators

Created on 1 Aug 2019  路  5Comments  路  Source: conan-io/conan

To help us debug your issue please explain:

5021 moves install_folder outside the check for the generators. When we use a custom generator such as https://github.com/pepe82sh/ConanCmakeToolchainGenerator the CMakeDefinitionsBuilder cannot be used to get the cmake definitions.

This results in:
conanfile.txt: ERROR: Generator CmakeToolchain(file:conan_toolchain.cmake) failed
'ConanFile' object has no attribute 'install_folder'
ERROR: 'ConanFile' object has no attribute 'install_folder'

I'm not sure if this is the custom generator misusing CMakeDefininitionsBuilder, or the CMakeDefininitionsBuilder using install_folder when it should not.

I think the functionality this custom generator brings are great and I am willing to have a look to fix this in a good way (on conan or CmakeToolchain), but for now I am clueless :-).

low low feature

Most helpful comment

All credits go to @pepe82sh ! No hurry it is possible to circumvent it by just setting an empty install folder.

All 5 comments

Able to reproduce it with:

git clone  https://github.com/pepe82sh/ConanCmakeToolchainGenerator
cd ConanCmakeToolchainGenerator
conan create . user/testing

Hi @mjvk

This shouldn't be considered a bug, because you are using internal private components of Conan which are not documented nor stable :)

However, as in the context of a generator it seems reasonable that the generator itself should have the install_folder defined. I am submitting a PR (https://github.com/conan-io/conan/pull/5569) that could fix this. How urgent it is? Why might try to release a 1.18.1 patch if necessary.

What I really like is your generator. We are currently reviewing Conan approach to integrate build systems and we definitely want to generate a toolchain, just like you are doing. We will certainly take some ideas and learning from it, thanks very much for sharing!!

All credits go to @pepe82sh ! No hurry it is possible to circumvent it by just setting an empty install folder.

The generator was an idea that emerged in #2956. Thanks for the mention @mjvk !

This has been merged, will be released in 1.19

Was this page helpful?
0 / 5 - 0 ratings

Related issues

uilianries picture uilianries  路  3Comments

db4 picture db4  路  3Comments

bobeff picture bobeff  路  3Comments

mpdelbuono picture mpdelbuono  路  3Comments

niosHD picture niosHD  路  3Comments