-# Copyright (C) 2013 CEA/DEN, EDF R&D, OPEN CASCADE
+# Copyright (C) 2013-2014 CEA/DEN, EDF R&D, OPEN CASCADE
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
-# version 2.1 of the License.
+# version 2.1 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
#
# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
#
+# Author: Adrien Bruneton
+#
-# Swig detection for Salome
+# SWIG detection for SALOME
+#
+# !! Please read the generic detection procedure in SalomeMacros.cmake !!
+#
+SALOME_FIND_PACKAGE_AND_DETECT_CONFLICTS(SWIG SWIG_EXECUTABLE 2)
+MARK_AS_ADVANCED(SWIG_EXECUTABLE SWIG_VERSION)
-set(SWIG_ROOT_DIR $ENV{SWIG_ROOT_DIR} CACHE PATH "Path to Swig directory")
-if(EXISTS ${SWIG_ROOT_DIR})
- set(CMAKE_INCLUDE_PATH ${SWIG_ROOT_DIR}/include)
- set(CMAKE_LIBRARY_PATH ${SWIG_ROOT_DIR}/lib)
- set(CMAKE_PROGRAM_PATH ${SWIG_ROOT_DIR}/bin)
-endif(EXISTS ${SWIG_ROOT_DIR})
-find_package(SWIG REQUIRED)
+IF(SWIG_FOUND)
+ SALOME_ACCUMULATE_ENVIRONMENT(PATH ${SWIG_EXECUTABLE})
+ENDIF()