diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-28 10:54:13 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-06-28 10:54:13 +0200 |
commit | e1678ddb435b3afc2c590b420d4cb5570cb8daf1 (patch) | |
tree | a006c46f98d9d60dbbc0cad68c45677030948dc0 | |
parent | a8103b6f53a89fcbaeea225ab1a4d6624b242176 (diff) |
Custom targets depends on input files
Change-Id: I315df31ac299cf43c9bf7c5d7ee0043f65c5946c
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
-rw-r--r-- | cmake/cmake.d/03-extra_targets.cmake | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/cmake/cmake.d/03-extra_targets.cmake b/cmake/cmake.d/03-extra_targets.cmake index fe9358a..c1d38e8 100644 --- a/cmake/cmake.d/03-extra_targets.cmake +++ b/cmake/cmake.d/03-extra_targets.cmake @@ -94,9 +94,11 @@ add_custom_target(archive DEPENDS ${ARCHIVE_OUTPUT}) if(NOT EXISTS ${RPM_TEMPLATE_DIR}/rpm-config.spec.in) MESSAGE(FATAL_ERROR "${Red}Missing mandatory files: you need rpm-config.spec.in in ${RPM_TEMPLATE_DIR} folder.${ColourReset}") endif() + set(PACKAGING_SPEC_OUTPUT ${PROJECT_PKG_ENTRY_POINT}/${NPKG_PROJECT_NAME}.spec) -add_custom_command(OUTPUT ${PACKAGING_SPEC_OUTPUT} - COMMAND ${CMAKE_COMMAND} -DINFILE=${RPM_TEMPLATE_DIR}/rpm-config.spec.in -DOUTFILE=${PACKAGING_SPEC_OUTPUT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + add_custom_command(OUTPUT ${PACKAGING_SPEC_OUTPUT} + DEPENDS ${RPM_TEMPLATE_DIR}/rpm-config.spec.in + COMMAND ${CMAKE_COMMAND} -DINFILE=${RPM_TEMPLATE_DIR}/rpm-config.spec.in -DOUTFILE=${PACKAGING_SPEC_OUTPUT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake ) # ---------------------------------------------------------------------------- @@ -112,6 +114,12 @@ if(OSRELEASE MATCHES "debian") ${PACKAGING_DEB_OUTPUT_COMPAT} ${PACKAGING_DEB_OUTPUT_CONTROL} ${PACKAGING_DEB_OUTPUT_RULES} + DEPENDS ${DEB_TEMPLATE_DIR}/debian.compat.in + ${DEB_TEMPLATE_DIR}/debian.changelog.in + ${DEB_TEMPLATE_DIR}/deb-config.dsc.in + ${DEB_TEMPLATE_DIR}/deb-config.install.in + ${DEB_TEMPLATE_DIR}/debian.control.in + ${DEB_TEMPLATE_DIR}/debian.rules.in COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/debian.compat.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_COMPAT} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/debian.changelog.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_CHANGELOG} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake COMMAND ${CMAKE_COMMAND} -DINFILE=${DEB_TEMPLATE_DIR}/deb-config.dsc.in -DOUTFILE=${PACKAGING_DEB_OUTPUT_DSC} -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake @@ -162,9 +170,10 @@ endforeach() add_custom_command(OUTPUT ${CMAKE_SOURCE_DIR}/conf.d/autobuild/agl/autobuild ${CMAKE_SOURCE_DIR}/conf.d/autobuild/linux/autobuild - COMMAND ${CMAKE_COMMAND} -DINFILE=${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in -DOUTFILE=${CMAKE_SOURCE_DIR}/conf.d/autobuild/agl/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND ${CMAKE_COMMAND} -DINFILE=${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in -DOUTFILE=${CMAKE_SOURCE_DIR}/conf.d/autobuild/linux/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake - COMMAND rsync -azp ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild ${CMAKE_SOURCE_DIR}/conf.d + DEPENDS ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in + ${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/linux/autobuild.in + COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in -DOUTFILE=${CMAKE_SOURCE_DIR}/conf.d/autobuild/agl/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake + COMMAND ${CMAKE_COMMAND} -DINFILE=${CMAKE_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/autobuild/agl/autobuild.in -DOUTFILE=${CMAKE_SOURCE_DIR}/conf.d/autobuild/linux/autobuild -DPROJECT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR} -P ${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_APP_TEMPLATES_DIR}/cmake/configure_file.cmake ) add_custom_target(autobuild ALL DEPENDS ${CMAKE_SOURCE_DIR}/conf.d/autobuild/agl/autobuild |