[cmake-developers] Python extension to FindProtobuf

Andreas Bergmeier a.bergmeier at dsfishlabs.com
Mon Sep 14 03:42:59 EDT 2015


I now added documentation, removed ARGS and GENERATED property.

-----Original Message-----
From: Brad King [mailto:brad.king at kitware.com]
Sent: Freitag, 11. September 2015 20:33
To: Andreas Bergmeier
Cc: Rolf Eike Beer; cmake-developers at cmake.org
Subject: Re: [cmake-developers] Python extension to FindProtobuf

On 09/11/2015 11:11 AM, Andreas Bergmeier wrote:
> Here is the commit.

Thanks.  Please revise the patch to also update the documentation of the module to mention the new API.

> +    list(APPEND ${SRCS} "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.py")
> +    add_custom_command(
> +      OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${FIL_WE}.pb.py"
> +      COMMAND  ${PROTOBUF_PROTOC_EXECUTABLE}
> +      ARGS --python_out  ${CMAKE_CURRENT_BINARY_DIR}
> + ${_protobuf_include_path} ${ABS_FIL}

The ARGS option can be dropped.  It is silently ignored anyway.
The arguments after it will be collected by COMMAND already.

> +      DEPENDS ${ABS_FIL} ${PROTOBUF_PROTOC_EXECUTABLE}
> +      COMMENT "Running Python protocol buffer compiler on ${FIL}"
> +      VERBATIM )
> +  endforeach()
> +
> +  set_source_files_properties(${${SRCS}} PROPERTIES GENERATED TRUE)

We do not need to explicitly set the GENERATED property.  That convention has been outdated for years.  The add_custom_command call automatically sets this on the OUTPUT.

Thanks,
-Brad

________________________________
 Diese E-mail enthält VERTRAULICHE UND PERSÖNLICHE INFORMATIONEN und/oder PRIVILEGIERTE UND VERTRAULICHE MITTEILUNGEN, die ausschließlich für die angesprochenen Empfänger bestimmt sind. Ohne ausdrückliche schriftliche Zustimmung des Absenders dürfen diese Informationen und Mitteilungen nicht an irgendeinen Dritten außerhalb der Organisation des Empfängers weitergeleitet oder zur Kenntnis gebracht werden. Wenn Sie diese E-mail versehentlich empfangen haben, teilen Sie dies bitte dem Absender umgehend telefonisch oder durch Rücksendung dieser E-mail mit, und zerstören Sie die Mail sowie Ihre evtl. Rückmail bitte anschließend, ohne eine Kopie zu erstellen. Koch Media übernimmt keinerlei Verantwortung für mögliche Verluste oder Beschädigungen, resultierend aus virus-infizierten E-mails bzw. Viren in Anhängen.

This e-mail may contain CONFIDENTIAL AND PROPRIETARY INFORMATION and/or PRIVILEGED AND CONFIDENTIAL COMMUNICATION intended solely for the recipient and, therefore, may not be retransmitted to any party outside of the recipient's organization without the prior written consent of the sender. If you have received this e-mail in error please notify the sender immediately by telephone or reply e-mail and destroy the original message without making a copy. Koch Media accepts no liability for any losses or damages resulting from infected e-mail transmissions and viruses in e-mail attachment.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: commit-226ffb3
Type: application/octet-stream
Size: 3608 bytes
Desc: commit-226ffb3
URL: <http://public.kitware.com/pipermail/cmake-developers/attachments/20150914/6a2ccce1/attachment.obj>


More information about the cmake-developers mailing list