intellij-direnv icon indicating copy to clipboard operation
intellij-direnv copied to clipboard

Can't give Clion tools to import cmake projects

Open Atemu opened this issue 3 years ago • 5 comments

I've got a pretty simple Clion project on macOS that I also want to be able to work on from NixOS.

I've added a shell.nix like this:

{ pkgs ? import <nixpkgs> {} }:

pkgs.mkShell {
  nativeBuildInputs = with pkgs; [
    cmake
  ];

  CMAKE_MAKE_PROGRAM = "make";
  CMAKE_C_COMPILER = "$CC";
  CMAKE_CXX_COMPILER = "$CXX";
}

but Clion's cmake loading can't see these variables and fails to do anything, complaining that they're not set.

In the IDE's terminal, the variables are set and I can execute the tools as expected.

Atemu avatar Apr 27 '21 05:04 Atemu

Could you please post your .envrc?

fehnomenal avatar Apr 28 '21 22:04 fehnomenal

It's just use nix.

Atemu avatar Apr 29 '21 09:04 Atemu

This is still an issue unfortunately, any hints to what could cause this?

Atemu avatar Apr 25 '22 08:04 Atemu

Sometimes I need to open the settings dialog twice for the variables to appear. If this does not help the problem is maybe the same as #11. Does it work, when you launch clion from the terminal after direnv loaded the environment into the shell?

fehnomenal avatar Apr 26 '22 05:04 fehnomenal

It does indeed work when launching it from the terminal.

Atemu avatar Mar 07 '23 12:03 Atemu