How to extend cmake ?
CMake can be extended using cmake scripts. CMake comes with a bunch of scripts, under UNIX they are by default installed to /usr/local/share/CMake/Modules/. The KDE libraries install also a set of cmake modules into share/apps/cmake/modules/. The files located there will be prefered over the ones in the system global cmake module path. For detecting software packages there are FindFOO.cmake files, see http://www.cmake.org/Wiki/CMake_HowToFindInstalledSoftwareexternal link for how they work. You can also write macros in cmake. They are powerful enough to do most things you will need to build software, but they are not intended to be used as a general purpose programming language.