From 6f930ac0d7ef757c89713c69f56a053942b8d3b9 Mon Sep 17 00:00:00 2001
From: Emmanuel Christophe <emmanuel.christophe@orfeo-toolbox.org>
Date: Wed, 9 Dec 2009 14:09:15 +0800
Subject: [PATCH] COMP: look for the gettext lib (cf windows)

---
 CMakeLists.txt             | 2 ++
 Code/Common/CMakeLists.txt | 4 ++++
 2 files changed, 6 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d166077b0b..2709127dbb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -623,6 +623,8 @@ IF(GETTEXT_FOUND)
   FIND_PATH(GETTEXT_INCLUDE_DIR
     libintl.h
     DOC "Path to gettext include directory (where libintl.h can be found)")
+ FIND_LIBRARY(GETTEXT_LIBRARY gettextlib
+    DOC "GetText library")
   MARK_AS_ADVANCED(GETTEXT_INCLUDE_DIR)
   IF(GETTEXT_INCLUDE_DIR)
     INCLUDE_DIRECTORIES(${GETTEXT_INCLUDE_DIR})
diff --git a/Code/Common/CMakeLists.txt b/Code/Common/CMakeLists.txt
index 97c41896c0..4ada7fb1cb 100644
--- a/Code/Common/CMakeLists.txt
+++ b/Code/Common/CMakeLists.txt
@@ -16,11 +16,15 @@ TARGET_LINK_LIBRARIES (OTBCommon ITKAlgorithms ITKStatistics ITKCommon otbconfig
 IF(OTB_USE_MAPNIK)
     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
     TARGET_LINK_LIBRARIES(OTBCommon pq pqxx)
 ENDIF(OTB_USE_PQXX)
 
+IF(GETTEXT_FOUND)
+    TARGET_LINK_LIBRARIES(OTBCommon ${GETTEXT_LIBRARY})
+ENDIF(GETTEXT_FOUND)
 
 IF(OTB_LIBRARY_PROPERTIES)
   SET_TARGET_PROPERTIES(OTBCommon PROPERTIES ${OTB_LIBRARY_PROPERTIES})
-- 
GitLab