conan-io / conan-clion-plugin

CLion C/C++ IDE plugin for Conan Package Manager
Apache License 2.0
99 stars 27 forks source link

Add support for WSL #6

Open mpusz opened 6 years ago

mpusz commented 6 years ago

When I build projects on Windows using i.e. gcc on WSL, I am not able to match CMake and Conan profiles as the configuration from WSL is not read by the plugin and there is no way to provide a configuration name by hand.

yahavi commented 6 years ago

@mpusz, thanks for reporting this issue.

I have questions:

  1. Does CLion UI run on Windows or Ubuntu? Please elaborate more about your environment.
  2. Can you elaborate if you can see CMake profiles in the profile matching table? If not, it may be a CLion issue.
mpusz commented 6 years ago
  1. CLion runs on Windows and is connecting to WSL via SSH (I think)
  2. I was able to see only local profiles and not the ones on WSL
jgsogo commented 5 years ago

First request after publishing the blog post in Jetbrains: https://blog.jetbrains.com/clion/2019/05/getting-started-with-the-conan-clion-plugin/#comment-96977

buddha314 commented 4 years ago

Any status on this?

vortarian commented 3 years ago

I was able to resolve this by following this comment from conan (which automatically ran it all during the wsl build on clion): https://docs.conan.io/en/latest/howtos/cmake_launch.html

Resulting cmake snippet:

set(CMAKE_CXX_STANDARD 17)

# Download automatically, you can also just copy the conan.cmake file
if(NOT EXISTS "${CMAKE_BINARY_DIR}/conan.cmake")
    message(STATUS "Downloading conan.cmake from https://github.com/conan-io/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(REQUIRES Catch2/2.6.0@catchorg/stable BASIC_SETUP CONANFILE conanfile.txt BUILD missing)

include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
conan_basic_setup()
chemio9 commented 2 years ago

The same question. Any status here? The clion is installed on windows,and conan is installed in ubuntu.

I try modifying the conan launch path to ubuntu2004.exe run ‘~/.local/bin/conan’ This works in powershell (concat conan‘s parameters ) but it doesn’t work in clion.

(sorry for my poor English)

memsharded commented 2 years ago

Yes, the status is "on hold". We are working very hard to get Conan 2.0 out (already in alpha), and at the moment we don't have enough time to put on the IDE plugins, sorry. We will resume work after 2.0 GA.

chemio9 commented 2 years ago

That's fine, I can install the dependencies manually and hope to use Conan 2.0! :smile:

Daniel599 commented 1 year ago

Hi, any update on this? I am testing conan 2. I am also using windows-based CLion with WSL linux cpp project

Edit: I found out that the plugin uses cmake-conan (thanks to this ) And I finally found my mistake: the plugin needs conan path like it's inside WSL, e.g /usr/local/bin/conan without $wsl stuff, since it runs during the cmake phase which is already inside WSL

memsharded commented 1 year ago

Hi all,

Conan 2.0 got a new plugin version for CLion that is based on the new develop2 version of cmake-conan. Both are experimental, but looking really good and promising.

Effectively, using WSL for Conan is like running in a regular Linux machine. The Conan running should be the one inside WSL. I guess that you read the instructions at the README.

So if this is working fine, maybe we can close the issue? Things are working good both from CLion and cmake-conan integrations for this use case? Thanks for the feedback!

Daniel599 commented 1 year ago

It works for me. Maybe it's just me, but I think there should be a note in the README regarding WSL: that the path should be inside WSL itself.