Do not add subdir if dir == .
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
newlines.append(r'''
SET(name "${amname}_exe")
SET(srcs ${${amname}_SOURCES} ${dist_${amname}_SOURCES})
+ LIST(LENGTH srcs nb)
+ IF(nb)
ADD_EXECUTABLE(${name} ${srcs})
''')
# --
''')
# --
newlines.append(r'''
+ ENDIF(nb)
+ ''')
+ # --
+ newlines.append(r'''
ENDFOREACH(amname ${bin_PROGRAMS})
''')
# --