Bug 273516 - cmake jobs environment not editable
Summary: cmake jobs environment not editable
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: Build tools: CMake (show other bugs)
Version: git master
Platform: Arch Linux Linux
: NOR minor
Target Milestone: 4.2.0
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-05-17 22:41 UTC by Andrée 'Glakke'
Modified: 2011-12-02 18:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrée 'Glakke' 2011-05-17 22:41:13 UTC
Version:           git master (using KDE 4.6.2) 
OS:                Linux

In order to use CCACHE with CMAKE it is required to set CC and/or CXX variables accordingly:
'CC="ccache gcc" CXX="ccache g++" cmake'
When working correctly CMAKE outputs:
'-- Check for working C compiler: /usr/bin/ccache'
'-- Check for working CXX compiler: /usr/bin/ccache'
and not /usr/bin/gcc or any other compiler.

Changing CC and CXX environment variables in KDevelop 'Configure Environment Variables' doesn't work, and CMAKE still uses gcc/g++ instead of CMAKE.

Reproducible: Always

Steps to Reproduce:
Install CCACHE.
Set CC environment variable to "ccache gcc"
Set CXX environment variable to "ccache g++"
Run CMAKE.

Actual Results:  
CMAKE output (important part):
-- Check for working C compiler: /usr/bin/gcc
-- Check for working C compiler: /usr/bin/gcc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done


Expected Results:  
CMAKE output (important part):
-- Check for working C compiler: /usr/bin/ccache
-- Check for working C compiler: /usr/bin/ccache -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/ccache
-- Check for working CXX compiler: /usr/bin/ccache -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
Comment 1 Andreas Pakulat 2011-05-18 09:29:39 UTC
No idea why I was added to the cc-list, I don't work on kdevelop anymore.
Comment 2 Milian Wolff 2011-05-29 00:09:01 UTC
more or less this bug wants to use the environment stuff (which is currently only used for running user apps) also for running e.g. cmake or other things...

I can see how this could be useful.
Comment 3 Andrée 'Glakke' 2011-05-29 00:48:59 UTC
(In reply to comment #2)
> more or less this bug wants to use the environment stuff (which is currently
> only used for running user apps) also for running e.g. cmake or other things...
> 
> I can see how this could be useful.

Oh, so the 'environment stuff' is only used for running applications - that makes sense. And exactly, it would be useful if it was extended to building/configuring as well.
Comment 4 Andreas Pakulat 2011-11-30 20:57:41 UTC
fwiw: It already is used as well for the make-job part and yes it does make sense to add this capability to cmake as well.

That being said, its not necessary to set envvars to use ccache, at least not on all distributions. The debian package supplies a /usr/lib/ccache directory with symlinks named as the compiler-executables, putting that first in PATH makes everything use gcc/g++/c++ via ccache.
Comment 5 Aleix Pol 2011-12-02 18:50:50 UTC
Git commit 1de7caa8322271bf263960c545e2aa2a26ab6057 by Aleix Pol.
Committed on 02/12/2011 at 19:49.
Pushed by apol into branch 'master'.

Make it possible to define some environment variables to be run
on cmake executions.

These environment variables are integrated both in the CMake parsing
and the actual cmake executions inside KDevelop.

BUG: 273516

M  +12   -0    projectbuilders/cmakebuilder/cmakejob.cpp
M  +1    -0    projectbuilders/cmakebuilder/cmakejob.h
M  +3    -2    projectmanagers/cmake/CMakeLists.txt
M  +4    -1    projectmanagers/cmake/cmakemanager.cpp
M  +7    -0    projectmanagers/cmake/cmakeutils.cpp
M  +6    -1    projectmanagers/cmake/cmakeutils.h
M  +3    -1    projectmanagers/cmake/parser/cmakeparserutils.cpp
M  +2    -1    projectmanagers/cmake/parser/cmakeparserutils.h
M  +8    -2    projectmanagers/cmake/parser/cmakeprojectvisitor.cpp
M  +5    -4    projectmanagers/cmake/parser/cmakeprojectvisitor.h
M  +83   -42   projectmanagers/cmake/settings/cmakebuildsettings.ui
M  +10   -0    projectmanagers/cmake/settings/cmakepreferences.cpp
M  +1    -1    projectmanagers/cmake/tests/cmake_cmakeprojectvisitor_test.cpp
M  +2    -1    projectmanagers/cmake/tests/cmakecompliance.cpp
M  +1    -1    projectmanagers/cmake/tests/cmakeloadprojecttest.cpp

http://commits.kde.org/kdevelop/1de7caa8322271bf263960c545e2aa2a26ab6057