Index: cmake.eclass =================================================================== --- cmake.eclass (revision 285) +++ cmake.eclass (working copy) @@ -2,10 +2,13 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -# -# Original Author: nelchael -# Purpose: Automate src_install and src_compile for packages using cmake -# +# @ECLASS: cmake.eclass +# @MAINTAINER: +# nelchael@gentoo.org +# @BLURB: wrap cmake +# @DESCRIPTION: +# The cmake eclass contains functions wrapping cmake to ease its usage in +# ebuilds. It allows both out of source and in source builds. inherit toolchain-funcs multilib @@ -16,13 +19,15 @@ CMAKE_BUILD_DIR="${WORKDIR}/cmake-build" -# If you want to build in source tree set CMAKE_IN_SOURCE_BUILD to anything: +# Some packages don't build out of source, so if you want to build in source +# tree set CMAKE_IN_SOURCE_BUILD to anything before inheriting cmake.eclass: [[ -n "${CMAKE_IN_SOURCE_BUILD}" ]] && CMAKE_BUILD_DIR="${S}" -# -# Prepare CMAKE_BUILD_DIR: -# - create the directory if it's missing -# +# @FUNCTION: prepare_build_dir +# @USAGE: +# @DESCRIPTION: +# Create the build directory if it doesn't exist, this function should not be +# used outside of this eclass. function prepare_build_dir() { if [[ ! -d "${CMAKE_BUILD_DIR}" ]]; then @@ -32,11 +37,10 @@ } -# -# Run cmake with some needed defines. -# If you want to add something use CMAKE_FLAGS. -# If you want verbose makefile set CMAKE_VERBOSE to anything. -# +# @FUNCTION: ecmake +# @USAGE: +# @DESCRIPTION: +# Run cmake to prepare makefiles, also prepares the build directory. function ecmake() { prepare_build_dir @@ -62,10 +66,11 @@ } -# -# Run `ecmake' and default make target. -# -cmake_src_compile() { +# @FUNCTION: cmake_src_compile +# @USAGE: +# @DESCRIPTION: +# Default src_compile for ebuilds using cmake, runs `ecmake' and then `emake'. +function cmake_src_compile() { ecmake @@ -75,13 +80,15 @@ } -# -# Change to build directory and run `make install'. -# -cmake_src_install() { +# @FUNCTION: cmake_src_install +# @USAGE: +# @DESCRIPTION: +# Default src_install for ebuilds using cmake, runs `emake install' in build +# directory. +function cmake_src_install() { pushd "${CMAKE_BUILD_DIR}" > /dev/null - make DESTDIR="${D}" install || die "make install failed" + emake DESTDIR="${D}" install || die "make install failed" popd > /dev/null }