[Bf-committers] cmake bash utilities

Brecht Van Lommel brecht at blender.org
Mon Oct 26 22:15:51 CET 2009


Hi,

Here's some bash commands I use for cmake. I know certain developers
are still using makefiles because they miss these things :).

* cmake command is overridden to strip progress prints, these are too
much when rebuilding only a few files.
* mk command to build from any directory in the source.

These changes can't be applied to the cmake files in svn since the
prints are hardcoded in the cmake code, and cmake requires out of
source builds. Put in $HOME/.profile or similar to use.

Brecht.
-------------- next part --------------

function cmake_make_any_dir()
{
	local prevdir=$(pwd);
	while [ ! -f ../cmake/CMakeCache.txt ]; do
		cd ../
	done
	cd ../cmake;
	make -j4;
	sed -i -e "/@echo/d" CMakeFiles/Makefile2;
	sed -i -e "/progress_report/d" CMakeFiles/Makefile2;
	cd $prevdir;
}

function cmake_silent()
{
	cmake $@;
	sed -i -e "/@echo/d" CMakeFiles/Makefile2;
	sed -i -e "/progress_report/d" CMakeFiles/Makefile2;
}

alias cmake="cmake_silent"
alias mk="cmake_make_any_dir"


More information about the Bf-committers mailing list