Bug 248487

Summary: CMake configuration does not honor environment variables
Product: [Applications] kdevelop Reporter: Romain <rlerallut>
Component: Build tools: CMakeAssignee: kdevelop-bugs-null
Status: RESOLVED NOT A BUG    
Severity: normal CC: aleixpol, mail, wahaj_ahmad
Priority: NOR    
Version: 4.0.1   
Target Milestone: 4.1.0   
Platform: Debian testing   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Romain 2010-08-20 11:14:29 UTC
Version:           4.0.1 (using KDE 4.4.5) 
OS:                Linux

I configure my cmake-based project using environment variables when I run cmake (e.g. to set the compiler to icecc). I tried to set these variables in the "Environment" part of the global Kdevelop settings but they are not used when CMake is run when I do "Configure Projects".

Am I missing something ? Is it a bug ?

Hope this helps,
Romain


Reproducible: Always

Steps to Reproduce:
1. in a CMakeLists.txt, add a MESSAGE("foo ? " $ENV{FOO} )
2. check in a shell that "FOO=BAR cmake ..." does echo "foo ? BAR"
3. in the environment variables part of kdevelop's configuration dialog, add variable=FOO value=BAR
4. run cmake by using the menu "Project->Configure selection"


Actual Results:  
The FOO variable is empty, and the MESSAGE only echoes "foo ? "

Expected Results:  
I would have expected the environment variables to be set for all jobs (cmake, compilation, etc).

I use zsh as my login shell.
Comment 1 Aleix Pol 2011-03-08 02:20:18 UTC
You should get the same environment variables as the ones that were defined when kdevelop was started.

If that's not what you want, please reopen as a wish.
Thanks
Comment 2 Wahaj Ahmad 2018-10-16 07:30:03 UTC
Facing same issue, cmake cannot get the Environment variables

Also reported here https://stackoverflow.com/questions/9856251/how-can-i-get-kdevelop-to-recognize-environment-variables-in-ubuntu
Comment 3 Sven Brauch 2018-10-16 07:43:15 UTC
The linked stackoverflow thread has the answer to your question as well: you most probably do not have your environment variables exported in the environment you start KDevelop from (krunner, menu, ...). Try starting it from the shell: then it should work.

If that is not the issue, please re-open.
Comment 4 Wahaj Ahmad 2018-10-30 08:10:36 UTC
Oh my mistake, not a bug, thank you !