MCPcopy Create free account
hub / github.com/KhronosGroup/Vulkan-Samples / generate_sample

Function generate_sample

scripts/generate.py:139–172  ·  view source on GitHub ↗
(template)

Source from the content-addressed store, hash-verified

137 return True
138
139def generate_sample(template):
140 def func(args):
141 output_dir = (
142 args.output_dir
143 if args.output_dir
144 else os.path.join(ROOT_DIR, "samples", args.category)
145 )
146
147 if not which("cmake"):
148 print("Missing cmake")
149 sys.exit(1)
150
151 if not prompt_if_path_exists(output_dir, args.name):
152 return
153
154 print(
155 terminal_colors.INFO
156 + "Generating sample project "
157 + args.name
158 + terminal_colors.END
159 )
160
161 check_output(
162 [
163 "cmake",
164 "-DSAMPLE_NAME={}".format(args.name),
165 "-DTEMPLATE_NAME={}".format(template),
166 "-DOUTPUT_DIR={}".format(output_dir),
167 "-P",
168 os.path.join(ROOT_DIR, "bldsys", "cmake", "create_sample_project.cmake"),
169 ]
170 )
171
172 return func
173
174
175if __name__ == "__main__":

Callers 1

generate_sample_helpFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected