cosmetic change for projects without any modules

This commit is contained in:
Radovan Bast 2015-07-31 12:30:57 +02:00
parent 2b03445717
commit c382c9044c

View File

@ -207,6 +207,7 @@ def gen_cmakelists(config, relative_path, modules):
s.append(' set(CMAKE_BUILD_TYPE "Debug")') s.append(' set(CMAKE_BUILD_TYPE "Debug")')
s.append('endif()') s.append('endif()')
if len(modules) > 0:
s.append('\n# directories which hold included cmake modules') s.append('\n# directories which hold included cmake modules')
for directory in set([module.path for module in modules]): for directory in set([module.path for module in modules]):
rel_cmake_module_path = os.path.join(relative_path, directory) rel_cmake_module_path = os.path.join(relative_path, directory)
@ -214,6 +215,7 @@ def gen_cmakelists(config, relative_path, modules):
rel_cmake_module_path = rel_cmake_module_path.replace('\\', '/') rel_cmake_module_path = rel_cmake_module_path.replace('\\', '/')
s.append('set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/%s)' % rel_cmake_module_path) s.append('set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${PROJECT_SOURCE_DIR}/%s)' % rel_cmake_module_path)
if len(modules) > 0:
s.append('\n# included cmake modules') s.append('\n# included cmake modules')
for module in modules: for module in modules:
s.append('include(%s)' % os.path.splitext(module.name)[0]) s.append('include(%s)' % os.path.splitext(module.name)[0])