cpp-best-practices / gui_starter_template

A template CMake project to get you started with C++ and tooling

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Conan not found when installed through winget

LtdSauce opened this issue · comments

I have installed conan on my windows machine through winget with the following command:
winget install "Conan Package Manager". After cloning and configuring the project cmake reported that it cannot find conan.
After a little investigation i found out, that conan is installed as "Conan" through winget. The cmake find_package call unfortunatly searches for "conan". Thus it cannot find conan when installed with winget.

It looks like the problem is in the downloaded conan.cmake file from conan.io.
If Line 793 in the downloaded conan.cmake file is changed from find_program(CONAN_CMD conan) to find_program(CONAN_CMD conan Conan) it works. I try to report the issue in the conan.io repository.

I opened cmake-conan issue 385 for this. I`ll leave this open until it is fixed there.

find_program searches for conan.exe. Does winget install conan as Conan.exe? That is strange and it is a bug in winget if that's the case, not CMake.

I'll check as soon as i have a spare minute :)

But one note: Aren't many Powershell commands UpperCamelcase?

I'll check that as well... Maybe my Clion/Powershell combination has something to do with this issue 🤷‍♂️

I'll check as soon as I have a spare minute :)

But one note: Aren't many Powershell commands UpperCamelCase?

I'll check that as well... Maybe my Clion/Powershell combination has something to do with this issue 🤷‍♂️

PowerShell's built-in commands are case insensitive. I always use them as lowercase to prevent confusion.

From my memory:
When i tried executing conan Powershell told it could not find it while Conan produced the expected output. (But that is exactly what find_program told me as well...).

I'll see if other executables are also installed case sensitive on my machine, altgough that whould be strange i guess...

wow... i feel super stupid right now... "have you tried turning it off and on again"

Actually after turning my pc on again after a week or so, PowerShell, CMD and cmakes configure inside CLion find both conan and Conan...

So my problem suddenly disappeared over night. I'll close this issue as it is no issue for me anymore. Never thought i need Windows to reboot so that it finds the lowercase version of that executable.

And thanks @aminya for your responses :)