qi_generate_src(): adding dependency to the generator does not work on Visual
Closed this issue · 2 comments
dmerejkowsky commented
Seen with the automatic test in qibuild/test/test_qibuild_make.py
: test_codegen_fail_when_generating_command_fails
Using
set(_out "${CMAKE_BINARY_DIR}/main.cpp")
qi_generate_src(${_out}
SRC main.in.cpp
COMMAND ${_cmd}
DEPENDS "${_gen_py}"
)
qi_create_bin(test_foo "${_out}")
Does not cause main.cpp
to be re-generated when gen_py
changes. (At least when using Visual Studio). Using Ninja works.
dmerejkowsky commented
Note: workaround is to add the generator to the sources of the executable:
qi_create_bin(test_foo "${_out}" "${_gen_py}")
dmerejkowsky commented
Fixed in CMake 3.5.2 \o/