1 # Copyright 2012 Intel Corporation
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22 set(piglit_dispatch_gen_script ${CMAKE_SOURCE_DIR}/tests/util/gen_dispatch.py)
23 set(piglit_dispatch_gen_output_dir ${CMAKE_BINARY_DIR}/tests/util)
25 file(MAKE_DIRECTORY ${piglit_dispatch_gen_output_dir})
27 set(piglit_dispatch_gen_outputs
28 ${piglit_dispatch_gen_output_dir}/piglit-dispatch-gen.c
29 ${piglit_dispatch_gen_output_dir}/piglit-dispatch-gen.h
30 ${piglit_dispatch_gen_output_dir}/piglit-util-gl-enum-gen.c
33 set(piglit_dispatch_gen_depends
34 ${CMAKE_SOURCE_DIR}/registry/__init__.py
35 ${CMAKE_SOURCE_DIR}/registry/gl.py
36 ${CMAKE_SOURCE_DIR}/registry/gl.xml
37 ${CMAKE_SOURCE_DIR}/tests/util/gen_dispatch.py
38 ${CMAKE_SOURCE_DIR}/tests/util/piglit-dispatch-gen.c.mako
39 ${CMAKE_SOURCE_DIR}/tests/util/piglit-dispatch-gen.h.mako
40 ${CMAKE_SOURCE_DIR}/tests/util/piglit-util-gl-enum-gen.c.mako
44 OUTPUT ${piglit_dispatch_gen_outputs}
45 DEPENDS ${piglit_dispatch_gen_depends}
46 COMMAND ${PYTHON_EXECUTABLE} ${piglit_dispatch_gen_script} --out-dir ${piglit_dispatch_gen_output_dir}
49 add_custom_target(piglit_dispatch_gen
50 DEPENDS ${piglit_dispatch_gen_outputs}