Review Request: Store CMake build system settings per build directory rather than globally (TODO in cmakepreferences.cpp)

Ivan Shapovalov intelfx100 at
Mon Jul 2 00:13:34 UTC 2012

This is an automatically generated e-mail. To reply, visit:

(Updated July 2, 2012, 12:13 a.m.)

Review request for KDevelop and Aleix Pol Gonzalez.


1) made the diff to apply correctly (whitespace issues)
2) fixed some logic bugs (due to nightly coding)
3) implemented cache->config options fetching: i) at project load time (all build directories), ii) at configure time (only the build directory that's being configured)

Remark: 3.ii is a superset of what we've had in CMakePreferences::save() before. It's also useful for newly added build directories via CMake::checkForNeedingConfigure(), so I've moved that fetch to configure job (which follows both CMakePreferences::save() and CMake::checkForNeedingConfigure()).


This addresses the TODO at the beginning of cmakepreferences.cpp, making
CMake build system settings saved in the project configuration file
separately for each configured build directory.
This is now done by using sub-groups per each configured build directory (as suggested by Andreas).
Specifically, 5 places have been changed:
* cmakeconfig.kcfg: dropped.
* cmakeutils.{h,cpp}: functions changed to use multiple groups.
* cmakepreferences.{h,cpp}: functions changed to use primitives from cmakeutils.{h,cpp} + commented out
the save() call on build directory creation since it is somewhat annoying.
* cmakejob.cpp: cmakeArguments() had been changed to make it use
temporary variables instead of calling each fetch function twice.
* cmakemanager.cpp: on project load there is attempt to migrate the configuration file to new format.

URLs are saved to via KUrl::url().

Diffs (updated)

  projectbuilders/cmakebuilder/cmakejob.cpp af05577 
  projectmanagers/cmake/CMakeLists.txt dc013f4 
  projectmanagers/cmake/cmakeconfig.kcfg 5ca623e 
  projectmanagers/cmake/cmakeconfig.kcfgc d580702 
  projectmanagers/cmake/cmakemanager.cpp ad496e7 
  projectmanagers/cmake/cmakeutils.h 5586d4d 
  projectmanagers/cmake/cmakeutils.cpp 3c9b736 
  projectmanagers/cmake/settings/cmakepreferences.h 4195948 
  projectmanagers/cmake/settings/cmakepreferences.cpp 5be668b 



Used two build directories on a project, one configured to build with MinGW via -DCMAKE_TOOLCHAIN_FILE.
Ensured the settings are saved and applied correctly across build directory switch and KDevelop multiple restart.
Existing projects' configurations are picked up correctly.

All unit-tests are also passed.


Ivan Shapovalov

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the KDevelop-devel mailing list