Path Variables not recognized in MakeFile

Answered

Hi,

I'm working with a big project using MakeFiles for each of it's modules. I ran a build successfully from the command line (using MinGW), on the whole application, and now I'm trying to set up the environment on CLion.

I configured the MinGW Toolchain, and added the Path Variables (Appearance & Behavior -> Path Variables), that are used by the MakeFile. However when I try to run a build of the module with that MakeFile (as a new Project on CLion), the Path Variables are somehow not being replaced correctly when running through the MakeFIle:

Example:

In the Path Variables I added:
HOME: C:\workspace\home

In the MakeFile the first line is:

include $(HOME)/src/Makefile.inc

The Build Console returns:

C:\Qt\Qt5.12.5\Tools\mingw730_32\bin\mingw32-make.exe --just-print --print-directory --keep-going all
mingw32-make: Entering directory 'C:/workspace/home/src/tools/module'
Makefile:7: /src/Makefile.inc: No such file or directory

The last line shows that the path including the Path Variable is not being evaluated correctly.

Also I'm working on Windows.

Thank you

0
1 comment

Hi Michel!

Unfortunately, at the moment in CLion there is no convenient way to specify environment variables for Makefile projects. Feel free to comment or upvote https://youtrack.jetbrains.com/issue/CPP-24318. See https://intellij-support.jetbrains.com/hc/en-us/articles/207241135-How-to-follow-YouTrack-issues-and-receive-notifications if you are not familiar with YouTrack.

As a workaround you can try specifying your environment in cmd.exe and then running CLion from this environment. This way CLion will use all environment variable that you set up in command line.

0

Please sign in to leave a comment.