]> SALOME platform Git repositories - modules/kernel.git/commitdiff
Salome HOME
Do not add executable if no source is present
authoradam <adam>
Mon, 1 Dec 2008 16:03:55 +0000 (16:03 +0000)
committeradam <adam>
Mon, 1 Dec 2008 16:03:55 +0000 (16:03 +0000)
Do not add subdir if dir == .

salome_adm/cmake_files/am2cmake.py

index d4bbad560cfa13c995cd59013d8af90b5743760f..6f80a8972804e658a2c5be813ffd446ba219515f 100644 (file)
@@ -484,7 +484,9 @@ class CMakeFile(object):
         if 1: # self.__thedict__.has_key("SUBDIRS"):
             newlines.append(r'''
             FOREACH(dir ${SUBDIRS})
+            IF(NOT dir STREQUAL .)
             ADD_SUBDIRECTORY(${dir})
+            ENDIF(NOT dir STREQUAL .)
             ENDFOREACH(dir ${SUBDIRS})
             ''')
             pass
@@ -912,6 +914,8 @@ class CMakeFile(object):
         newlines.append(r'''
         SET(name "${amname}_exe")
         SET(srcs ${${amname}_SOURCES} ${dist_${amname}_SOURCES})
+        LIST(LENGTH srcs nb)
+        IF(nb)
         ADD_EXECUTABLE(${name} ${srcs})
         ''')
         # --
@@ -934,6 +938,10 @@ class CMakeFile(object):
         ''')
         # --
         newlines.append(r'''
+        ENDIF(nb)
+        ''')
+        # --
+        newlines.append(r'''
         ENDFOREACH(amname ${bin_PROGRAMS})
         ''')
         # --