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
No idea why I was added to the cc-list, I don't work on kdevelop anymore.
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.
(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.
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.
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