2020-03-29 14:21:17 +03:00
|
|
|
#
|
|
|
|
# Copyright (C) 2018-2020 QuasarApp.
|
|
|
|
# Distributed under the MIT software license, see the accompanying
|
|
|
|
# Everyone is permitted to copy and distribute verbatim copies
|
|
|
|
# of this license document, but changing it is not allowed.
|
|
|
|
#
|
|
|
|
|
2020-04-09 17:54:18 +03:00
|
|
|
|
|
|
|
# This module implementation next cmake cunctions :
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# ***Testing***
|
|
|
|
# initTestsArg( testExec arg ) // init "test" target for test utiliry of your application
|
|
|
|
# - testExec - name of tests utility (without extensions)
|
|
|
|
# - arg - arguments fot testExec
|
|
|
|
#
|
|
|
|
# initTests // init "test" target for test utiliry of your application (without arguments)
|
|
|
|
# - testExec - name of tests utility (without extensions)
|
|
|
|
#
|
|
|
|
# initTestsDefault - init empty target tests
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# *** Deployment ***
|
|
|
|
# initDeploy(targets targetDir) // init deploy target for deployed your application via cqtdeployer tool
|
|
|
|
# - targets - this is list of cqtdeployer targets see cqtdeployer help https://github.com/QuasarApp/CQtDeployer/wiki/Options (-bin)
|
|
|
|
# - targetDir - this is target directory see option targetDir of cqtdeployer help https://github.com/QuasarApp/CQtDeployer/wiki/Options (-targetDir)
|
|
|
|
#
|
|
|
|
# initDeployQML(targets targetDir qml) // some as initDeploy but with qml location option
|
|
|
|
# - targets - this is list of cqtdeployer targets see cqtdeployer help https://github.com/QuasarApp/CQtDeployer/wiki/Options (-bin)
|
|
|
|
# - targetDir - this is target directory see option targetDir of cqtdeployer help https://github.com/QuasarApp/CQtDeployer/wiki/Options (-targetDir)
|
|
|
|
# - qml - this is qml location dir see help of qmlDir option of cqtdeployer help https://github.com/QuasarApp/CQtDeployer/wiki/Options (-qmlDir)
|
|
|
|
#
|
|
|
|
# initDeploySnap(targetDir) // add to deploy step substeps for create a snap package
|
|
|
|
# - targetDir - distanation direcroty for snap files
|
|
|
|
#
|
|
|
|
# initDeployQIF(sourceDir targetDir config) // add to deploy step substeps for create Qt Install FrameWork Installer
|
|
|
|
# - location for created installer
|
|
|
|
# - sourceDir - path to folder with qif template
|
|
|
|
# - config - path to config file of qif template
|
|
|
|
#
|
|
|
|
# initDeployAPK(input aliase keystore keystorePass targetDir) // add subtargets of deploy setep for create signed android apk file
|
|
|
|
# - input - path to input android json file : *-deployment-settings.json
|
|
|
|
# - aliase - aliase for key store
|
|
|
|
# - keystore - path of key store
|
|
|
|
# - keystorePass - pass of keystore file
|
|
|
|
# - targetDir - target dir for output apk file
|
|
|
|
#
|
2020-04-21 21:29:57 +03:00
|
|
|
# initDeployAPKDefault // add empty target for deploy apk file
|
|
|
|
#
|
2020-04-09 17:54:18 +03:00
|
|
|
# initDeployDefault() // create a enpty step for deployment
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# *** Release ***
|
|
|
|
# initRelease() // create the general release target
|
|
|
|
#
|
|
|
|
# initReleaseSnap() // create subtargets for publish snap deployed snap package
|
|
|
|
#
|
2020-04-09 21:45:58 +03:00
|
|
|
# initReleaseQif(sourceDir targetDir) // create subtargets for publish the qif package on qif repository
|
|
|
|
# - sourceDir - path to folder with qif template
|
|
|
|
# - targetDir - path to target derictory
|
2020-04-09 17:54:18 +03:00
|
|
|
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
if(DEFINED QUASARAPP_DEFAULT_TARGETS)
|
|
|
|
return()
|
|
|
|
else()
|
|
|
|
set(QUASARAPP_DEFAULT_TARGETS 1)
|
|
|
|
endif()
|
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
function(emptyTarget targetName)
|
|
|
|
|
|
|
|
if(TARGET ${targetName})
|
|
|
|
message("the ${targetName} target already created!")
|
|
|
|
return()
|
|
|
|
|
|
|
|
endif(TARGET ${targetName})
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
${targetName}
|
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
function(initTestsArg testExec arg)
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET test)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the test target already created!")
|
|
|
|
return()
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET test)
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec})
|
|
|
|
set(RUN_CMD BuildetTests/${testExec}.sh)
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
if (WIN32)
|
2020-04-04 19:49:49 +03:00
|
|
|
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec}.exe)
|
|
|
|
set(RUN_CMD BuildetTests/${testExec}.exe)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
endif (WIN32)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
find_program(Q_MAKE_EXE qmake)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
find_program(CQT_EXE cqtdeployer)
|
|
|
|
|
|
|
|
IF(NOT EXISTS ${CQT_EXE})
|
|
|
|
message("the cqtdeployer not exits please install the cqtdeployer and run cmake again!")
|
|
|
|
return()
|
|
|
|
endif(NOT EXISTS ${CQT_EXE})
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
deployTest
|
2020-04-04 19:49:49 +03:00
|
|
|
COMMAND cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${PROJECT_SOURCE_DIR}/BuildetTests -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5
|
|
|
|
COMMENT "Deploy Test: cqtdeployer clear -bin ${EXEC_TEST} -targetDir BuildetTests -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5"
|
2020-03-29 14:21:17 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
test
|
2020-04-04 19:49:49 +03:00
|
|
|
COMMAND ${RUN_CMD} ${arg}
|
2020-03-29 14:21:17 +03:00
|
|
|
COMMENT "=================== Run Test ==================="
|
2020-04-04 19:49:49 +03:00
|
|
|
WORKING_DIRECTORY BuildetTests
|
2020-03-29 14:21:17 +03:00
|
|
|
DEPENDS deployTest
|
|
|
|
)
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
message("prepare tests for ${RUN_CMD} with arg : ${arg}")
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(initTests testExec)
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET test)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the test target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET test)
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec})
|
|
|
|
set(RUN_CMD ${PROJECT_SOURCE_DIR}/BuildetTests/${testExec}.sh)
|
|
|
|
|
|
|
|
if (WIN32)
|
|
|
|
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec}.exe)
|
|
|
|
set(RUN_CMD ${PROJECT_SOURCE_DIR}/BuildetTests/${testExec}.exe)
|
|
|
|
|
|
|
|
endif (WIN32)
|
|
|
|
|
|
|
|
find_program(Q_MAKE_EXE qmake)
|
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
find_program(CQT_EXE cqtdeployer)
|
|
|
|
|
|
|
|
IF(NOT EXISTS ${CQT_EXE})
|
|
|
|
message("the cqtdeployer not exits please install the cqtdeployer and run cmake again!")
|
|
|
|
return()
|
|
|
|
endif(NOT EXISTS ${CQT_EXE})
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
deployTest
|
2020-04-04 19:49:49 +03:00
|
|
|
COMMAND cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${PROJECT_SOURCE_DIR}/BuildetTests -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5
|
|
|
|
COMMENT "Deploy Test: cqtdeployer clear -bin ${EXEC_TEST} -targetDir BuildetTests -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5"
|
2020-03-29 14:21:17 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
test
|
2020-04-04 19:49:49 +03:00
|
|
|
COMMAND ${RUN_CMD}
|
2020-03-29 14:21:17 +03:00
|
|
|
COMMENT "=================== Run Test ==================="
|
2020-04-04 19:49:49 +03:00
|
|
|
WORKING_DIRECTORY BuildetTests
|
2020-03-29 14:21:17 +03:00
|
|
|
DEPENDS deployTest
|
|
|
|
)
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
message("prepare tests for ${RUN_CMD}")
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
endfunction()
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
function(initDeploy targets targetDir)
|
2020-04-04 19:49:49 +03:00
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET deploy)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the deploy target already created!")
|
|
|
|
return()
|
|
|
|
|
|
|
|
endif(TARGET deploy)
|
2020-04-19 17:01:28 +03:00
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
find_program(Q_MAKE_EXE qmake)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
find_program(CQT_EXE cqtdeployer)
|
|
|
|
|
|
|
|
IF(NOT EXISTS ${CQT_EXE})
|
|
|
|
message("the cqtdeployer not exits please install the cqtdeployer and run cmake again!")
|
|
|
|
emptyTarget(cqtdeployer)
|
|
|
|
return()
|
|
|
|
endif(NOT EXISTS ${CQT_EXE})
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
cqtdeployer
|
|
|
|
COMMAND cqtdeployer clear -bin ${targets} -qmake ${Q_MAKE_EXE} -targetDir ${targetDir} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5
|
|
|
|
COMMENT "Deploy: cqtdeployer clear -bin ${targets} -qmake ${Q_MAKE_EXE} -targetDir ${targetDir} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
2020-04-04 19:49:49 +03:00
|
|
|
deploy
|
2020-04-08 18:30:19 +03:00
|
|
|
COMMENT "=================== Run deploy ==================="
|
2020-04-21 21:29:57 +03:00
|
|
|
DEPENDS cqtdeployer qifDeploy snap deployAPK
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
function(initDeployQML targets targetDir qml)
|
2020-04-04 19:49:49 +03:00
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET deploy)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the deploy target already created!")
|
|
|
|
return()
|
|
|
|
|
|
|
|
endif(TARGET deploy)
|
2020-04-19 17:01:28 +03:00
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
find_program(Q_MAKE_EXE qmake)
|
2020-04-21 21:29:57 +03:00
|
|
|
find_program(CQT_EXE cqtdeployer)
|
|
|
|
|
|
|
|
IF(NOT EXISTS ${CQT_EXE})
|
|
|
|
message("the cqtdeployer not exits please install the cqtdeployer and run cmake again!")
|
|
|
|
emptyTarget(cqtdeployer)
|
|
|
|
return()
|
|
|
|
endif(NOT EXISTS ${CQT_EXE})
|
2020-04-04 19:49:49 +03:00
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
cqtdeployer
|
|
|
|
COMMAND cqtdeployer clear -bin ${targets} -qmake ${Q_MAKE_EXE} -targetDir ${targetDir} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5 -qmlDir ${qml}
|
|
|
|
COMMENT "Deploy: cqtdeployer clear -bin ${targets} -qmake ${Q_MAKE_EXE} -targetDir ${targetDir} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5 -qmlDir ${qml}"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
deploy
|
2020-04-08 18:30:19 +03:00
|
|
|
COMMENT "=================== Run deploy ==================="
|
2020-04-21 21:29:57 +03:00
|
|
|
DEPENDS cqtdeployer qifDeploy snap deployAPK
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
2020-04-21 21:29:57 +03:00
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
2020-04-09 17:54:18 +03:00
|
|
|
function(initDeploySnap targetDir)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET snapcraft)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the snapcraft target already created!")
|
|
|
|
return()
|
|
|
|
|
|
|
|
endif(TARGET snapcraft)
|
2020-04-19 17:01:28 +03:00
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
find_program(SNAPCRAFT_EXE "snapcraft")
|
|
|
|
|
|
|
|
if(NOT EXISTS ${SNAPCRAFT_EXE})
|
|
|
|
message("please install the snapcraft befor deploy this project! Use: sudo snap install snapcraft --classic")
|
|
|
|
emptyTarget(snap)
|
|
|
|
return()
|
|
|
|
endif(NOT EXISTS ${SNAPCRAFT_EXE})
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
2020-04-08 18:30:19 +03:00
|
|
|
snapClear
|
2020-04-09 17:54:18 +03:00
|
|
|
COMMAND snapcraft clean
|
2020-04-08 18:30:19 +03:00
|
|
|
COMMENT "clear snap: snapcraft clear"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
snapcraft
|
|
|
|
COMMAND snapcraft
|
|
|
|
COMMENT "create snap: snapcraft"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
snapcraftCopy
|
2020-04-09 17:54:18 +03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy *.snap ${targetDir}
|
|
|
|
COMMENT "copt snap: ${CMAKE_COMMAND} -E copy *.snap ${targetDir}"
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
snap
|
|
|
|
COMMENT "deploy snap"
|
|
|
|
DEPENDS snapClear snapcraft snapcraftCopy
|
|
|
|
|
|
|
|
)
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(initDeployQIF sourceDir targetDir config)
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET qifDeploy)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the qifDeploy target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET qifDeploy)
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
find_program(BINARYCREATOR_EXE binarycreator)
|
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
IF(NOT EXISTS ${BINARYCREATOR_EXE})
|
|
|
|
message("the Binarycreator not exits please install or adde path to QtInstaller Framework to PATH and run cmake again!")
|
|
|
|
emptyTarget(qifDeploy)
|
|
|
|
return()
|
|
|
|
endif(NOT EXISTS ${BINARYCREATOR_EXE})
|
|
|
|
|
2020-04-09 17:54:18 +03:00
|
|
|
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.run)
|
2020-04-08 18:30:19 +03:00
|
|
|
if (WIN32)
|
2020-04-09 17:54:18 +03:00
|
|
|
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.exe)
|
2020-04-08 18:30:19 +03:00
|
|
|
endif (WIN32)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
qifDeploy
|
|
|
|
COMMAND ${BINARYCREATOR_EXE} --offline-only -c ${config} -p ${sourceDir}/packages ${OUT_EXE}
|
|
|
|
COMMENT "deploy qif: ${BINARYCREATOR_EXE} --offline-only -c ${config} -p ${sourceDir}/packages ${OUT_EXE}"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(initDeployAPK input aliase keystore keystorePass targetDir)
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET deployAPK)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the deployAPK target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET deployAPK)
|
|
|
|
|
2020-04-21 21:29:57 +03:00
|
|
|
IF(NOT DEFINED $ENV{ANDROID_HOME})
|
|
|
|
message("the ANDROID_HOME is not defined. define ANDROID_HOME variable and run cmake again!")
|
|
|
|
emptyTarget(deployAPK)
|
|
|
|
return()
|
|
|
|
endif(NOT DEFINED $ENV{ANDROID_HOME})
|
|
|
|
|
|
|
|
|
2020-04-09 17:54:18 +03:00
|
|
|
set(OUTPUT_ANDROID "--output ${PROJECT_SOURCE_DIR}/AndroidBuild")
|
|
|
|
set(INPUT_ANDROID "--input ${input}")
|
|
|
|
set(JDK "--jdk /usr")
|
|
|
|
set(SIGN "--sign '${keystore}' --storepass '${keystorePass}' --keypass '${keystorePass}' --release")
|
|
|
|
|
|
|
|
find_program(A_DEPLOYER androiddeployqt)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
2020-04-09 21:45:58 +03:00
|
|
|
createAPK
|
2020-04-09 17:54:18 +03:00
|
|
|
COMMAND ${A_DEPLOYER} ${INPUT_ANDROID} ${OUTPUT_ANDROID} ${JDK} --gradle ${SIGN}
|
|
|
|
COMMENT "Run deploy android apk : ${A_DEPLOYER} ${INPUT_ANDROID} ${OUTPUT_ANDROID} ${JDK} --gradle ${SIGN}"
|
|
|
|
)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
2020-04-09 21:45:58 +03:00
|
|
|
deployAPK
|
2020-04-09 17:54:18 +03:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy *.apk ${targetDir}
|
|
|
|
COMMENT "copt apk: ${CMAKE_COMMAND} -E copy *.apk ${targetDir}"
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/AndroidBuild/build/outputs/apk/
|
2020-04-09 21:45:58 +03:00
|
|
|
DEPENDS createAPK
|
|
|
|
|
2020-04-09 17:54:18 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(initRelease)
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET release)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the release target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET release)
|
|
|
|
|
2020-04-09 17:54:18 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
release
|
|
|
|
COMMENT "=================== Relese project ==================="
|
|
|
|
DEPENDS snapRelease qifRelease
|
2020-04-04 19:49:49 +03:00
|
|
|
)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
function(initReleaseSnap)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET snapRelease)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the snapRelease target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET snapRelease)
|
|
|
|
|
2020-03-29 14:21:17 +03:00
|
|
|
ADD_CUSTOM_TARGET(
|
2020-04-08 18:30:19 +03:00
|
|
|
snapRelease
|
|
|
|
COMMAND snapcraft push
|
|
|
|
COMMENT "snapcraft release"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
2020-04-09 21:45:58 +03:00
|
|
|
function(initReleaseQif sourceDir targetDir)
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET qifRelease)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the qifRelease target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET qifRelease)
|
|
|
|
|
2020-04-09 21:45:58 +03:00
|
|
|
find_program(BINARYCREATOR_EXE binarycreator)
|
|
|
|
|
|
|
|
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.run)
|
|
|
|
if (WIN32)
|
|
|
|
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.exe)
|
|
|
|
endif (WIN32)
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
qifDeployOnline
|
|
|
|
COMMAND ${BINARYCREATOR_EXE} --online-only -c ${config} -p ${sourceDir}/packages ${OUT_EXE}
|
|
|
|
COMMENT "deploy qif online: ${BINARYCREATOR_EXE} --online-only -c ${config} -p ${sourceDir}/packages ${OUT_EXE}"
|
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
|
|
|
|
|
|
|
)
|
2020-04-08 18:30:19 +03:00
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
qifRelease
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy_directory
|
|
|
|
${sourceDir}
|
|
|
|
${CMAKE_BINARY_DIR}/Repo
|
|
|
|
COMMENT "qifRelease release ${CMAKE_COMMAND} -E copy_directory ${sourceDir} ${CMAKE_BINARY_DIR}/Repo"
|
2020-04-09 17:54:18 +03:00
|
|
|
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
|
2020-04-09 21:45:58 +03:00
|
|
|
DEPENDS qifDeployOnline
|
2020-04-08 18:30:19 +03:00
|
|
|
)
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(initTestsDefault)
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET test)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the test target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET test)
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
message("init empty tests")
|
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
test
|
|
|
|
COMMENT "=================== Run Test ==================="
|
2020-03-29 14:21:17 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
2020-04-04 19:49:49 +03:00
|
|
|
function(initDeployDefault)
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET deploy)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the deploy target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET deploy)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
deploy
|
|
|
|
COMMENT "=================== Run deploy ==================="
|
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
2020-04-08 18:30:19 +03:00
|
|
|
function(initReleaseDefault)
|
2020-04-19 17:01:28 +03:00
|
|
|
if(TARGET release)
|
2020-04-19 17:11:21 +03:00
|
|
|
message("the release target already created!")
|
|
|
|
return()
|
|
|
|
|
2020-04-19 17:01:28 +03:00
|
|
|
endif(TARGET release)
|
2020-03-29 14:21:17 +03:00
|
|
|
|
|
|
|
ADD_CUSTOM_TARGET(
|
|
|
|
release
|
|
|
|
COMMENT "=================== Run release ==================="
|
|
|
|
)
|
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|
|
|
|
function(initAll)
|
2020-04-04 19:49:49 +03:00
|
|
|
initTestsDefault()
|
|
|
|
initDeployDefault()
|
2020-04-08 18:30:19 +03:00
|
|
|
initReleaseDefault()
|
2020-03-29 14:21:17 +03:00
|
|
|
|
|
|
|
endfunction()
|
|
|
|
|