CMake/QuasarAppCITargets.cmake

576 lines
17 KiB
CMake
Raw Normal View History

#
# 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.
#
# This module implementation next cmake cunctions :
#
#
# ***Testing***
2020-04-22 21:09:56 +03:00
# addTestsArg( name testExec arg ) // name target for test utiliry of your application
# - name - prefix for taget (any word)
# - testExec - name of tests utility (without extensions)
# - arg - arguments fot testExec
#
2020-04-22 21:09:56 +03:00
# addTests (name testExec )// name target for test utiliry of your application (without arguments)
# - name - prefix for taget (any word)
# - testExec - name of tests utility (without extensions)
#
2020-05-09 00:39:13 +03:00
# initTests - init main test target for tessting all added tests, this method need to call befor all invoced addTests methods.
#
#
# *** Deployment ***
2020-04-22 21:09:56 +03:00
# addDeploy(name targets targetDir) // add deploy target for deployed your application via cqtdeployer tool
# - name - this is prefix of added subtarget (any word)
# - 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)
#
2020-04-22 21:09:56 +03:00
# addDeployFromFile(name) // some as initDeploy but use CQtDeployer.json for configuration.
# - name - this is prefix of added subtarget (any word)
#
2020-04-22 21:09:56 +03:00
# addDeployFromCustomFile(name file) // some as initDeploy but use custo path for deployment file for configuration.
# - name - this is prefix of added subtarget (any word)
# - file - this is path to config file of cqtdeployer
#
# addDeploySnap(name targetDir) // add to deploy step substeps for create a snap package
# - name - this is prefix of added subtarget (any word)
# - targetDir - distanation direcroty for snap files
#
2020-04-22 21:09:56 +03:00
# addDeployQIF(name sourceDir targetDir config) // add to deploy step substeps for create Qt Install FrameWork Installer
# - name - this is prefix of added subtarget (any word)
# - location for created installer
# - sourceDir - path to folder with qif template
# - config - path to config file of qif template
#
2020-04-22 21:09:56 +03:00
# addDeployAPK(name input aliase keystore keystorePass targetDir) // add subtargets of deploy setep for create signed android apk file
# - name - this is prefix of added subtarget (any word)
# - 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-05-09 00:39:13 +03:00
# initDeploy() // create a main deploy target fpr all addDeploy subtargets. this method need to call befor invoced of all addDeploy methods
#
#
# *** Release ***
2020-05-09 00:39:13 +03:00
# initRelease() // create the general release target for all subtargets addRelease. This method need to call befor invoce all addRelease methods.
#
2020-04-26 15:14:38 +03:00
# addReleaseSnap(name) // create subtargets for publish snap deployed snap package
2020-04-22 21:09:56 +03:00
# - name - this is prefix of added subtarget (any word)
#
2020-04-26 15:14:38 +03:00
# addReleaseQif(name sourceDir targetDir) // create subtargets for publish the qif package on qif repository
2020-04-22 21:09:56 +03:00
# - name - this is prefix of added subtarget (any word)
2020-04-09 21:45:58 +03:00
# - sourceDir - path to folder with qif template
# - targetDir - path to target derictory
2020-04-26 15:14:38 +03:00
#
#
# *** Dcumentation ***
2020-05-09 00:39:13 +03:00
# initDoc() // create the general doc target for all subtargets addDoc. This method need to call befor invoce all addDoc methods.
2020-04-26 15:14:38 +03:00
#
# addDoc(name doxygenFile) // create subtargets for generate documentation of cpp code
# - name - this is prefix of added subtarget (any word)
# - doxygenFile - this is path to doxygen configuration file
#
if(DEFINED QUASARAPP_DEFAULT_TARGETS)
return()
else()
set(QUASARAPP_DEFAULT_TARGETS 1)
endif()
2020-04-26 15:14:38 +03:00
set(DOC_TARGETS_LIST "")
2020-04-22 21:09:56 +03:00
set(TEST_TARGETS_LIST "")
set(DEPLOY_TARGETS_LIST "")
set(RELEASE_TARGETS_LIST "")
2020-05-03 16:10:42 +03:00
set(DIR_FOR_TESTING ${PROJECT_SOURCE_DIR}/Testing)
2020-04-22 21:09:56 +03:00
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-05-03 16:10:42 +03:00
function(initTests)
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
if(TARGET test)
message("the test target already created!")
return()
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
endif(TARGET test)
2020-04-19 17:01:28 +03:00
2020-05-03 16:10:42 +03:00
message("test sub targets: ${TEST_TARGETS_LIST}")
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
ADD_CUSTOM_TARGET(
test
COMMENT "=================== Run Test ==================="
2020-05-09 00:39:13 +03:00
DEPENDS
2020-05-03 16:10:42 +03:00
)
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
message("prepare tests for ${TEST_TARGETS_LIST}")
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
endfunction()
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
function(addTestsArg name testExec arg)
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
if(TARGET test${name})
message("the test${name} target already created!")
return()
endif(TARGET test${name})
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec})
set(RUN_CMD ${DIR_FOR_TESTING}/${name}/${testExec}.sh)
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
if (WIN32)
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec}.exe)
set(RUN_CMD ${DIR_FOR_TESTING}/${name}/${testExec}.exe)
2020-05-03 16:10:42 +03:00
endif (WIN32)
2020-05-03 16:10:42 +03:00
find_program(Q_MAKE_EXE qmake)
2020-05-03 16:10:42 +03:00
find_program(CQT_EXE cqtdeployer)
2020-04-21 21:29:57 +03:00
2020-05-03 16:10:42 +03:00
IF(NOT EXISTS ${CQT_EXE})
message("the cqtdeployer not exits please install the cqtdeployer and run cmake again!")
return()
endif(NOT EXISTS ${CQT_EXE})
ADD_CUSTOM_TARGET(
deployTest${name}
COMMAND cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5
COMMENT "Deploy Test: cqtdeployer clear -bin ${EXEC_TEST} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
2020-04-21 21:29:57 +03:00
2020-05-03 16:10:42 +03:00
ADD_CUSTOM_TARGET(
test${name}
COMMAND ${RUN_CMD} ${arg}
COMMENT "=================== Run Test ==================="
WORKING_DIRECTORY ${DIR_FOR_TESTING}/${name}
DEPENDS deployTest${name}
)
2020-05-09 00:39:13 +03:00
add_dependencies(test test${name})
2020-04-22 21:09:56 +03:00
2020-05-03 16:10:42 +03:00
endfunction()
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
function(addTests name testExec)
2020-05-03 16:10:42 +03:00
if(TARGET test${name})
message("the test${name} target already created!")
return()
2020-05-03 16:10:42 +03:00
endif(TARGET test${name})
2020-04-19 17:11:21 +03:00
2020-05-03 16:10:42 +03:00
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec})
set(RUN_CMD ${DIR_FOR_TESTING}/${name}/${testExec}.sh)
2020-04-19 17:01:28 +03:00
2020-05-03 16:10:42 +03:00
if (WIN32)
set(EXEC_TEST ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${testExec}.exe)
set(RUN_CMD ${DIR_FOR_TESTING}/${name}/${testExec}.exe)
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
endif (WIN32)
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
find_program(Q_MAKE_EXE qmake)
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
find_program(CQT_EXE cqtdeployer)
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
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-04-21 21:29:57 +03:00
2020-05-03 16:10:42 +03:00
ADD_CUSTOM_TARGET(
deployTest${name}
COMMAND cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5
COMMENT "Deploy Test: cqtdeployer clear -bin ${EXEC_TEST} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${PROJECT_SOURCE_DIR} -recursiveDepth 5"
)
2020-04-21 21:29:57 +03:00
2020-05-03 16:10:42 +03:00
ADD_CUSTOM_TARGET(
test${name}
COMMAND ${RUN_CMD}
COMMENT "=================== Run Test ==================="
WORKING_DIRECTORY ${DIR_FOR_TESTING}/${name}
DEPENDS deployTest${name}
)
2020-05-09 00:39:13 +03:00
add_dependencies(test test${name})
2020-05-03 16:10:42 +03:00
message("prepare tests for ${RUN_CMD}")
2020-04-04 19:49:49 +03:00
2020-05-03 16:10:42 +03:00
endfunction()
2020-04-22 21:09:56 +03:00
function(initDeploy)
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-22 21:09:56 +03:00
message("deploy subtargets: ${DEPLOY_TARGETS_LIST}")
ADD_CUSTOM_TARGET(
deploy
COMMENT "=================== Run deploy ==================="
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
endfunction()
function(addDeploy name targets targetDir)
if(TARGET deploy${name})
message("the deploy${name} target already created!")
return()
endif(TARGET deploy${name})
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!")
return()
endif(NOT EXISTS ${CQT_EXE})
2020-04-08 18:30:19 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
deploy${name}
2020-04-08 18:30:19 +03:00
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"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-08 18:30:19 +03:00
)
2020-05-09 00:39:13 +03:00
add_dependencies(deploy deploy${name})
endfunction()
2020-04-22 21:09:56 +03:00
function(addDeployFromFile name)
2020-04-04 19:49:49 +03:00
2020-04-22 21:09:56 +03:00
if(TARGET deploy${name})
message("the deploy${name} target already created!")
2020-04-19 17:11:21 +03:00
return()
2020-04-22 21:09:56 +03:00
endif(TARGET deploy${name})
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!")
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(
2020-04-22 21:09:56 +03:00
deploy${name}
2020-09-23 08:39:59 +03:00
COMMAND cqtdeployer -qmake ${Q_MAKE_EXE} -confFile ${name}
COMMENT "Deploy: cqtdeployer -qmake ${Q_MAKE_EXE} -confFile ${name}"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-08 18:30:19 +03:00
)
2020-05-09 00:39:13 +03:00
add_dependencies(deploy deploy${name})
2020-04-22 21:09:56 +03:00
endfunction()
function(addDeployFromCustomFile name file)
if(TARGET deploy${name})
message("the deploy${name} target already created!")
return()
endif(TARGET deploy${name})
find_program(Q_MAKE_EXE qmake)
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-04-08 18:30:19 +03:00
2020-04-04 19:49:49 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
deploy${name}
COMMAND cqtdeployer -qmake ${Q_MAKE_EXE} -confFile ${file}
COMMENT "Deploy: cqtdeployer -qmake ${Q_MAKE_EXE} -confFile ${file}"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-04 19:49:49 +03:00
)
2020-05-09 00:39:13 +03:00
add_dependencies(deploy deploy${name})
2020-04-22 21:09:56 +03:00
2020-04-04 19:49:49 +03:00
endfunction()
2020-04-22 21:09:56 +03:00
function(addDeploySnap name targetDir)
2020-04-22 21:09:56 +03:00
if(TARGET snap${name})
message("the snap${name} target already created!")
2020-04-19 17:11:21 +03:00
return()
2020-04-22 21:09:56 +03:00
endif(TARGET snap${name})
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")
return()
endif(NOT EXISTS ${SNAPCRAFT_EXE})
2020-04-04 19:49:49 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
snapClear${name}
COMMAND snapcraft clean
2020-04-08 18:30:19 +03:00
COMMENT "clear snap: snapcraft clear"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-08 18:30:19 +03:00
)
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
snapcraft${name}
2020-04-08 18:30:19 +03:00
COMMAND snapcraft
COMMENT "create snap: snapcraft"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-05-04 12:09:39 +03:00
DEPENDS deploy${name} snapClear${name}
2020-04-08 18:30:19 +03:00
)
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
snapcraftCopy${name}
COMMAND ${CMAKE_COMMAND} -E copy *.snap ${targetDir}
2020-05-04 12:09:39 +03:00
COMMENT "copy snap: ${CMAKE_COMMAND} -E copy *.snap ${targetDir}"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-05-04 12:09:39 +03:00
DEPENDS snapcraft${name}
2020-04-08 18:30:19 +03:00
)
2020-04-21 21:29:57 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
snap${name}
COMMENT "deploy snap${name}"
2020-05-04 12:09:39 +03:00
DEPENDS snapcraftCopy${name}
2020-04-21 21:29:57 +03:00
)
2020-05-09 00:39:13 +03:00
add_dependencies(deploy snap${name})
2020-04-22 21:09:56 +03:00
2020-04-08 18:30:19 +03:00
endfunction()
2020-04-22 21:09:56 +03:00
function(addDeployQIF name sourceDir targetDir config)
2020-04-08 18:30:19 +03:00
2020-04-22 21:09:56 +03:00
if(TARGET qifDeploy${name})
message("the qifDeploy${name} target already created!")
2020-04-19 17:11:21 +03:00
return()
2020-04-22 21:09:56 +03:00
endif(TARGET qifDeploy${name})
2020-04-19 17:01:28 +03:00
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!")
return()
endif(NOT EXISTS ${BINARYCREATOR_EXE})
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.run)
2020-04-08 18:30:19 +03:00
if (WIN32)
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.exe)
2020-04-08 18:30:19 +03:00
endif (WIN32)
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
qifDeploy${name}
2020-04-08 18:30:19 +03:00
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}"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-25 13:57:44 +03:00
DEPENDS deploy${name}
)
2020-05-09 00:39:13 +03:00
add_dependencies(deploy qifDeploy${name})
2020-04-22 21:09:56 +03:00
endfunction()
2020-04-22 21:09:56 +03:00
function(addDeployAPK name input aliase keystore keystorePass targetDir)
2020-04-22 21:09:56 +03:00
if(TARGET deployAPK${name})
message("the deployAPK${name} target already created!")
2020-04-19 17:11:21 +03:00
return()
2020-04-22 21:09:56 +03:00
endif(TARGET deployAPK${name})
2020-04-19 17:01:28 +03:00
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!")
return()
endif(NOT DEFINED $ENV{ANDROID_HOME})
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-22 21:09:56 +03:00
createAPK${name}
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-22 21:09:56 +03:00
deployAPK${name}
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-22 21:09:56 +03:00
DEPENDS createAPK${name}
2020-04-09 21:45:58 +03:00
)
2020-05-09 00:39:13 +03:00
add_dependencies(deploy deployAPK${name})
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-22 21:09:56 +03:00
message("release subtargets: ${RELEASE_TARGETS_LIST}")
2020-04-19 17:01:28 +03:00
ADD_CUSTOM_TARGET(
release
COMMENT "=================== Relese project ==================="
2020-04-04 19:49:49 +03:00
)
endfunction()
2020-04-22 21:09:56 +03:00
function(addReleaseSnap name)
2020-04-22 21:09:56 +03:00
if(TARGET snapRelease${name})
message("the snapRelease${name} target already created!")
2020-04-19 17:11:21 +03:00
return()
2020-04-22 21:09:56 +03:00
endif(TARGET snapRelease${name})
2020-04-19 17:01:28 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
snapRelease${name}
2020-04-08 18:30:19 +03:00
COMMAND snapcraft push
2020-04-22 21:09:56 +03:00
COMMENT "snapRelease${name} release"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-08 18:30:19 +03:00
)
2020-05-09 00:39:13 +03:00
add_dependencies(release snapRelease${name})
2020-04-08 18:30:19 +03:00
endfunction()
2020-04-22 21:09:56 +03:00
function(addReleaseQif name sourceDir targetDir)
if(TARGET qifRelease${name})
message("the qifRelease${name} target already created!")
2020-04-19 17:11:21 +03:00
return()
2020-04-22 21:09:56 +03:00
endif(TARGET qifRelease${name})
2020-04-19 17:01:28 +03:00
2020-04-09 21:45:58 +03:00
find_program(BINARYCREATOR_EXE binarycreator)
2020-04-22 21:09:56 +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!")
return()
endif(NOT EXISTS ${BINARYCREATOR_EXE})
2020-04-09 21:45:58 +03:00
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.run)
if (WIN32)
set(OUT_EXE ${targetDir}/${PROJECT_NAME}OfllineInstaller.exe)
endif (WIN32)
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
qifDeployOnline${name}
2020-04-09 21:45:58 +03:00
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(
2020-04-22 21:09:56 +03:00
qifRelease${name}
2020-04-08 18:30:19 +03:00
COMMAND ${CMAKE_COMMAND} -E copy_directory
${sourceDir}
${CMAKE_BINARY_DIR}/Repo
2020-04-22 21:09:56 +03:00
COMMENT "qifRelease${name} release ${CMAKE_COMMAND} -E copy_directory ${sourceDir} ${CMAKE_BINARY_DIR}/Repo"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
2020-04-22 21:09:56 +03:00
DEPENDS qifDeployOnline${name}
2020-04-08 18:30:19 +03:00
)
2020-04-22 21:09:56 +03:00
set(RELEASE_TARGETS_LIST ${RELEASE_TARGETS_LIST} qifRelease${name} PARENT_SCOPE)
2020-05-09 00:39:13 +03:00
add_dependencies(release qifRelease${name})
endfunction()
2020-04-26 15:14:38 +03:00
function(addDoc name doxygenFile)
if(TARGET doxygen${name})
message("the doxygen${name} target already created!")
return()
endif(TARGET doxygen${name})
find_program(DOXYGEN_EXECUTABLE doxygen)
IF(NOT EXISTS ${DOXYGEN_EXECUTABLE})
message("the doxygen not exits please install or add a path to doxygen to a PATH envirement variable and run cmake again!")
return()
endif(NOT EXISTS ${DOXYGEN_EXECUTABLE})
ADD_CUSTOM_TARGET(
doxygen${name}
COMMAND ${DOXYGEN_EXECUTABLE} ${doxygenFile}
COMMENT "${DOXYGEN_EXECUTABLE} ${doxygenFile}"
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
2020-05-09 00:39:13 +03:00
add_dependencies(doc doxygen${name})
2020-04-26 15:14:38 +03:00
endfunction()
function(initDoc)
if(TARGET doc)
message("the doc target already created!")
return()
endif(TARGET doc)
message("doc subtargets: ${DOC_TARGETS_LIST}")
ADD_CUSTOM_TARGET(
doc
COMMENT "=================== Run generate docs ==================="
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
)
endfunction()
function(initAll)
2020-05-03 16:10:42 +03:00
initTests()
2020-04-26 15:14:38 +03:00
initDoc()
2020-04-22 21:09:56 +03:00
initDeploy()
initRelease()
endfunction()