From 6947af8cb2bd99d35b1ae4ec37f18b7f975eda51 Mon Sep 17 00:00:00 2001
From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Date: Thu, 9 Jul 2009 10:32:27 +0800
Subject: [PATCH] COMP: fixing CMakeLists for mapnik

---
 CMakeLists.txt                     | 11 +++++++++--
 Code/Common/CMakeLists.txt         |  3 +--
 Testing/Code/Common/CMakeLists.txt |  3 +--
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5649c236c5..d3c893e782 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -353,11 +353,12 @@ IF(OTB_USE_MAPNIK)
                         "Cannot find MAPNIK library. Please set MAPNIK_LIBRARY or SET OTB_USE_MAPNIK OFF.")
         ENDIF (NOT MAPNIK_LIBRARY)
 
-# Add compiler option
+        # Add compiler option
         ADD_DEFINITIONS(-DOTB_USE_MAPNIK)
 
         INCLUDE_DIRECTORIES(${MAPNIK_INCLUDE_DIR})
 
+
 ENDIF(OTB_USE_MAPNIK)
 
 #-------------------------------
@@ -389,7 +390,7 @@ IF(OTB_USE_PQXX)
                         "Cannot find PQ library. Please set PQ_LIBRARY or SET OTB_USE_PQXX OFF.")
         ENDIF (NOT PQ_LIBRARY)
 
-	
+
 # Add compiler option
         ADD_DEFINITIONS(-DOTB_USE_PQXX)
 
@@ -406,6 +407,12 @@ ENDIF(OTB_USE_PQXX)
 OPTION(OTB_USE_EXTERNAL_BOOST "Use an outside build of Boost." OFF)
 MARK_AS_ADVANCED(OTB_USE_EXTERNAL_BOOST)
 
+IF (OTB_USE_MAPNIK)
+  IF(NOT OTB_USE_EXTERNAL_BOOST)
+    MESSAGE("You need to set OTB_USE_EXTERNAL_BOOST to ON when using MAPNIK")
+  ENDIF(NOT OTB_USE_EXTERNAL_BOOST)
+ENDIF(OTB_USE_MAPNIK)
+
 IF(OTB_USE_EXTERNAL_BOOST)
   FIND_PACKAGE(Boost)
   INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR})
diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt
index ae2e1203bb..93caf82511 100644
--- a/Code/Common/CMakeLists.txt
+++ b/Code/Common/CMakeLists.txt
@@ -14,8 +14,7 @@ ENDIF( NOT OTB_USE_PQXX )
 ADD_LIBRARY(OTBCommon ${OTBCommon_SRCS})
 TARGET_LINK_LIBRARIES (OTBCommon ITKAlgorithms ITKStatistics ITKCommon)
 IF (OTB_USE_MAPNIK)
-#TODO this line should be refined when we will like to have this capability with windows
-    TARGET_LINK_LIBRARIES(OTBCommon ${MAPNIK_LIBRARY}/libmapnik.so)
+    TARGET_LINK_LIBRARIES(OTBCommon ${MAPNIK_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
diff --git a/Testing/Code/Common/CMakeLists.txt b/Testing/Code/Common/CMakeLists.txt
index 08333b67ae..6a3a23d1f9 100755
--- a/Testing/Code/Common/CMakeLists.txt
+++ b/Testing/Code/Common/CMakeLists.txt
@@ -957,8 +957,7 @@ TARGET_LINK_LIBRARIES(otbCommonTests8 OTBIO OTBTesting)
 
 IF(OTB_USE_MAPNIK)
 ADD_EXECUTABLE(otbCommonTests9 otbCommonTests9.cxx ${BasicCommon_SRCS9})
-#TODO this line should be refined when we will like to have this capability with windows
-TARGET_LINK_LIBRARIES(otbCommonTests9 OTBIO  OTBTesting ${MAPNIK_LIBRARY}/libmapnik.so)
+TARGET_LINK_LIBRARIES(otbCommonTests9 OTBIO  OTBTesting ${MAPNIK_LIBRARY})
 ENDIF(OTB_USE_MAPNIK)
 
 IF(OTB_USE_PQXX)
-- 
GitLab