From f121c0b1181c09ad5bceb31b5b8aa874974f7789 Mon Sep 17 00:00:00 2001
From: Julien Malik <julien.malik@c-s.fr>
Date: Wed, 4 Jul 2012 17:40:32 +0200
Subject: [PATCH] COMP: resolve cmake variables

---
 Utilities/ITK/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/Utilities/ITK/CMakeLists.txt b/Utilities/ITK/CMakeLists.txt
index 136c4111fd..5d748a2e40 100644
--- a/Utilities/ITK/CMakeLists.txt
+++ b/Utilities/ITK/CMakeLists.txt
@@ -307,7 +307,7 @@ IF(NOT ITK_INSTALL_BIN_DIR)
   # executable. If only a 32 or 64 bit version is available, the executable should go in
   # bin. So it seems better to let the packagers deal with that.
   # Ref: http://docs.sun.com/app/docs/doc/816-5138/dev-env-13?a=view
-  SET(ITK_INSTALL_BIN_DIR OTB_INSTALL_BIN_DIR)
+  SET(ITK_INSTALL_BIN_DIR ${OTB_INSTALL_BIN_DIR})
 ENDIF(NOT ITK_INSTALL_BIN_DIR)
 
 IF(NOT ITK_INSTALL_LIB_DIR)
@@ -334,15 +334,18 @@ IF(NOT ITK_INSTALL_LIB_DIR)
   ENDIF(CMAKE_SYSTEM MATCHES "SunOS.*" AND CMAKE_SIZEOF_VOID_P EQUAL 8)
 # OTB Modifications
 #  SET(ITK_INSTALL_LIB_DIR "/lib/InsightToolkit${sun64}")
-  SET(ITK_INSTALL_LIB_DIR OTB_INSTALL_LIB_DIR) 
+  SET(ITK_INSTALL_LIB_DIR ${OTB_INSTALL_LIB_DIR}) 
 ENDIF(NOT ITK_INSTALL_LIB_DIR)
 
 IF(NOT ITK_INSTALL_DATA_DIR)
-  SET(ITK_INSTALL_DATA_DIR OTB_INSTALL_DATA_DIR)
+  SET(ITK_INSTALL_DATA_DIR ${OTB_INSTALL_DATA_DIR})
 ENDIF(NOT ITK_INSTALL_DATA_DIR)
 
 IF(NOT ITK_INSTALL_INCLUDE_DIR)
-  SET(ITK_INSTALL_INCLUDE_DIR OTB_INSTALL_INCLUDE_DIR)
+  # Actually this variable is set explicitely from otbIncludeDirectories.cmake
+  # so we never get there
+  # Just recall it here...
+  SET(ITK_INSTALL_INCLUDE_DIR ${OTB_INSTALL_INCLUDE_DIR}/Utilities/ITK)
 ENDIF(NOT ITK_INSTALL_INCLUDE_DIR)
 
 IF(NOT ITK_INSTALL_PACKAGE_DIR)
-- 
GitLab