File: CheckBoostRegexIcu.cmake

package info (click to toggle)
mapnik 4.2.1%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 18,592 kB
  • sloc: cpp: 163,859; python: 1,332; sh: 690; xml: 161; makefile: 123; perl: 28; lisp: 13
file content (23 lines) | stat: -rw-r--r-- 704 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
include(CheckCXXSourceRuns)

function(check_boost_regex)
    set(CMAKE_REQUIRED_LIBRARIES ICU::uc ICU::data ICU::i18n Boost::headers Boost::regex)
    check_cxx_source_runs([[
    #include <boost/regex/icu.hpp>
    #include <unicode/unistr.h>
    int main()
    {
        U_NAMESPACE_QUALIFIER UnicodeString ustr;
        try {
            boost::u32regex pattern = boost::make_u32regex(ustr);
        }
        // an exception is fine, still indicates support is
        // likely compiled into regex
        catch (...) {
            return 0;
        }
        return 0;
    }
    ]] BOOST_REGEX_HAS_ICU)
    set(BOOST_REGEX_HAS_ICU ${BOOST_REGEX_HAS_ICU} PARENT_SCOPE)
endfunction(check_boost_regex)