# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem              1.0
PortGroup               cmake 1.1
PortGroup               github 1.0

name                    google-benchmark
github.setup            google benchmark 1.10.0 v
github.tarball_from     archive

categories              devel
license                 Apache-2
homepage                https://google.github.io/benchmark
maintainers             {sethm.id.au:dev @McDaMastR} \
                        openmaintainer

description             A microbenchmark support library
long_description        Google's library to benchmark code snippets, similar \
                        to unit tests.

depends_build-append    port:gtest
depends_test-append     port:gtest

checksums               rmd160  92ad7a4f824fb3b9582b2a14b8916aa090dc1312 \
                        sha256  acc5c7c0fbed855c4aaa2d7c3c36fb82b0c15c28f4e151e3f679c2fc0aa404af \
                        size    281371

compiler.cxx_standard   2017
compiler.thread_local_storage \
                        yes

configure.args-append   -DBENCHMARK_BUILD_32_BITS=OFF \
                        -DBENCHMARK_DOWNLOAD_DEPENDENCIES=OFF \
                        -DBENCHMARK_ENABLE_DOXYGEN=OFF \
                        -DBENCHMARK_ENABLE_EXCEPTIONS=ON \
                        -DBENCHMARK_ENABLE_GTEST_TESTS=ON \
                        -DBENCHMARK_ENABLE_INSTALL=ON \
                        -DBENCHMARK_ENABLE_LIBPFM=OFF \
                        -DBENCHMARK_ENABLE_LTO=OFF \
                        -DBENCHMARK_ENABLE_RUST_BINDINGS=OFF \
                        -DBENCHMARK_ENABLE_TESTING=ON \
                        -DBENCHMARK_ENABLE_WERROR=OFF \
                        -DBENCHMARK_FORCE_WERROR=OFF \
                        -DBENCHMARK_INSTALL_DOCS=OFF \
                        -DBENCHMARK_INSTALL_TOOLS=OFF \
                        -DBENCHMARK_USE_BUNDLED_GTEST=OFF \
                        -DBUILD_SHARED_LIBS=ON \
                        -DCMAKE_BUILD_WITH_INSTALL_RPATH=OFF

test.run                yes
test.cmd                ctest
test.target

post-destroot {
    set destdocdir  ${destroot}${prefix}/share/doc/${name}

    xinstall -d ${destdocdir}
    xinstall -W ${worksrcpath} -m 644 \
        AUTHORS \
        CONTRIBUTING.md \
        CONTRIBUTORS \
        LICENSE \
        README.md \
        ${destdocdir}
}
