# -*- 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           github 1.0
PortGroup           cmake 1.0
PortGroup           cxx11 1.1

name                jsoncpp
categories          devel
platforms           darwin
maintainers         {michaelld @michaelld} openmaintainer
license             MIT

description         JSON C++ library

long_description    JSON data format manipulation C++ library

subport jsoncpp-devel {}

if {${subport} eq ${name}} {

    # release
    github.setup    open-source-parsers jsoncpp 1.8.4
    checksums       rmd160 46ddb792a25c1ac62967adef604d760e68c084f9 \
                    sha256 9c2370371a76337e4afe3128cceec943620f97d12c720c3046f39eae6f85f4cd
    revision        0

    conflicts       jsoncpp-devel

} else {

    # devel

    github.setup open-source-parsers jsoncpp 5b91551f3944d69e0090d6b6528852207de78078
    version      20190423-[string range ${github.version} 0 7]
    checksums    rmd160 7e43454b93a62ff7f7b2ac953372273110c5e6dc \
                 sha256 a1da8cdd0af23fe157ff7de3ea9f886247be5029a26f6102c8d814103dd51f0c \
                 size   200578
    revision     0

    conflicts       jsoncpp
    long_description ${description}: \
        This port follows the GIT master version of ${name}, which is typically updated every few days to weeks.

}

cmake.out_of_source yes

configure.args-append \
    -DBUILD_SHARED_LIBS=ON \
    -DJSONCPP_WITH_POST_BUILD_UNITTEST=OFF \
    -DCCACHE_FOUND=NO