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

github.setup        microsoft cpprestsdk 2.10.19 v
revision            0

# Drop on next update:
if {${os.platform} eq "darwin" && ${os.major} < 10} {
    incr revision
}

categories          www devel
license             MIT
maintainers         {makr @mohd-akram} openmaintainer

description         C++ REST library for client–server communication

long_description    The C++ REST SDK is a Microsoft project for cloud-based \
                    client-server communication in native code using a modern \
                    asynchronous C++ API design.

checksums           rmd160  7b357c14b023e4f7be24660e5a024c545164aa16 \
                    sha256  4b0d14e5bfe77ce419affd253366e861968ae6ef2c35ae293727c1415bd145c8 \
                    size    1749647
github.tarball_from archive

# websocketpp is header-only
depends_build-append    port:websocketpp

depends_lib-append  port:libiconv \
                    port:zlib

compiler.cxx_standard   2011

configure.args-append \
                    -DBUILD_SAMPLES=OFF \
                    -DBUILD_TESTS=OFF \
                    -DOPENSSL_ROOT_DIR=${prefix} \
                    -DWERROR=OFF

# asyncrt_utils.h:317:13: error: 'locale_t' does not name a type
configure.cppflags-append \
                    -DHAVE_XLOCALE_H

variant tests description "Build tests" {
    configure.args-replace \
                    -DBUILD_TESTS=OFF -DBUILD_TESTS=ON
    configure.pre_args-replace \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=ON \
                    -DCMAKE_BUILD_WITH_INSTALL_RPATH:BOOL=OFF
    test.run        yes
}
