完成自动生成CMake脚本的python方法,cmakepython,下面一段Python代码


下面一段Python代码是关于脚本自动生成 unity_build.cpp 文件,完成自动生成CMake脚本的python方法

import osimport sysdef walk(path) :      for filename in os.listdir(path) :        abspath = path + '\\' + filename        if os.path.isdir(abspath) :              walk(abspath)         elif filename.endswith('.cpp') and filename != 'unity_build.cpp' :                     print '#include "' + abspath[2:] + '"'sys.stdout = open('./unity_build.cpp', 'w')walk(os.curdir)#www.iplaypy.com

编橙之家文章,

评论关闭