Salome HOME
Fix Salome application generation when compiling with CMake
authorbarate <barate>
Mon, 3 Oct 2011 09:04:44 +0000 (09:04 +0000)
committerbarate <barate>
Mon, 3 Oct 2011 09:04:44 +0000 (09:04 +0000)
Fix Python UI generation when compiling with CMake

bin/Makefile.am
bin/appliskel/Makefile.am [new file with mode: 0644]
configure.ac
salome_adm/cmake_files/am2cmake.py

index a60f26531c6fb71ffdcdbeee7a8f91faccf53ff1..f41645d9d18e037408f91a77071fd5b0cc5d51f5 100644 (file)
@@ -27,6 +27,8 @@
 #
 include $(top_srcdir)/salome_adm/unix/make_common_starter.am
 
+SUBDIRS = appliskel
+
 #
 # ===============================================================
 # Files to be installed
@@ -79,27 +81,6 @@ dist_salomescript_PYTHON =           \
        waitContainers.py               \
        waitNS.py
 
-EXTRA_DIST = appliskel
-
-dist-hook:
-       rm -rf `find $(distdir)/appliskel -name CVS`
-
-DISTCLEANFILES = $(top_builddir)/bin/salome/Makefile.am
-
-# This is an ugly target to avoid exploring the appliskel subdirectory.
-install-exec-local:
-       $(INSTALL) -d $(DESTDIR)$(salomescriptdir)
-       $(RM) -rf $(DESTDIR)$(salomescriptdir)/appliskel 1> /dev/null 2>&1
-       cp -r $(srcdir)/appliskel $(DESTDIR)$(salomescriptdir)
-       chmod a+x -R $(DESTDIR)$(salomescriptdir)/appliskel
-       find $(DESTDIR)$(salomescriptdir) -name CVS -prune -exec rm -rf {} \;
-
-uninstall-local:
-       if test -d $(DESTDIR)$(salomescriptdir)/appliskel; then \
-         find $(DESTDIR)$(salomescriptdir)/appliskel -exec chmod +w {} ';' ; \
-         rm -rf $(DESTDIR)$(salomescriptdir)/appliskel; \
-       fi;
-
 install-data-hook:
        @for f in $(dist_salomescript_PYTHON) ; do \
           chmod -f a+x $(DESTDIR)$(salomescriptdir)/$$f ; \
diff --git a/bin/appliskel/Makefile.am b/bin/appliskel/Makefile.am
new file mode 100644 (file)
index 0000000..babc2c5
--- /dev/null
@@ -0,0 +1,58 @@
+# Copyright (C) 2007-2011  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
+#
+# 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 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
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# -* Makefile *- 
+# Author : Renaud Barate (EDF R&D)
+# Module : KERNEL
+# $Header$
+
+include $(top_srcdir)/salome_adm/unix/make_common_starter.am
+appliskeldir = $(salomescriptdir)/appliskel
+
+#
+# ===============================================================
+# Files to be installed
+# ===============================================================
+#
+
+# These files are executable scripts
+dist_appliskel_SCRIPTS = \
+    envd                \
+    searchFreePort.sh   \
+    runRemote.sh        \
+    runAppli            \
+    runConsole          \
+    runSession          \
+    runSalomeScript     \
+    runTests            \
+    .bashrc
+
+# These files are python files
+dist_appliskel_PYTHON = \
+    getAppliPath.py             \
+    update_catalogs.py          \
+    kill_remote_containers.py
+
+install-data-hook:
+       @for f in $(dist_appliskel_PYTHON) ; do \
+        chmod -f a+x $(DESTDIR)$(appliskeldir)/$$f ; \
+    done
index 8c6cd899698fae231a04aa5ba81dfa60942d17c2..d59d02a60a872810868177553b0379c7bfe00f28 100644 (file)
@@ -537,6 +537,7 @@ AC_OUTPUT([ \
   salome_adm/unix/config_files/Makefile \
   Makefile \
   bin/Makefile \
+  bin/appliskel/Makefile \
   bin/VERSION \
   doc/Makefile \
   doc/docutils/conf.py \
index 50db174dadde2c16dee5ae3f3df8c66a9d732eca..398fa333f2fb57c96ea1f3dfe01ae74846b87d64 100644 (file)
@@ -1444,6 +1444,25 @@ class CMakeFile(object):
             ''')
             pass
         
+        # --
+        # --
+        key = "PYUIC_FILES"
+        if self.__thedict__.has_key(key):
+            newlines.append('''
+            FOREACH(output ${PYUIC_FILES})
+            STRING(REPLACE ".py" ".ui" input ${output})
+            SET(input ${CMAKE_CURRENT_SOURCE_DIR}/${input})
+            SET(output ${CMAKE_CURRENT_BINARY_DIR}/${output})
+            ADD_CUSTOM_COMMAND(
+            OUTPUT ${output}
+            COMMAND ${PYUIC_EXECUTABLE} -o ${output} ${input}
+            MAIN_DEPENDENCY ${input}
+            )
+            ENDFOREACH(output ${PYUIC_FILES})
+            ADD_CUSTOM_TARGET(BUILD_PY_UI_FILES ALL DEPENDS ${PYUIC_FILES})
+            ''')
+            pass
+        
         # --
         # --
         key = "QRC_FILES"
@@ -1545,6 +1564,8 @@ class CMakeFile(object):
             "dist_salomescript_SCRIPTS"        :  "bin/salome",
             "dist_salomescript_DATA"           :  "bin/salome",
             "dist_salomescript_PYTHON"         :  "bin/salome",
+            "dist_appliskel_SCRIPTS"           :  "bin/salome/appliskel",
+            "dist_appliskel_PYTHON"            :  "bin/salome/appliskel",
             "nodist_salomescript_DATA"         :  "bin/salome",
             "salomepython_PYTHON"              :  "${salomepythondir}",
             "nodist_salomepython_PYTHON"       :  "${salomepythondir}",
@@ -1552,6 +1573,7 @@ class CMakeFile(object):
             "sharedpkgpython_PYTHON"           :  "${salomepythondir}/shared_modules",
             "salomepypkg_PYTHON"               :  "${salomepypkgdir}",
             "mypkgpython_PYTHON"               :  "${mypkgpythondir}",
+            "nodist_mypkgpython_PYTHON"        :  "${mypkgpythondir}",
             }
         if self.module == "jobmanager":
             d["bin_SCRIPTS"] = "bin"
@@ -2134,7 +2156,9 @@ class CMakeFile(object):
         FIND_FILE(dummy ${f} PATHS ${CMAKE_CURRENT_SOURCE_DIR} NO_DEFAULT_PATH)
         IF(dummy)
         ''')
-        if key in ['dist_salomescript_SCRIPTS']:
+        if key in ['dist_salomescript_SCRIPTS',
+                   'dist_appliskel_SCRIPTS',
+                   'dist_appliskel_PYTHON']:
             newlines.append(r'''
             SET(PERMS)
             SET(PERMS ${PERMS} OWNER_READ OWNER_WRITE OWNER_EXECUTE)