Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] Local conan cache package use #185

Open
nikoladsp opened this issue Jun 10, 2024 · 1 comment
Open

[Question] Local conan cache package use #185

nikoladsp opened this issue Jun 10, 2024 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@nikoladsp
Copy link

Hi,
I am trying to make this plugin works with CLion 2024.1.2. I have a package made by conan that is private, and built locally - so it only exists in my local cache. I failed to figure out how to configure this plugin in CLion in this case. It does not detect my package from cache. Moreover, I am not sure how to configure CMake profiles so I can build and debug using CLion.

What I tried from console is:

export BUILD_TYPE=Debug
conan install . -pr profiles/gcc -s build_type="${BUILD_TYPE}"
cmake -DCMAKE_TOOLCHAIN_FILE="build/${BUILD_TYPE}/generators/conan_toolchain.cmake" -DCMAKE_BUILD_TYPE="${BUILD_TYPE}" -B "build/${BUILD_TYPE}" -S .
cmake --build "build/${BUILD_TYPE}"

Above commands work. They produces executable that link appropriate GraphicsMagick 1.3.43 (instead of system's 1.3.42).

But if I try to use from CLion it constantly refuses to find it. I tried adding CMake options to Debug profile:

-G "Unix Makefiles" -DCMAKE_TOOLCHAIN_FILE="build/Debug/generators/conan_toolchain.cmake" -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES="conan_provider.cmake" -DCONAN_COMMAND="~/.local/bin/conan" 

The output of the build is:

CMake Error at CMakeLists.txt:4 (find_package):
  Could not find a configuration file for package "graphicsmagick" that is
  compatible with requested version "1.3.43".

  The following configuration files were considered but not accepted:

    ~/project_conan/build/Debug/generators/graphicsmagick-config.cmake, version: unknown

I see there are files graphicsmagick-config-version.cmake (with set(PACKAGE_VERSION "1.3.43")) and build/Debug/generators/graphicsmagick-config.cmake

So in the end I am unsure did I do something wrong when building Conan package (asked this on their repo already), is there some problem in this plugin or CLion itself?

Thank you kindly

@czoido czoido self-assigned this Jun 10, 2024
@czoido
Copy link
Contributor

czoido commented Jun 10, 2024

Hi @nikoladsp,
Thanks for the question.
I can see that you are running some commands manually, but that should not be necessary using the plugin. You just need to use the UI of CLion and Conan will be launched automatically.
A couple of things:

  • The graphicsmagick package will not appear in the list of packages because there you will only have a list of packages that come from Conan Center.
  • If you want to use graphicsmagick just go to the generated conandata.yml remove the comment on the beginning of the file and add your requirement (see screenshot for example)
image

Also, please check the docs, you may start from a simple case, check that it works and then add your package for a simple example and see if everything goes fine.

Hope this helps.

@czoido czoido added the question Further information is requested label Jun 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants