這是我的代碼:如何讓add_custom_target只在「make」上運行,NOT!在「讓安裝」
add_custom_target (ts2qm)
file (GLOB _TS_FILES "*.ts")
foreach (_TS_FILE ${_TS_FILES})
# ...
add_custom_command(TARGET ts2qm POST_BUILD COMMAND "runme")
# ...
endforeach (_TS_FILE ${_TS_FILES})
add_dependencies(../${PACKAGE} ts2qm)
所以,當我點擊「製作」如預期這一目標被觸發,但是......期間「讓安裝」也引發問題....這裏是:如何避免在「make install」中觸發?
謝謝。
/EDIT1:
file (GLOB _TS_FILES "*.ts")
foreach (_TS_FILE ${_TS_FILES})
# ...
add_custom_command(OUTPUT locales.txt COMMAND "runme")
# ...
endforeach (_TS_FILE ${_TS_FILES})
add_custom_target (locales DEPENDS locales.txt)
add_dependencies(../${PACKAGE} locales)
具有相同的結果:(
它有道理嗎?您需要'POST_BUILD'步驟來創建目標。在安裝目標時,您還需要在安裝之前創建目標。如果target可以不用'POST_BUILD'步驟創建,那麼爲什麼你需要它? – 2014-02-13 08:49:43