Home > Back-end >  Cmake running python scripts
Cmake running python scripts

Time:09-25

Good eldest brother, the younger brother novice cmake, belongs to the novice, now have a question want to consult everybody:
There is now a protocol to automatically generate the python scripts, I want to join the cmake build system, automatically when the cmake build so my python scripts, this is my problem, now the code is written like this: I
SET (PROTOCOL_FILES test_protocol. XML)
The SET (${CMAKE_CURRENT_SOURCE_DIR}/proto_generate PROTOCOL_GEN_CMD. Py)
The FOREACH (PROTOCOL_FILE ${PROTOCOL_FILES})
STRING (REPLACE ". The XML "" h" OUT_PROTOCOL_FILE ${PROTOCOL_FILE})
SET (ALL_PROTOCOL_OUTPUT_FILES ${ALL_PROTOCOL_OUTPUT_FILES} ${OUT_PROTOCOL_FILE})
ADD_CUSTOM_COMMAND (
The OUTPUT of ${OUT_PROTOCOL_FILE}
The COMMAND python ${PROTOCOL_GEN_CMD} ${PROTOCOL_FILE} ${OUT_PROTOCOL_FILE}
DEPENDS ${PROTOCOL_FILE}
)
# EXEC_PROGRAM (python ${PROTOCOL_GEN_CMD} ${PROTOCOL_FILE} ${OUT_PROTOCOL_FILE})
ENDFOREACH ()
But perform cmake. Later, without any error message and response, inside the loop I print a few variable values, are all very normal, I estimate is ADD_CUSTOM_COMMAND this command is wrong, or ignore use, (ps: the python scripts I run under Linux is normal)
Don't know if everyone have what good method? Only 60 points, everyone help, thank you very much

CodePudding user response:



Send the wrong BBS?

CodePudding user response:

Can try xmake
  • Related