1
This commit is contained in:
parent
a29fd84e0b
commit
b7620ff057
@ -52,15 +52,13 @@ target_link_libraries(${APP_NAME}
|
|||||||
${CMAKE_SOURCE_DIR}/third_party/lib/libpaho-mqtt3c.a
|
${CMAKE_SOURCE_DIR}/third_party/lib/libpaho-mqtt3c.a
|
||||||
)
|
)
|
||||||
|
|
||||||
# 拷贝配置文件
|
# 拷贝配置文件(仅在不存在时)
|
||||||
add_custom_command(TARGET ${APP_NAME} POST_BUILD
|
add_custom_command(TARGET ${APP_NAME} POST_BUILD
|
||||||
COMMAND sh -c
|
COMMAND sh -c
|
||||||
"if [ ! -f \"$<TARGET_FILE_DIR:${APP_NAME}>/${CONFIG_FILE}\" ]; then \
|
"test -f \"$<TARGET_FILE_DIR:${APP_NAME}>/${CONFIG_FILE}\" || \
|
||||||
mkdir -p \"$<TARGET_FILE_DIR:${APP_NAME}>\" && \
|
(mkdir -p \"$<TARGET_FILE_DIR:${APP_NAME}>\" && \
|
||||||
cp \"${CMAKE_SOURCE_DIR}/${CONFIG_EXAMPLE_FILE}\" \
|
cp \"${CMAKE_SOURCE_DIR}/${CONFIG_EXAMPLE_FILE}\" \
|
||||||
\"$<TARGET_FILE_DIR:${APP_NAME}>/${CONFIG_FILE}\" && \
|
\"$<TARGET_FILE_DIR:${APP_NAME}>/${CONFIG_FILE}\" && \
|
||||||
echo \"config.json created from example\"; \
|
echo \"config.json created from example\")"
|
||||||
else \
|
|
||||||
echo \"config.json exists, keep it\"; \
|
|
||||||
fi"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user