可能重复:
How to compile additional source files in cmake after the build process
我需要预处理一个proc文件(Pro * C oracle)来生成一个C文件,然后沿着剩下的C文件编译它,我试图解决它而没有像这样成功
add_custom_command(TARGET my_proj OUTPUT PRE_LINK
COMMAND ${PCC} iname=${PROJECT_SOURCE_DIR}/${conn}.proc
SQLCHECK=SYNTAX MODE=ANSI IRECLEN=255 ORECLEN=255
ONAME=${PROJECT_SOURCE_DIR}/${conn}.c
COMMAND "${CMAKE_C_COMPILER}" ${CMAKE_C_FLAGS} ${PROJECT_SOURCE_DIR}/${conn}.c
)
我做错了什么?