added custom release macros

This commit is contained in:
Andrei Yankovich 2021-10-24 16:43:27 +03:00
parent 06982362ec
commit b4f0a17911
2 changed files with 28 additions and 0 deletions

View File

@ -78,6 +78,10 @@ For get more information about this function see oficial [documentation](https:/
---
**initRelease** - Сreate the general release target for all subtargets addRelease. This method need to call before invoice all addRelease methods.
**addReleaseCustom** (name pyFile) - This function prepare to run pyFile and add dependencies for release target.
- name - This is prefix of added subtarget (any word).
- pyFile This is python script for release project.
**addReleaseSnap** (name) - Сreate subtargets for publish snap deployed snap package.
- name - This is prefix of added subtarget (any word).

View File

@ -73,6 +73,10 @@
# *** Release ***
# initRelease() // Create the general release target for all subtargets addRelease. This method need to call before invoice all addRelease methods.
#
# addReleaseCustom(name pyFile) // This function prepare to run pyFile and add dependencies for release target.
# - name - This is prefix of added subtarget (any word).
# - pyFile This is python script for release project.
#
# addReleaseSnap(name) // Create subtargets for publish snap deployed snap package.
# - name - This is prefix of added subtarget (any word).
#
@ -504,6 +508,26 @@ function(initRelease)
endfunction()
function(addReleaseCustom name pyFile)
if(TARGET pyRelease${name})
message("the pyRelease${name} target already created!")
return()
endif(TARGET pyRelease${name})
ADD_CUSTOM_TARGET(
pyRelease${name}
COMMAND python pyFile
COMMENT "pyRelease${name} release: run python ${pyFile}"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
add_dependencies(release pyRelease${name})
endfunction()
function(addReleaseSnap name)
if(TARGET snapRelease${name})