[cmake-developers] add_custom_commad build error with ninja generator
Nils Gladitz
nilsgladitz at gmail.com
Thu Apr 10 03:09:55 EDT 2014
On 04/10/2014 07:01 AM, Claus Klein wrote:
> Hi all,
>
> I have problems with the following cmake build script:
>
> find_program(CCP_EXECUTABLE cpp REQUIRED HINTS /opt/local/bin)
> find_program(ASN1C_EXECUTABLE asn1c REQUIRED HINTS /opt/local/bin)
find_program() does not understand "REQUIRED" (sadly it does not
complain either):
www.cmake.org/cmake/help/git-master/command/find_program.html
>
>
> ### adding a custom command to produce an output.
> add_custom_target(OUTPUT ${ASN1_SOURCES}
> COMMAND ${ASN1C_EXECUTABLE} -S
> ${CMAKE_CURRENT_SOURCE_DIR}/../../skeletons
> -pdu=all ${ASN1C_OUTPUT_DIR}/_sample.asn1
> COMMAND astyle *.c *.h
> DEPENDS ${ASN1C_OUTPUT_DIR}/_sample.asn1
> WORKING_DIRECTORY ${ASN1C_OUTPUT_DIR}
> VERBATIM)
add_custom_target() does not have an OUTPUT option, the first parameter
is the target name:
www.cmake.org/cmake/help/git-master/command/add_custom_target.html
add_custom_command() does:
www.cmake.org/cmake/help/git-master/command/add_custom_command.html
You may also want to try the user's mailing list rather than the
developer's mailing list since your issues aren't related to the
development of CMake itself.
Nils
More information about the cmake-developers
mailing list