Giter Site home page Giter Site logo

Comments (19)

sztomi avatar sztomi commented on July 20, 2024 2

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.

Sebanisu avatar Sebanisu commented on July 20, 2024 2

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.

sixten-hilborn avatar sixten-hilborn commented on July 20, 2024 1

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.

memsharded avatar memsharded commented on July 20, 2024 1

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.

ArekPiekarz avatar ArekPiekarz commented on July 20, 2024 1

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.

Kuphi avatar Kuphi commented on July 20, 2024 1

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.

Renari avatar Renari commented on July 20, 2024 1

from cmake-conan.

sztomi avatar sztomi commented on July 20, 2024

Yep, after symlinking conan to /usr/bin, it works without a hitch.

from cmake-conan.

memsharded avatar memsharded commented on July 20, 2024

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.

sztomi avatar sztomi commented on July 20, 2024

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.

memsharded avatar memsharded commented on July 20, 2024

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.

sztomi avatar sztomi commented on July 20, 2024

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.

mistafunk avatar mistafunk commented on July 20, 2024

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.

memsharded avatar memsharded commented on July 20, 2024

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.

dukenukemx avatar dukenukemx commented on July 20, 2024

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.

sztomi avatar sztomi commented on July 20, 2024

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.

Renari avatar Renari commented on July 20, 2024

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.

Sebanisu avatar Sebanisu commented on July 20, 2024

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.

chriztheanvill avatar chriztheanvill commented on July 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.