From: adam Date: Mon, 1 Dec 2008 16:03:55 +0000 (+0000) Subject: Do not add executable if no source is present X-Git-Tag: V5_1_0rc2~16 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=8141831c05651d0e0b435f9182bcd164fd82506b;p=modules%2Fkernel.git Do not add executable if no source is present Do not add subdir if dir == . --- diff --git a/salome_adm/cmake_files/am2cmake.py b/salome_adm/cmake_files/am2cmake.py index d4bbad560..6f80a8972 100644 --- a/salome_adm/cmake_files/am2cmake.py +++ b/salome_adm/cmake_files/am2cmake.py @@ -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}) ''') # --