From 3b424e3767b0bd0396329b56edd9a611377c6daf Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Thu, 11 Aug 2011 21:13:55 +0000 Subject: [PATCH] allow compile against ICU 4.0 - needed to be able to link against osx provided libicucore.dylib --- INSTALL | 4 ++-- SConstruct | 2 +- src/map.cpp | 7 +++++++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/INSTALL b/INSTALL index b63ff36da..46044d473 100644 --- a/INSTALL +++ b/INSTALL @@ -62,9 +62,9 @@ First, here is a quick list of the required software dependencies: - system - thread - filesystem - - regex (built against libicu >= 4.2) + - regex (optionally built with icu regex support) - python - required only for python bindings (see below) -- libicu >= 4.2 - International Components for Unicode +- libicu >= 4.0 - International Components for Unicode - libpng - PNG Graphics - libjpeg - JPEG Graphics - libtiff - TIFF Graphics diff --git a/SConstruct b/SConstruct index 0b641e6e4..7ce01463e 100644 --- a/SConstruct +++ b/SConstruct @@ -809,7 +809,7 @@ int main() return False major, minor = map(int,result.split('.')) - if major >= 4 and minor >= 2: + if major >= 4 and minor >= 0: color_print(4,'\nFound icu version... %s\n' % result) return True diff --git a/src/map.cpp b/src/map.cpp index da0683a2a..a40ba593c 100644 --- a/src/map.cpp +++ b/src/map.cpp @@ -29,6 +29,9 @@ #include #include +// icu +#include + namespace mapnik { @@ -653,7 +656,11 @@ void Map::init_metawriters() void Map::set_metawriter_property(std::string name, std::string value) { +#if (U_ICU_VERSION_MAJOR_NUM > 4) || (U_ICU_VERSION_MAJOR_NUM == 4 && U_ICU_VERSION_MINOR_NUM >=2) metawriter_output_properties[name] = UnicodeString::fromUTF8(value); +#else + metawriter_output_properties[name] = UnicodeString(value.c_str()); +#endif } std::string Map::get_metawriter_property(std::string name) const