Comments (19)
Interestingly, it fails the same way in KDevelop. My guess is that the conan
executable is not found because I don't have it system-wide installed (I installed via pip install conan --user
, so it lives in ~/.local/bin)
from cmake-conan.
I ended up using sudo ln -s ~/.local/bin/conan /usr/bin/conan
both methods work I didn't know I could use the find_program outside the conan.cmake. I had a custom conan.cmake for a while where I was doing that.
from cmake-conan.
Here's a related post on SO: http://stackoverflow.com/a/37663546/2515282
I've never used CLion myself, but it looks like a clean solution to add your ~/.local/bin
to CLion's PATH.
from cmake-conan.
Yeah, lets leave this open until we review the CLion flow too. Though it seems that the possible solution could be what @sixten-hilborn is pointing, because trying to detect the user's shell and loading the path from there, could be too complex and fragile, specially if we want to achieve that multi-OS. But we will have a look. Thanks everyone!
from cmake-conan.
Just FYI this is also a problem in Qt Creator. It can be worked around with sudo ln -s ~/.local/bin/conan /usr/local/bin/conan
. I haven't yet investigated if it could be fixed in other way.
from cmake-conan.
Yep, after symlinking conan to /usr/bin, it works without a hitch.
Thank you! Had the same issue with yuzu emulator. Fixed with symlink:
sudo ln -s ~/.local/bin/conan /usr/bin/conan
from cmake-conan.
from cmake-conan.
Yep, after symlinking conan to /usr/bin, it works without a hitch.
from cmake-conan.
I think cmake-conan
has a configurable CONAN_COMMAND
where you could provide the full path to conan executable. Is there any other suggestion of anything we could fix? Not sure what we could do to improve this issue.
from cmake-conan.
Sorry I wasn't very explicit about this, but ~/.local/bin is in my $PATH (set in .bashrc), so I would expect the default conan
command to work (without an absolute path). As mentioned, if I copy the logged command line to my terminal it works; and I think it should from cmake invoked via an IDE as well.
from cmake-conan.
Thanks for clarifying! But the thing is that the IDE might not be using your .bashrc to set the $PATH, so from the IDE point of view it isn't there. Could this be the issue?
from cmake-conan.
Yes, I think that's the issue. It's probably solvable by detecting the user's shell and loading the path from there. I assume there are more urgent issues on the backlog, but I'd appreciate if this could be kept open, maybe someone has valuable input on it. After all, this is (from a user point of view) a simple setup. I installed conan via pip and this cmake script can't invoke it via execute_process (I really don't want to install it system-wide because it tends to mess with my package manager).
from cmake-conan.
a note about clion: i was not able to modify PATH inside clion without breaking other things (even if it worked, you would have to do it for each build type...).
for linux, assuming you have conan installed via pip, the simplest solution is to launch clion from a shell (where ~/.local/bin
is already in the path). clion is a bit hidden: ~/.local/share/JetBrains/Toolbox/apps/CLion/ch-0/173.4548.31/bin/clion.sh
a cleaner solution would be to setup CONAN_COMMAND and pass it to conan_cmake_run but then we would need to handle all possible conan locations inside our cmake scripts...
from cmake-conan.
Thanks for the feedback @mistafunk
Unfortunately I can't think of any way to improve your issues from this cmake-conan project. A better integration with CLion will help, and it is something that is under consideration right now.
from cmake-conan.
Yep, after symlinking conan to /usr/bin, it works without a hitch.
Thank you! Had the same issue with yuzu emulator. Fixed with symlink:
sudo ln -s ~/.local/bin/conan /usr/bin/conan
Thanks, this worked for me to compile Yuzu.
from cmake-conan.
Many years later we ran into the same problem (just not with conan). I don't think that symlinking is the right solution, it's more of a bandaid. Our solution was using find_program
and passing ~/.local/bin as a hint. Then, CMake was able to find the binary and now we could execute it with the full path.
from cmake-conan.
Yeah similarly:
find_program(CONAN_BIN NAMES conan PATHS $ENV{HOME}/.local/bin)
conan_cmake_run(CONANFILE "conanfile.py"
BUILD missing
# specify conan installed from the user local directory
CONAN_COMMAND "${CONAN_BIN}")
Works for us.
from cmake-conan.
I was using this but it required I alter the existing conan.cmake.
find_program(CONAN_BIN NAMES conan PATHS $ENV{HOME}/.local/bin)
This I found was more useful in the long run. Thanks for the help.
sudo ln -s ~/.local/bin/conan /usr/bin/conan
from cmake-conan.
I was using this but it required I alter the existing conan.cmake.find_program(CONAN_BIN NAMES conan PATHS $ENV{HOME}/.local/bin)
This I found was more useful in the long run. Thanks for the help.
sudo ln -s ~/.local/bin/conan /usr/bin/conan
Sorry, which one do you use? find_program or ln -s.
Because, in my case, I need to use the ln -s.
from cmake-conan.
Related Issues (20)
- Different formatting of msvc runtime value conan_provider.cmake
- Installing only certain packages HOT 8
- [develop2] Question: How stable is the current state HOT 2
- tools.build:compiler_executables breaks build with Autotools and Xcode HOT 3
- [develop2] detect_compiler() detects invalid 'settings.compiler.version' for apple-clang
- [develop2] Can conan_provider.cmake work with add_subdirectory HOT 6
- find_program working when building from command line, but not when using the CLion Conan plugin HOT 11
- [bug] generated settings.yml missing Macos.version "14.2", causes build failures HOT 10
- [develop2, BUG] Unknown arguments specified in conan_provider.cmake:519 HOT 2
- Unable to cross compile openssl/3.x.x on develop2 HOT 6
- Using "build-scripts" package via tool_requires() not working HOT 2
- [develop2] CMAKE_CONFIGURATION_TYPES with custom build types not getting dependencies added properly HOT 3
- ERROR: Invalid setting '6' is not a valid 'settings.compiler.version' value HOT 2
- 【conan install】conan_provider.cmake downloads packages from source because detect_host_profile generates compiler.cppstd=xx in the cmake-build-release/conan_host_profile file with the detect_host_profile method HOT 5
- cmake bootstrapping fails if not on PATH HOT 3
- Not working with conan editable mode HOT 5
- Update readme with more details HOT 1
- MSVC version update HOT 6
- [question] Using layout and -of together Conan 2 HOT 4
- Some "url" attributes causes cmake-conan to fail HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cmake-conan.