From e372b4a408675b4fababad7e394a88602a7cf792 Mon Sep 17 00:00:00 2001
From: Guillaume Pasero <guillaume.pasero@c-s.fr>
Date: Thu, 31 Aug 2017 17:19:42 +0200
Subject: [PATCH] COMP: fix linking of SPTW (detected because of linker flag
 -Wl,--no-undefined)

---
 Modules/ThirdParty/SPTW/otb-module.cmake   | 1 +
 Modules/ThirdParty/SPTW/src/CMakeLists.txt | 6 +++++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/Modules/ThirdParty/SPTW/otb-module.cmake b/Modules/ThirdParty/SPTW/otb-module.cmake
index eca0cb9b79..a1dc674bd5 100644
--- a/Modules/ThirdParty/SPTW/otb-module.cmake
+++ b/Modules/ThirdParty/SPTW/otb-module.cmake
@@ -24,6 +24,7 @@ otb_module(OTBSPTW
   DEPENDS
     OTBMPI
     OTBGDAL
+    OTBTIFF
 
   TEST_DEPENDS
 
diff --git a/Modules/ThirdParty/SPTW/src/CMakeLists.txt b/Modules/ThirdParty/SPTW/src/CMakeLists.txt
index 5e0feb3b35..fcc9539ece 100644
--- a/Modules/ThirdParty/SPTW/src/CMakeLists.txt
+++ b/Modules/ThirdParty/SPTW/src/CMakeLists.txt
@@ -28,7 +28,11 @@ set(OTBSPTW_MAIN_SRCS sptw.cc)
 
 
 add_library(otbSPTW ${OTBSPTW_MAIN_SRCS})
-target_link_libraries(otbSPTW)
+target_link_libraries(otbSPTW
+  ${OTBMPI_LIBRARIES}
+  ${OTBGDAL_LIBRARIES}
+  ${OTBTIFF_LIBRARIES}
+  )
 include_directories(${CMAKE_CURRENT_SOURCE_DIR})
 
 #Install TARGET & FILES for otb-lib
-- 
GitLab