conan-io / cmake-conan

CMake wrapper for conan C and C++ package manager
MIT License
828 stars 251 forks source link

Unable to build example project of https://github.com/conan-io/cmake-conan/tree/develop2 #490

Open laxmij-cmd opened 1 year ago

laxmij-cmd commented 1 year ago

machine: CentOS Linux release 7.9.2009, 8.5.2111 Error:

example-conan2 0

Please help in resolving the issue.

laxmij-cmd commented 1 year ago

adding... fmt-config.cmake is present in cmake-conan/build/conan/build/Release/generators/fmt-config.cmake

memsharded commented 1 year ago

Hi @laxmij-cmd

Could you please provide the full output and your conanfile.txt? Also not as an image, but as text (with triple backticks), that helps reading it. It is important also to run latest Conan 2.0.2, please double check that.

laxmij-cmd commented 1 year ago

conan version - 2.1.0-dev conanfile.txt: [requires] fmt/9.1.0

[layout] cmake_layout

ERROR: ''' CMake Error at conan_support.cmake:152 (string): string sub-command JSON member 'graph node 0 generators_folder' was not found. Call Stack (most recent call first): conan_support.cmake:168 (conan_install) CMakeLists.txt:7 (find_package) ''' Due to above error it is not able to get fmt-config.cmake which is existing in cmake-conan/build/conan/build/Release/generators/fmt-config.cmake

laxmij-cmd commented 1 year ago

machine: CentOS Linux release 7.9.2009, 8.5.2111

memsharded commented 1 year ago

It might be possible that develop2 branch (the one that you are running apparently) doesn't have all the changes released in latest 2.0.2 (branch release/2.0) merged back. I'd suggest trying with released 2.0.2 or release/2.0 branch, please let us know.

laxmij-cmd commented 1 year ago

from where I can access release/2.0? I cannot see at https://github.com/conan-io/cmake-conan/

memsharded commented 1 year ago

That is the Conan version, not the cmake-conan version.

You reported above conan version - 2.1.0-dev, which should only happen if you are running Conan from source (or are you getting it from PyPITest?). You can change the branch in the Conan repo to release/2.0 and pull changes.

laxmij-cmd commented 1 year ago

I initially run with conan 2.0 and cmake 3.24, still got same error, so changed to this version of conan. Is develop2 branch of cmake-conan is not stable?

memsharded commented 1 year ago

Yes, develop2 branch of cmake-conan is not stable, it is in the Readme:

⚠️ Compatibility with Conan 2.0: integration with Conan 2.0 is currently experimental, may have some limitations, and is subject to change, please read below. The code in this branch only supports Conan 2.0.2 and ablove - if you need Conan 1.x please check the develop branch.

This is the very first iteration over this, it is expected that this will evolve a lot in the following weeks

Still, this has nothing to do with the Conan version. You are running develop2 branch in the Conan repo, not in the cmake-conan repo.

laxmij-cmd commented 1 year ago

When I said "develop2" I meant "develop2" branch of cmake-conan. Sorry for the confusion.

My steps were:

  1. conan from release 2.0
  2. cmake-conan from develop2
  3. Try to build example of cmake-conan This resulted in the error which I shared.

My project is cmake based. For this reason I was trying out above steps.

memsharded commented 1 year ago
  1. conan from release 2.0

This is what seems to be a bit off. Can you please clarify how did you installed it? Because the message conan version - 2.1.0-dev is not expected from the Conan repo in the release/2.0 branch, it only happens in the develop2 branch. And my suggestion here is running release/2.0 branch in the Conan repo.

laxmij-cmd commented 1 year ago

conan 2.1.0-dev is not from conan repo in the release/2.0 branch. These were 2 different steps. I think now I understand the reason of my problem. Thanks for your help