Salome HOME
Merge akl/tests_update: update tests
[modules/paravis.git] / src / PV_SWIG / CMakeLists.txt
index 4c71092354b955b390472cb07d0ba15d07046c56..64fe2f88bf6f0828c3ff9ef305fc02156c5597a7 100644 (file)
-
-        SET(VERSION_INFO 0.0.0)
-        SET(SOVERSION_INFO 0)
-        SET(SUBDIRS)
-        SET(AM_CPPFLAGS)
-        SET(AM_CXXFLAGS)
-        SET(LDADD)
-        
-
-                SET(AM_CPPFLAGS ${AM_CPPFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h)
-                SET(AM_CXXFLAGS ${AM_CXXFLAGS} -DHAVE_SALOME_CONFIG -I${KERNEL_ROOT_DIR}/include/salome -include SALOMEconfig.h)
-                
-#  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-#
-#  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-#  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+# Copyright (C) 2010-2014  CEA/DEN, EDF R&D
 #
-#  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.
+# 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, 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
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-#  Lesser General Public License for more details.
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-#  You should have received a copy of the GNU Lesser General Public
-#  License along with this library; if not, write to the Free Software
-#  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 #
-#  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 #
-#  VISU VISU_SWIG : binding of C++ implementation and Python
-#  File   : Makefile.am
-#  Author : Paul RASCLE, EDF
-#  Module : VISU
-#
-# include $(top_srcdir)/adm_local/unix/make_common_starter.am
-
-SET(dist_salomescript_DATA
-    paravis.py
-    paravisSM.py
-    pvsimple.py
-)
-
-
-
-            FOREACH(dir ${SUBDIRS})
-            IF(NOT dir STREQUAL .)
-            ADD_SUBDIRECTORY(${dir})
-            ENDIF(NOT dir STREQUAL .)
-            ENDFOREACH(dir ${SUBDIRS})
-            
-FOREACH(f ${dist_salomescript_DATA})
 
-        SET(DEST bin/salome)
-        
+SET(_PYFILES_TO_INSTALL)
 
-        STRING(COMPARE EQUAL ${f} SALOMEconfig.h.in test_SALOMEconfig.h.in)
-        IF(test_SALOMEconfig.h.in)
-        INSTALL(FILES SALOMEconfig.ref.in DESTINATION ${DEST} RENAME SALOMEconfig.h.in)
-        ELSE(test_SALOMEconfig.h.in)
-        SET(dummy dummy-NOTFOUND)
-        MARK_AS_ADVANCED(dummy)
-        # FILE(REMOVE ${CMAKE_INSTALL_PREFIX}/${DEST}/${f})
-        FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
-        IF(dummy)
-        
-
-            GET_FILENAME_COMPONENT(ext ${f} EXT)
-            IF(ext STREQUAL .py)
-            IF(DEST STREQUAL bin/salome)
-            SET(PERMS)
-            SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE)
-            SET(PERMS ${PERMS} GROUP_READ GROUP_EXECUTE)
-            SET(PERMS ${PERMS} WORLD_READ WORLD_EXECUTE)
-            INSTALL(FILES ${f} DESTINATION ${DEST} PERMISSIONS ${PERMS})
-            ELSE(DEST STREQUAL bin/salome)
-            INSTALL(FILES ${f} DESTINATION ${DEST})
-            ENDIF(DEST STREQUAL bin/salome)
-            ELSE(ext STREQUAL .py)
-            INSTALL(FILES ${f} DESTINATION ${DEST})
-            ENDIF(ext STREQUAL .py)
-            
-
-        ELSE(dummy)
-        GET_FILENAME_COMPONENT(ext ${f} EXT)
-        IF(ext STREQUAL .qm)
-        STRING(REGEX REPLACE .qm .ts input ${f})
-        
-
-            SET(input ${CMAKE_CURRENT_SOURCE_DIR}/resources/${input})
-            
-
-        SET(output ${CMAKE_CURRENT_BINARY_DIR}/${f})
-        # ADD_CUSTOM_COMMAND(
-        # OUTPUT ${output}
-        # COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output}
-        # MAIN_DEPENDENCY ${input}
-        # )
-        EXECUTE_PROCESS(COMMAND ${QT_LRELEASE_EXECUTABLE} ${input} -qm ${output})
-        ENDIF(ext STREQUAL .qm)
-        INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${f} DESTINATION ${DEST})
-        ENDIF(dummy)
-        ENDIF(test_SALOMEconfig.h.in)
-        
-
-        GET_FILENAME_COMPONENT(ext ${f} EXT)
-        IF(ext STREQUAL .py)
-        INSTALL(CODE "SET(PYTHON_FILE ${f})")
-        INSTALL(CODE "SET(CMAKE_INSTALL_PREFIX ${CMAKE_INSTALL_PREFIX})")
-        INSTALL(CODE "SET(DEST ${DEST})")
-        INSTALL(CODE "SET(PYTHON_EXECUTABLE ${PYTHON_EXECUTABLE})")
-        
-
-            STRING(REPLACE "\\" "/" KERNEL_ROOT_DIR ${KERNEL_ROOT_DIR})
-            INSTALL(SCRIPT ${KERNEL_ROOT_DIR}/salome_adm/cmake_files/install_and_compile_python_file.cmake)
-            
-
-        ENDIF(ext STREQUAL .py)
-        
-ENDFOREACH(f ${dist_salomescript_DATA})
+IF(SALOME_LIGHT_ONLY)
+  LIST(APPEND _PYFILES_TO_INSTALL
+    pvsimple.py
+    presentations.py
+  )
+ELSE(SALOME_LIGHT_ONLY)
+  IF(SALOME_PARAVIS_MINIMAL_CORBA)
+    # Use another set of Python files redirecting the API directly 
+    # to the original ParaView modules.
+    LIST(APPEND _PYFILES_TO_INSTALL
+      paravis.py
+      pvsimple.py
+      presentations.py
+      paravisSM.py
+    )
+  ELSE()
+    LIST(APPEND _PYFILES_TO_INSTALL
+      VTKWrapping/paravis.py
+      VTKWrapping/paravisSM.py
+      VTKWrapping/pvsimple.py
+      VTKWrapping/presentations.py
+    )
+  ENDIF()
+ENDIF(SALOME_LIGHT_ONLY)
+
+INSTALL_AND_COMPILE_PYTHON_FILE("${_PYFILES_TO_INSTALL}" ${SALOME_INSTALL_SCRIPT_PYTHON})