2009-10-09 16:24:22 +00:00
|
|
|
#
|
2021-01-06 19:43:37 +00:00
|
|
|
function(register_plugin_files _outputfile _registertype)
|
2014-11-16 15:07:45 +00:00
|
|
|
include(LocatePythonModule)
|
2017-11-19 00:20:20 +00:00
|
|
|
locate_python_module(make-plugin-reg REQUIRED PATHS ${CMAKE_SOURCE_DIR}/tools)
|
2014-11-16 15:07:45 +00:00
|
|
|
|
2021-01-06 19:43:37 +00:00
|
|
|
file(RELATIVE_PATH output "${CMAKE_BINARY_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/${_outputfile}")
|
|
|
|
add_custom_command(
|
2012-09-25 01:20:51 +00:00
|
|
|
OUTPUT
|
2009-10-09 16:24:22 +00:00
|
|
|
${_outputfile}
|
|
|
|
COMMAND ${PYTHON_EXECUTABLE}
|
2017-11-19 00:20:20 +00:00
|
|
|
${PY_MAKE-PLUGIN-REG}
|
2009-10-09 16:24:22 +00:00
|
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
2017-11-20 19:58:46 +00:00
|
|
|
${_registertype}
|
|
|
|
${ARGN}
|
2021-01-06 19:43:37 +00:00
|
|
|
COMMENT "Generating ${output}"
|
2009-10-09 16:24:22 +00:00
|
|
|
DEPENDS
|
2017-11-20 19:58:46 +00:00
|
|
|
${ARGN}
|
2017-11-19 00:20:20 +00:00
|
|
|
${PY_MAKE-PLUGIN-REG}
|
2009-10-09 16:24:22 +00:00
|
|
|
)
|
2021-01-06 19:43:37 +00:00
|
|
|
endfunction()
|