diff --git a/CMakeLists.txt b/CMakeLists.txt index 6b18ed5d469ae93588a96c9093c49f74c01afbef..2480b26a2298c97e5ebf5b528ae79cbd739c5b94 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -583,6 +583,16 @@ IF(OTB_USE_MAPNIK) "Cannot find MAPNIK library. Please set MAPNIK_LIBRARY or SET OTB_USE_MAPNIK OFF.") ENDIF (NOT MAPNIK_LIBRARY) + # libicuuc is a unicode library mapnik relies on. + # since libicuuc version 1.42, we need to link against it when linking against mapnik + # otherwise we get undefined symbol error + FIND_LIBRARY(ICUUC_LIBRARY icuuc ) + MARK_AS_ADVANCED(ICUUC_LIBRARY) + IF (NOT ICUUC_LIBRARY) + MESSAGE(FATAL_ERROR + "Cannot find ICUUC library, needed by MAPNIK. Please set ICUUC_LIBRARY or SET OTB_USE_MAPNIK OFF.") + ENDIF (NOT ICUUC_LIBRARY) + # Add compiler option ADD_DEFINITIONS(-DOTB_USE_MAPNIK) diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt index 0074af6579a6290d3c2b86f517d3ddc74557f243..d0ac81920f3f6ccc172c4855bf2f1bed465bbdde 100644 --- a/Code/Common/CMakeLists.txt +++ b/Code/Common/CMakeLists.txt @@ -18,7 +18,7 @@ ADD_LIBRARY(OTBCommon ${OTBCommon_SRCS}) #) TARGET_LINK_LIBRARIES (OTBCommon ITKAlgorithms ITKStatistics ITKCommon otbconfigfile otbmuparser) IF(OTB_USE_MAPNIK) - TARGET_LINK_LIBRARIES(OTBCommon ${MAPNIK_LIBRARY}) + TARGET_LINK_LIBRARIES(OTBCommon ${MAPNIK_LIBRARY} ${ICUUC_LIBRARY}) ENDIF(OTB_USE_MAPNIK) IF(OTB_USE_PQXX) diff --git a/Code/OBIA/CMakeLists.txt b/Code/OBIA/CMakeLists.txt index 7fc327f0183d7f8fd87877bb98a4bf3180900443..6f5f04c1b43d082227f07f567496d543899c6c4b 100644 --- a/Code/OBIA/CMakeLists.txt +++ b/Code/OBIA/CMakeLists.txt @@ -11,7 +11,7 @@ ADD_LIBRARY(OTBOBIA ${OTBOBIA_SRCS}) #) TARGET_LINK_LIBRARIES (OTBOBIA OTBIO) IF(OTB_USE_MAPNIK) - TARGET_LINK_LIBRARIES(OTBOBIA ${MAPNIK_LIBRARY}) + TARGET_LINK_LIBRARIES(OTBOBIA ${MAPNIK_LIBRARY} ${ICUUC_LIBRARY}) ENDIF(OTB_USE_MAPNIK) IF(OTB_USE_PQXX) diff --git a/Testing/Code/Common/CMakeLists.txt b/Testing/Code/Common/CMakeLists.txt index 026d1cfcf275c01b818fcc7a8b6cf485d8e9001e..f5ba7d62e4afc98478ed0ea00a33e1f1c5fdb3b3 100644 --- a/Testing/Code/Common/CMakeLists.txt +++ b/Testing/Code/Common/CMakeLists.txt @@ -1103,7 +1103,7 @@ OTB_ADD_EXECUTABLE(otbCommonTests6 "${BasicCommon_SRCS6}" "OTBIO;OTBTesting") OTB_ADD_EXECUTABLE(otbCommonTests7 "${BasicCommon_SRCS7}" "OTBIO;OTBTesting") OTB_ADD_EXECUTABLE(otbCommonTests8 "${BasicCommon_SRCS8}" "OTBIO;OTBTesting") IF(OTB_USE_MAPNIK) - OTB_ADD_EXECUTABLE(otbCommonTests9 "${BasicCommon_SRCS9}" "OTBIO;OTBTesting;${MAPNIK_LIBRARY}") + OTB_ADD_EXECUTABLE(otbCommonTests9 "${BasicCommon_SRCS9}" "OTBIO;OTBTesting;${MAPNIK_LIBRARY};${ICUUC_LIBRARY}") ENDIF(OTB_USE_MAPNIK) IF(OTB_USE_PQXX) #TODO this line should be refined when we will like to have this capability with windows