diff options
author | Maarten Bezemer <maarten.bezemer@gmail.com> | 2014-11-12 13:39:07 +0100 |
---|---|---|
committer | Anders Broman <a.broman58@gmail.com> | 2014-12-17 09:05:59 +0000 |
commit | cc8ed845ed53ed60fa776728f1d7f2659dd311a3 (patch) | |
tree | 10de2c1f80a3decc59bb37b8d7aefde830b5238b /cmake/modules | |
parent | a1d4c0a792e07af4422dfe8446e0ac63cb1131d0 (diff) |
Invoke asn2wrs.py using a custom command
A custom target is defined to be always invalid, so asn2wrs.py is always invoked.
A custom command is able to convert input file(s) into output file(s), the actual command is only invoked in the provided dependencies are changed.
As an advantage the dependencies are correct, so cmake is able to determine when the output file is required, so it can be build in time.
Change-Id: I84be5d408cfc87cf88d67b6073bea439febbe712
Reviewed-on: https://code.wireshark.org/review/5255
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'cmake/modules')
-rw-r--r-- | cmake/modules/UseAsn2Wrs.cmake | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cmake/modules/UseAsn2Wrs.cmake b/cmake/modules/UseAsn2Wrs.cmake index 50792fdf78..f8c317e565 100644 --- a/cmake/modules/UseAsn2Wrs.cmake +++ b/cmake/modules/UseAsn2Wrs.cmake @@ -21,7 +21,8 @@ MACRO(ASN2WRS) # Don't use packet-${PROTOCOL_NAME}.c instead of generate_dissector, it will # cause EXCLUDE_FROM_ALL to be ignored. - ADD_CUSTOM_TARGET(generate_dissector-${PROTOCOL_NAME} ALL + ADD_CUSTOM_COMMAND( + OUTPUT packet-${PROTOCOL_NAME}.c COMMAND ${PYTHON_EXECUTABLE} ${ASN2WRS_EXECUTABLE} ${A2W_FLAGS} @@ -38,8 +39,8 @@ MACRO(ASN2WRS) ) foreach( _asn2wrs_export_file IN LISTS EXPORT_FILES ) - ADD_CUSTOM_TARGET( ${_asn2wrs_export_file} - WORKING_DIRECTORY . + ADD_CUSTOM_COMMAND( + OUTPUT ${_asn2wrs_export_file} COMMAND ${PYTHON_EXECUTABLE} ${ASN2WRS_EXECUTABLE} -E |