Cherry-pick: Make maxctrl rebuild when sources change

Cherry-picked 12e6ada259c38d535003c068a49bc525c33830d8 into 2.3.

Since the maxctrl build process uses add_custom_command, we must
explicitly list the sources that it depends on. With this change, maxctrl
is rebuild whenever the sources change.
This commit is contained in:
Markus Mäkelä 2019-09-15 07:23:42 +03:00
parent 56defbfdec
commit abe73c7b31
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19

View File

@ -6,7 +6,10 @@ if (BUILD_MAXCTRL)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/lib/version.js.in ${CMAKE_CURRENT_BINARY_DIR}/lib/version.js @ONLY)
file(GLOB_RECURSE MAXCTRL_SOURCES lib/*)
add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/maxctrl/maxctrl
DEPENDS ${MAXCTRL_SOURCES} maxctrl.js
COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.sh ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${CMAKE_BINARY_DIR})
add_custom_target(maxctrl ALL DEPENDS ${CMAKE_BINARY_DIR}/maxctrl/maxctrl)