From 8bb4863ebd082b130c4282d49f3e1d2ead26855c Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Wed, 27 Jun 2018 19:07:21 +0200 Subject: Don't overwrite the autobuild script if it exists Bug-AGL: SPEC-1529 Change-Id: I0c048e8bfe4f8eb23f31fb22808168b706cf12f8 Signed-off-by: Romain Forlot --- cmake/cmake.d/04-extra_targets.cmake | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'cmake') diff --git a/cmake/cmake.d/04-extra_targets.cmake b/cmake/cmake.d/04-extra_targets.cmake index cce367d..d1b446c 100644 --- a/cmake/cmake.d/04-extra_targets.cmake +++ b/cmake/cmake.d/04-extra_targets.cmake @@ -45,8 +45,12 @@ endforeach() # Autobuild target # ---------------------------------------------------------------------------- -add_custom_target(autobuild ALL DEPENDS ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/agl/autobuild.in +add_custom_command(OUTPUT ${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild ${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild + DEPENDS ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/agl/autobuild.in ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/linux/autobuild.in - COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + + COMMAND [ ! -f "${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild" ] && ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake || exit 0 + COMMAND [ ! -f "${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild" ] && ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/template.d/autobuild/agl/autobuild.in -DOUTFILE=${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake || exit 0 ) + +add_custom_target(autobuild ALL DEPENDS ${PROJECT_TEMPLATE_AGL_AUTOBUILD_DIR}/autobuild ${PROJECT_TEMPLATE_LINUX_AUTOBUILD_DIR}/autobuild) -- cgit 1.2.3-korg