From 9d133be8feca9574a8515348aa35b5ff34ee0f46 Mon Sep 17 00:00:00 2001
From: Denis Barbier <bouzim@gmail.com>
Date: Thu, 20 May 2010 00:19:44 +0200
Subject: [PATCH 5/5] Allow setting OCC_LIB_PATH

---
 src/contrib/GEOM/CMakeLists.txt  |    8 ++++++--
 src/contrib/SMESH/CMakeLists.txt |    8 ++++++--
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/contrib/GEOM/CMakeLists.txt b/src/contrib/GEOM/CMakeLists.txt
index c39ae9f..52d4b7e 100644
--- a/src/contrib/GEOM/CMakeLists.txt
+++ b/src/contrib/GEOM/CMakeLists.txt
@@ -27,11 +27,15 @@ IF(WIN32)
     # Under Windows, check the CASROOT env variable
     FIND_PATH(OCC_INCLUDE_PATH Standard_Real.hxx 
               $ENV{CASROOT}\\inc)
-    SET(OCC_LIB_PATH "$ENV{CASROOT}\\win32\\lib")
+    IF(NOT OCC_LIB_PATH)
+        SET(OCC_LIB_PATH "$ENV{CASROOT}\\win32\\lib")
+    ENDIF(NOT OCC_LIB_PATH)
     # Find the Standard_Real.hxx header in this path
 ELSE(WIN32) #Unix
     FIND_PATH(OCC_INCLUDE_PATH Standard_Real.hxx $ENV{CASROOT}/inc)
-    SET(OCC_LIB_PATH "$ENV{CASROOT}/lib")
+    IF(NOT OCC_LIB_PATH)
+        SET(OCC_LIB_PATH "$ENV{CASROOT}/lib")
+    ENDIF(NOT OCC_LIB_PATH)
     #FIND_LIBRARY(OCC_LIB_PATH TKernel PATHS $ENV{CASROOT}/lib)
     MESSAGE(${OCC_LIB_PATH})
 ENDIF(WIN32)
diff --git a/src/contrib/SMESH/CMakeLists.txt b/src/contrib/SMESH/CMakeLists.txt
index af68e42..c5540b9 100644
--- a/src/contrib/SMESH/CMakeLists.txt
+++ b/src/contrib/SMESH/CMakeLists.txt
@@ -57,11 +57,15 @@ IF(WIN32)
     # Under Windows, check the CASROOT env variable
     FIND_PATH(OCC_INCLUDE_PATH Standard_Real.hxx 
               $ENV{CASROOT}\\inc)
-    SET(OCC_LIB_PATH "$ENV{CASROOT}\\win32\\lib")
+    IF(NOT OCC_LIB_PATH)
+        SET(OCC_LIB_PATH "$ENV{CASROOT}\\win32\\lib")
+    ENDIF(NOT OCC_LIB_PATH)
     # Find the Standard_Real.hxx header in this path
 ELSE(WIN32) #Unix
     FIND_PATH(OCC_INCLUDE_PATH Standard_Real.hxx $ENV{CASROOT}/inc)
-    SET(OCC_LIB_PATH "$ENV{CASROOT}/lib")
+    IF(NOT OCC_LIB_PATH)
+        SET(OCC_LIB_PATH "$ENV{CASROOT}/lib")
+    ENDIF(NOT OCC_LIB_PATH)
     #FIND_LIBRARY(OCC_LIB_PATH TKernel PATHS $ENV{CASROOT}/lib)
     #MESSAGE(${OCC_LIB_PATH})
 ENDIF(WIN32)
-- 
1.7.1

