conan_cmake_run fails when conan is installed locally (not system-wide)
See original GitHub issueCMake:
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
message(STATUS "Downloading conan.cmake from https://github.com/memsharded/cmake-conan")
file(DOWNLOAD "https://raw.githubusercontent.com/conan-io/cmake-conan/master/conan.cmake"
"${CMAKE_BINARY_DIR}/conan.cmake")
endif()
include(${CMAKE_BINARY_DIR}/conan.cmake)
conan_cmake_run(CONANFILE conanfile.txt # or relative build/conanfile.txt
BASIC_SETUP CMAKE_TARGETS
BUILD missing)
Output:
-- Conan ** WARNING** : This detection of settings from cmake is experimental and incomplete. Please check 'conan.cmake' and contribute
-- Conan executing: conan install -f=/home/sztomi/Projects/MyCoolProject/conanfile.txt -g cmake -s build_type=Debug -s os=Linux -s compiler=gcc -s compiler.version=6.3 -s compiler.libcxx=libstdc++11 --build=missing
CMake Error at cmake-build-debug/conan.cmake:221 (message):
Conan install failed='No such file or directory'
Call Stack (most recent call first):
cmake-build-debug/conan.cmake:298 (conan_cmake_install)
CMakeLists.txt:14 (conan_cmake_run)
However, when I run the same command from the command line, it works. Tried CMake 3.7 (bundled) and 3.8 with the same result.
Issue Analytics
- State:
- Created 6 years ago
- Comments:19 (5 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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.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 viapip install conan --user
, so it lives in ~/.local/bin)