buildblocks/gtest: added

This commit is contained in:
2017-04-23 19:23:15 +02:00
parent a425862cec
commit 54dfc484e6
3 changed files with 42 additions and 2 deletions

View File

@@ -0,0 +1 @@
gtest/1.7.0 unstable b:cmake

View File

@@ -1,7 +1,36 @@
#!/usr/bin/env modbuild
declare -a config_args=()
pbuild::set_docfiles \
CHANGES \
CONTRIBUTORS \
LICENSE \
README
pbuild::configure() {
cmake \
-DCMAKE_INSTALL_PREFIX="${PREFIX}" \
-DCMAKE_BUILD_TYPE=RELEASE \
"${config_args[@]}" \
"${MODULE_SRCDIR}"
}
pbuild::install() {
local -r _include_srcdir="${MODULE_SRCDIR}/include/gtest"
local -r _include_dstdir="${PREFIX}/include"
if [[ -e "${_include_dstdir}" ]]; then
chmod -R u+w "${_include_dstdir}"
fi
mkdir -p "${_include_dstdir}"
cp -rv "${_include_srcdir}"/* "${_include_dstdir}"
local -r _lib_dstdir="${PREFIX}/lib"
mkdir -p "${_lib_dstdir}"
cp -v *.a "${_lib_dstdir}"
}
pbuild::add_to_group 'Programming'
pbuild::set_runtime_dependencies ""
pbuild::set_build_dependencies "${COMPILER}"
pbuild::make_all

View File

@@ -0,0 +1,10 @@
#%Module1.0
module-whatis "Google's C++ test framework"
module-url "https://github.com/google/googletest/"
module-license "See ${PREFIX}/share/doc/gtest/LICENSE"
module-maintainer "Achim Gsell <achim.gsell@psi.ch>"
module-help "
See https://github.com/google/googletest/blob/master/googletest/docs/Primer.md
"