Skip to content
Snippets Groups Projects
Commit 307e9eb5 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

cmake - silence cmake warning

DEPENDS is not accepted for TARGET in add_custom_command (CMP0175)

Behavior in old cmake: just ignore DEPENDS
Behavior starting from cmake 3.30: warn
The fix: remove DEPENDS

TARGET form requires exactly one of PRE_BUILD, PRE_LINK or POST_BUILD to be given (CMP0175)

Behavior in old CMAKE: assume POST_BUILD
Behavior starting from cmake 3.30: assume POST_BUILD but warn
The fix: explicitely set POST_BUILD
parent d9e43493
Branches
Tags
No related merge requests found
......@@ -484,10 +484,9 @@ macro(compile_py_files module out_dir compiled_files_name)
list(APPEND ${compiled_files_name} ${_out_file})
get_filename_component(_in_name ${input_file} NAME)
file(MAKE_DIRECTORY ${out_dir})
add_custom_command(TARGET ${module}
add_custom_command(TARGET ${module} POST_BUILD
COMMAND ${Python_EXECUTABLE} -c "import py_compile;py_compile.compile(\"${_in_file}\",\"${_out_file}\",\"${_in_name}\",doraise=True)"
VERBATIM DEPENDS ${input_file}
)
VERBATIM)
endforeach()
endmacro()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment