CMake/QuasarAppCITargets.cmake

553 lines
16 KiB
CMake
Raw Normal View History

#
2020-12-17 18:11:22 +03:00
# Copyright (C) 2018-2021 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 functions :
#
# The library contains 2 methods type it is Added methods and init methods.
# All inits method must be invoked before adds methods. If you change order then some add method will be ignored.
2020-12-12 12:40:24 +03:00
#
# ***Testing***
# addTestsArg( name testExec arg ) // Name target for test utility of your application.
# - name - Prefix for target (any word).
# - testExec - Name of tests utility (without extensions).
# - arg - Arguments for testExec.
#
# addTests (name testExec )// Name target for test utility of your application (without arguments).
# - name - Prefix for target (any word).
# - testExec - Name of tests utility (without extensions).
#
# initTests - Init main test target for tessting all added tests, this method need to call before all invoiced addTests methods.
#
#
# *** Deployment ***
# 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).
#
# addDeployFromFile(name) // Some as initDeploy, but use CQtDeployer.json for configuration.
# - name - This is prefix of added subtarget (any word).
#
# addDeployFromCustomFile(name file) // Some as initDeploy, but use custom path for deployment file for configuration.
# - name - This is prefix of added subtarget (any word).
# - file - This is path to config file of cqtdeployer.
2020-04-22 21:09:56 +03:00
#
# addDeploySnap(name targetDir) // Add to deploy step substeps for create a snap package.
# - name - This is prefix of added subtarget (any word).
# - targetDir - Destanation direcroty for snap files.
#
# 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.
#
# 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).
2021-04-22 17:16:58 +03:00
# - android_src - Path to folder with the android_manifest file.
# - aliase - Aliase for key store.
# - keystore - Path of key store.
# - keystorePass - Pass of keystore file.
# - targetDir - Target dir for output apk file.
# - extraLibs - list f the extra libraryes (like the openssl)
#
# initDeploy() // Create a main deploy target for all addDeploy subtargets. This method need to call before invoiced of all addDeploy methods.
#
#
# *** Release ***
# initRelease() // Create the general release target for all subtargets addRelease. This method need to call before invoice all addRelease methods.
#
# addReleaseSnap(name) // Create subtargets for publish snap deployed snap package.
# - name - This is prefix of added subtarget (any word).
#
# addReleaseQif(name sourceDir targetDir) // Create subtargets for publish the qif package on qif repository.
# - name - This is prefix of added subtarget (any word).
# - sourceDir - Path to folder with qif template.
# - targetDir - Path to target directory.
2020-04-26 15:14:38 +03:00
#
#
# *** Dcumentation ***
# initDoc() // Create the general doc target for all subtargets addDoc. This method need to call before invoice 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.
2020-04-26 15:14:38 +03:00
#
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
2021-04-22 17:16:58 +03:00
if (ANDROID)
include(${CMAKE_CURRENT_LIST_DIR}/qt-android-cmake/AddQtAndroidApk.cmake)
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-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
2021-04-21 19:33:53 +03:00
set(EXEC_TEST "${CMAKE_CURRENT_BINARY_DIR}/${testExec}")
2021-04-21 19:25:49 +03:00
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)
2021-04-21 19:33:53 +03:00
set(EXEC_TEST "${CMAKE_CURRENT_BINARY_DIR}/${testExec}.exe")
2021-04-21 19:25:49 +03:00
set(RUN_CMD "${DIR_FOR_TESTING}/${name}/${testExec}.exe")
2020-05-03 16:10:42 +03:00
endif (WIN32)
2021-04-20 17:01:36 +03:00
2020-05-03 16:10:42 +03:00
find_program(Q_MAKE_EXE qmake)
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 ${CMAKE_SOURCE_DIR} -recursiveDepth 5
COMMENT "Deploy Test: cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${CMAKE_SOURCE_DIR} -recursiveDepth 5"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2020-05-03 16:10:42 +03:00
)
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
2021-04-21 19:33:53 +03:00
set(EXEC_TEST "${CMAKE_CURRENT_BINARY_DIR}/${testExec}")
2021-04-21 19:25:49 +03:00
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)
2021-04-21 19:33:53 +03:00
set(EXEC_TEST "${CMAKE_CURRENT_BINARY_DIR}/${testExec}.exe")
2021-04-21 19:25:49 +03:00
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
ADD_CUSTOM_TARGET(
deployTest${name}
COMMAND cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${CMAKE_SOURCE_DIR} -recursiveDepth 5
COMMENT "Deploy Test: cqtdeployer clear -bin ${EXEC_TEST} -qmake ${Q_MAKE_EXE} -targetDir ${DIR_FOR_TESTING}/${name} -libDir ${CMAKE_SOURCE_DIR} -recursiveDepth 5"
2020-05-03 16:10:42 +03:00
)
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 ${CMAKE_SOURCE_DIR}
2020-04-22 21:09:56 +03:00
)
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-08 18:30:19 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
deploy${name}
2021-04-21 19:18:21 +03:00
COMMAND cqtdeployer clear -binPrefix \"${CMAKE_BINARY_DIR}\" -bin ${targets} -qmake ${Q_MAKE_EXE} -targetDir ${targetDir} -libDir ${CMAKE_SOURCE_DIR} -recursiveDepth 5
COMMENT "Deploy: cqtdeployer clear -binPrefix \"${CMAKE_BINARY_DIR}\" -bin ${targets} -qmake ${Q_MAKE_EXE} -targetDir ${targetDir} -libDir ${CMAKE_SOURCE_DIR} -recursiveDepth 5"
WORKING_DIRECTORY ${CMAKE_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-08 18:30:19 +03:00
ADD_CUSTOM_TARGET(
2020-04-22 21:09:56 +03:00
deploy${name}
2021-05-09 10:10:34 +03:00
COMMAND cqtdeployer -qmake ${Q_MAKE_EXE} -binPrefix \"${CMAKE_BINARY_DIR}\"
COMMENT "Deploy: cqtdeployer -qmake ${Q_MAKE_EXE} -binPrefix \"${CMAKE_BINARY_DIR}\""
WORKING_DIRECTORY ${CMAKE_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)
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}
2021-04-21 19:18:21 +03:00
COMMAND cqtdeployer -qmake ${Q_MAKE_EXE} -binPrefix \"${CMAKE_BINARY_DIR}\" -confFile ${file}
COMMENT "Deploy: cqtdeployer -qmake ${Q_MAKE_EXE} -binPrefix \"${CMAKE_BINARY_DIR}\" -confFile ${file}"
WORKING_DIRECTORY ${CMAKE_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 before deploy this project! Use: sudo snap install snapcraft --classic")
2020-04-21 21:29:57 +03:00
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 ${CMAKE_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 ${CMAKE_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 ${CMAKE_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 ${CMAKE_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()
function(addDeployAPK name android_src aliase keystore keystorePass targetDir extraLibs)
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
2021-04-19 16:43:34 +03:00
IF(NOT DEFINED ENV{ANDROID_SDK_ROOT})
message("the ANDROID_SDK_ROOT is not defined. define ANDROID_SDK_ROOT variable and run cmake again!")
2020-04-21 21:29:57 +03:00
return()
2021-04-19 16:43:34 +03:00
endif()
2020-04-21 21:29:57 +03:00
2021-04-27 00:18:17 +03:00
IF(DEFINED ENV{ANDROID_API_VERSION})
set(ANDROID_PLATFORM_LEVEL $ENV{ANDROID_API_VERSION})
else()
2021-04-28 14:53:12 +03:00
set(ANDROID_PLATFORM_LEVEL 30)
endif()
message("The ANDROID_PLATFORM_LEVEL = ${ANDROID_PLATFORM_LEVEL}")
2021-04-22 17:16:58 +03:00
add_qt_android_apk(createAPK${name} ${name}
PACKAGE_SOURCES ${android_src}
KEYSTORE ${keystore} ${aliase}
KEYSTORE_PASSWORD ${keystorePass}
DEPENDS ${extraLibs}
2021-04-22 17:16:58 +03:00
)
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}"
2021-04-27 11:15:18 +03:00
WORKING_DIRECTORY ${QT_ANDROID_APP_BINARY_DIR}/build/outputs/apk/release
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 ${CMAKE_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 ${CMAKE_SOURCE_DIR}
2020-04-09 21:45:58 +03:00
)
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 ${CMAKE_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 ${CMAKE_SOURCE_DIR}
2020-04-26 15:14:38 +03:00
)
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()