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

CMake run fails

Palando opened this issue · comments

CMake run fails with an error at a conan call.

-- The CXX compiler identification is GNU 10.2.1
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-10 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- ccache found and enabled
-- Downloading conan.cmake from https://github.com/conan-io/cmake-conan
-- Conan: checking conan executable
-- Conan: Found program /home/sascha/.local/bin/conan
-- Conan: Version found Conan version 1.23.0

-- Conan: Adding bincrafters remote repository (https://api.bintray.com/conan/bincrafters/public-conan)
-- Conan: Automatic detection of conan settings from cmake
-- Conan: Settings= -s;build_type=Debug;-s;compiler=gcc;-s;compiler.version=10;-s;compiler.libcxx=libstdc++11
-- Conan: checking conan executable
-- Conan: Found program /home/sascha/.local/bin/conan
-- Conan: Version found Conan version 1.23.0

-- Conan executing: /home/sascha/.local/bin/conan install . -s build_type=Debug -s compiler=gcc -s compiler.version=10 -s compiler.libcxx=libstdc++11 -g=cmake --build=missing
Configuration:
[settings]
arch=x86_64
arch_build=x86_64
build_type=Debug
compiler=gcc
compiler.libcxx=libstdc++11
compiler.version=10
os=Linux
os_build=Linux
[options]
[build_requires]
[env]

conanfile.txt: Installing package
Requirements
    catch2/2.13.3 from 'conan-center' - Cache
    docopt.cpp/0.6.2 from 'conan-center' - Cache
    fmt/6.2.0 from 'conan-center' - Cache
    spdlog/1.5.0 from 'conan-center' - Cache
Packages
    catch2/2.13.3:5ab84d6acfe1f23c4fae0ab88f26e3a396351ac9 - Cache
    docopt.cpp/0.6.2:a25d6c83542b56b72fdaa05a85db5d46f5f0f71c - Cache
    fmt/6.2.0:a25d6c83542b56b72fdaa05a85db5d46f5f0f71c - Cache
    spdlog/1.5.0:270d3115ab09f4c4851a4e1dfbd2e97254780788 - Cache

Installing (downloading, building) binaries...
catch2/2.13.3: Already installed!
docopt.cpp/0.6.2: Already installed!
WARN: spdlog/1.5.0: requirement fmt/6.2.1 overridden by your conanfile to fmt/6.2.0 
ERROR: docopt.cpp/0.6.2: Error in package_info() method, line 74
	self.cpp_info.components["docopt"].names["cmake_find_package"] = cmake_target
	TypeError: '_CppInfo' object is not subscriptable
CMake Error at cmake-build-debug-gcc-10/conan.cmake:402 (message):
  Conan install failed='1'
Call Stack (most recent call first):
  cmake-build-debug-gcc-10/conan.cmake:497 (conan_cmake_install)
  cmake/Conan.cmake:16 (conan_cmake_run)
  CMakeLists.txt:76 (run_conan)


-- Configuring incomplete, errors occurred!
See also "/home/sascha/Repositories/External/cpp_starter_project/cmake-build-debug-gcc-10/CMakeFiles/CMakeOutput.log".

[Finished]

A couple things to try:

  1. Conan version 1.23.0 is almost a year old, and the last few commits to the docopt.cpp recipe are from several months after that. It's possible that your version of Conan is no longer compatible with docopt; if that's the case, then updating Conan should fix the problem. Conan development happens quickly (they're on v1.33 now), and occasionally they break backwards compatibility.
  2. If the project built OK in the past, but it's not working now, try clearing your Conan cache and repeating your build.
  3. You can comb through the .travis.yml and .github/workflows/build_cmake.yml files and try to figure out the difference between your development environment and the CI environments. If the CI builds succeeded, then the CI config files will tell you exactly how to put together an environment that can build the project successfully.

This looks like a Python/Conan issue to me, and not an issue that's intrinsic to this project. I would be surprised if updating Conan does not fix this. If you're still unable to solve the issue, please let us know and we'll take a closer look.

Good luck, and I hope you can get it working!

This issue has been stale for six months. Since we have not heard any feedback in that time, I think it's safe to conclude that @Palando has solved the problem and forgotten about this issue. If you are still having trouble, please respond and we will reopen the issue.