mirror of
https://github.com/QuasarApp/CQtDeployerServer.git
synced 2025-04-26 12:44:31 +00:00
Initial commit
This commit is contained in:
commit
489e59f669
67
.gitignore
vendored
Normal file
67
.gitignore
vendored
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
# C++ objects and libs
|
||||||
|
*.slo
|
||||||
|
*.lo
|
||||||
|
*.o
|
||||||
|
*.a
|
||||||
|
*.la
|
||||||
|
*.lai
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*.dll
|
||||||
|
*.dylib
|
||||||
|
|
||||||
|
# Qt-es
|
||||||
|
object_script.*.Release
|
||||||
|
object_script.*.Debug
|
||||||
|
*_plugin_import.cpp
|
||||||
|
/.qmake.cache
|
||||||
|
/.qmake.stash
|
||||||
|
*.pro.user
|
||||||
|
*.pro.user.*
|
||||||
|
*.qbs.user
|
||||||
|
*.qbs.user.*
|
||||||
|
*.moc
|
||||||
|
moc_*.cpp
|
||||||
|
moc_*.h
|
||||||
|
qrc_*.cpp
|
||||||
|
ui_*.h
|
||||||
|
*.qmlc
|
||||||
|
*.jsc
|
||||||
|
Makefile*
|
||||||
|
*build-*
|
||||||
|
tests/build/
|
||||||
|
src/build/
|
||||||
|
*.qm
|
||||||
|
*.prl
|
||||||
|
|
||||||
|
# Qt unit tests
|
||||||
|
target_wrapper.*
|
||||||
|
|
||||||
|
# QtCreator
|
||||||
|
*.autosave
|
||||||
|
|
||||||
|
# QtCreator Qml
|
||||||
|
*.qmlproject.user
|
||||||
|
*.qmlproject.user.*
|
||||||
|
|
||||||
|
# QtCreator CMake
|
||||||
|
CMakeLists.txt.user*
|
||||||
|
|
||||||
|
# QtCreator 4.8< compilation database
|
||||||
|
compile_commands.json
|
||||||
|
|
||||||
|
# QtCreator local machine specific files for imported projects
|
||||||
|
*creator.user*
|
||||||
|
|
||||||
|
CMakeLists.txt.user
|
||||||
|
CMakeCache.txt
|
||||||
|
CMakeFiles
|
||||||
|
CMakeScripts
|
||||||
|
Testing
|
||||||
|
Makefile
|
||||||
|
cmake_install.cmake
|
||||||
|
install_manifest.txt
|
||||||
|
compile_commands.json
|
||||||
|
CTestTestfile.cmake
|
||||||
|
_deps
|
||||||
|
*_autogen*
|
6
.gitmodules
vendored
Normal file
6
.gitmodules
vendored
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
[submodule "CMake"]
|
||||||
|
path = CMake
|
||||||
|
url = https://github.com/QuasarApp/CMake.git
|
||||||
|
[submodule "DoxyStyle"]
|
||||||
|
path = DoxyStyle
|
||||||
|
url = https://github.com/QuasarApp/DoxyStyle.git
|
1
CMake
Submodule
1
CMake
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit 814b6aeb4ea5b3d9985aabe88af92b37f5aed5ad
|
34
CMakeLists.txt
Normal file
34
CMakeLists.txt
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
# of this license document, but changing it is not allowed.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
project(RENAME_ME)
|
||||||
|
if(TARGET ${PROJECT_NAME})
|
||||||
|
message("The ${PROJECT_NAME} arledy included in main Project")
|
||||||
|
return()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
set (QT_VERSION_MAJOR OFF)
|
||||||
|
set (BUILD_SHARED_LIBS ON)
|
||||||
|
|
||||||
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core Test QUIET)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core Test QUIET)
|
||||||
|
|
||||||
|
include(CMake/ccache.cmake)
|
||||||
|
include(CMake/QuasarAppCITargets.cmake)
|
||||||
|
|
||||||
|
# Add sub directories
|
||||||
|
add_subdirectory(src)
|
||||||
|
if (${QT_VERSION_MAJOR})
|
||||||
|
add_subdirectory(tests)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
|
initAll()
|
||||||
|
|
||||||
|
addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
|
||||||
|
addDeployFromCustomFile("RENAME_ME" "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/RENAME_ME.json")
|
19
Deploy/RENAME_ME.json
Normal file
19
Deploy/RENAME_ME.json
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
{
|
||||||
|
"binDir": "./../src/build/Debug/RENAME_MEEaxample",
|
||||||
|
"clear": true,
|
||||||
|
"libDir": "./../",
|
||||||
|
"recursiveDepth": "10",
|
||||||
|
"deploySystem": false,
|
||||||
|
"qmlDir": "../",
|
||||||
|
"ignoreEnv": [
|
||||||
|
"./../installer",
|
||||||
|
"./../Distro",
|
||||||
|
"./../parts",
|
||||||
|
"./../snap",
|
||||||
|
"./../prime",
|
||||||
|
"./../stage"
|
||||||
|
],
|
||||||
|
"extraLib": "crypto",
|
||||||
|
"targetDir": "./../DisttibutionKit"
|
||||||
|
}
|
||||||
|
|
1
DoxyStyle
Submodule
1
DoxyStyle
Submodule
@ -0,0 +1 @@
|
|||||||
|
Subproject commit b3d27bf1bac532d6a2284cbcc9fb5134778c6440
|
165
LICENSE
Normal file
165
LICENSE
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
15
README.md
Normal file
15
README.md
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
# CMakeProject
|
||||||
|
Template repository for cmake project
|
||||||
|
Fork me and replase RENAME_ME to Name of your new project.
|
||||||
|
|
||||||
|
1. Clone this repository
|
||||||
|
2. Run ./init.sh NewProjectName
|
||||||
|
|
||||||
|
# This template supports next build targets:
|
||||||
|
|
||||||
|
| Command or make target | Description |
|
||||||
|
|------|------|
|
||||||
|
| **make test** | The run tests for a project (dependet of Qt Tests, so you need to add Qt in Cmake using CMAKE_PREFIX_PATH) |
|
||||||
|
| **make doc** | The generate a documentation for a project (dependet of doxygen) |
|
||||||
|
| **make deploy** | The generate distribution for a project (dependet of CQtDeployer) |
|
||||||
|
| **make release** | The prepare Qt Installer framework repository for a project, generate a snap package and APK file for android (dependet of CQtDeployer, snapcraft, AndroidDeployer). |
|
2495
doxygen.conf
Normal file
2495
doxygen.conf
Normal file
File diff suppressed because it is too large
Load Diff
33
init.sh
Executable file
33
init.sh
Executable file
@ -0,0 +1,33 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
echo "Project name: $1"
|
||||||
|
|
||||||
|
if [ $# -ne 1 ]
|
||||||
|
then
|
||||||
|
echo "You call this script wtth wrong arguments."
|
||||||
|
echo "Example for start script:"
|
||||||
|
echo "./init.sh MyCmakeProject"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
REPLACESTRING="s+RENAME_ME+$1+g"
|
||||||
|
echo $REPLACESTRING
|
||||||
|
|
||||||
|
find . -not -path '*/\.*' -type f -exec sed -i $REPLACESTRING {} +
|
||||||
|
find . -not -path '*/\.*' -type f -exec sed -i $REPLACESTRING {} +
|
||||||
|
|
||||||
|
find src -type d -name '*RENAME_ME*' -exec sh -c 'x="{}"; NEWSTR=$(echo "$x" | sed "s/RENAME_ME/'$1'/"); mv "$x" "$NEWSTR"' \;
|
||||||
|
|
||||||
|
find src -type f -name '*RENAME_ME*' -exec sh -c 'x="{}"; NEWSTR=$(echo "$x" | sed "s/RENAME_ME/'$1'/"); mv "$x" "$NEWSTR"' \;
|
||||||
|
set -e
|
||||||
|
|
||||||
|
git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
|
||||||
|
while read path_key path
|
||||||
|
do
|
||||||
|
url_key=$(echo $path_key | sed 's/\.path/.url/')
|
||||||
|
url=$(git config -f .gitmodules --get "$url_key")
|
||||||
|
git submodule add $url $path
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
|
|
25
src/CMakeLists.txt
Normal file
25
src/CMakeLists.txt
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
# of this license document, but changing it is not allowed.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
|
||||||
|
include(../CMake/ProjectOut.cmake)
|
||||||
|
include(../CMake/Version.cmake)
|
||||||
|
include(../CMake/tr.cmake)
|
||||||
|
|
||||||
|
add_subdirectory(Library)
|
||||||
|
add_subdirectory(Example)
|
36
src/Example/CMakeLists.txt
Normal file
36
src/Example/CMakeLists.txt
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
# of this license document, but changing it is not allowed.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
|
set(CURRENT_PROJECT "${PROJECT_NAME}Eaxample")
|
||||||
|
|
||||||
|
|
||||||
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
||||||
|
|
||||||
|
file(GLOB SOURCE_CPP
|
||||||
|
"*.cpp" "*.qrc"
|
||||||
|
"src/*.cpp" "src/*.qrc"
|
||||||
|
"src/Private/*.cpp" "src/Private/*.qrc"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||||
|
set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Private")
|
||||||
|
|
||||||
|
add_executable(${CURRENT_PROJECT} ${SOURCE_CPP})
|
||||||
|
|
||||||
|
if (${QT_VERSION_MAJOR})
|
||||||
|
target_link_libraries(${CURRENT_PROJECT} PUBLIC Qt::Core)
|
||||||
|
endif()
|
||||||
|
target_link_libraries(${CURRENT_PROJECT} PUBLIC ${PROJECT_NAME})
|
||||||
|
|
||||||
|
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||||
|
target_include_directories(${CURRENT_PROJECT} PRIVATE ${PRIVATE_INCUDE_DIR})
|
||||||
|
|
||||||
|
|
10
src/Example/src/main.cpp
Normal file
10
src/Example/src/main.cpp
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
int main(int argc, char *argv[]) {
|
||||||
|
return 0;
|
||||||
|
}
|
44
src/Library/CMakeLists.txt
Normal file
44
src/Library/CMakeLists.txt
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
# of this license document, but changing it is not allowed.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
|
add_definitions(-DRENAME_ME_LIBRARY)
|
||||||
|
|
||||||
|
|
||||||
|
find_package(QT NAMES Qt6 Qt5 COMPONENTS Core REQUIRED)
|
||||||
|
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED)
|
||||||
|
|
||||||
|
file(GLOB SOURCE_CPP
|
||||||
|
"*.cpp" "*.qrc"
|
||||||
|
"src/*.cpp" "src/*.qrc"
|
||||||
|
"src/Private/*.cpp" "src/Private/*.qrc"
|
||||||
|
)
|
||||||
|
|
||||||
|
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||||
|
set(PRIVATE_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/src/Private")
|
||||||
|
|
||||||
|
|
||||||
|
add_library(${PROJECT_NAME} ${SOURCE_CPP})
|
||||||
|
|
||||||
|
if (${QT_VERSION_MAJOR})
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC Qt::Core)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
target_include_directories(${PROJECT_NAME} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||||
|
target_include_directories(${PROJECT_NAME} PRIVATE ${PRIVATE_INCUDE_DIR})
|
||||||
|
|
||||||
|
set(LANGS ${CMAKE_CURRENT_SOURCE_DIR}/languages/en.ts)
|
||||||
|
|
||||||
|
|
||||||
|
prepareQM(${CMAKE_CURRENT_SOURCE_DIR} "${LANGS}")
|
||||||
|
|
||||||
|
setVersion(0 0 1)
|
||||||
|
|
||||||
|
set(QML_IMPORT_PATH "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "Qt Creator extra qml import paths")
|
||||||
|
|
4
src/Library/languages/en.ts
Normal file
4
src/Library/languages/en.ts
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!DOCTYPE TS>
|
||||||
|
<TS version="2.1">
|
||||||
|
</TS>
|
19
src/Library/src/RENAME_ME.cpp
Normal file
19
src/Library/src/RENAME_ME.cpp
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "RENAME_ME.h"
|
||||||
|
|
||||||
|
|
||||||
|
namespace RENAME_ME {
|
||||||
|
|
||||||
|
bool init() {
|
||||||
|
initRENAME_MEResources();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
17
src/Library/src/RENAME_ME.h
Normal file
17
src/Library/src/RENAME_ME.h
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include "RENAME_ME_global.h"
|
||||||
|
|
||||||
|
namespace RENAME_ME {
|
||||||
|
|
||||||
|
inline void initRENAME_MEResources() { Q_INIT_RESOURCE(RENAME_ME); }
|
||||||
|
|
||||||
|
|
||||||
|
bool RENAME_ME_EXPORT init();
|
||||||
|
|
||||||
|
};
|
6
src/Library/src/RENAME_ME.qrc
Normal file
6
src/Library/src/RENAME_ME.qrc
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
<RCC>
|
||||||
|
<qresource prefix="/">
|
||||||
|
<file>RENAME_MEModule/qmldir</file>
|
||||||
|
<file>RENAME_MEModule/RENAME_ME.qml</file>
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
12
src/Library/src/RENAME_MEModule/RENAME_ME.qml
Normal file
12
src/Library/src/RENAME_MEModule/RENAME_ME.qml
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2021-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
import QtQuick 2.15
|
||||||
|
|
||||||
|
Item {
|
||||||
|
|
||||||
|
}
|
3
src/Library/src/RENAME_MEModule/qmldir
Normal file
3
src/Library/src/RENAME_MEModule/qmldir
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
module QuasarAppCreditsModule
|
||||||
|
RENAME_ME 1.0 RENAME_ME.qml
|
||||||
|
|
20
src/Library/src/RENAME_ME_global.h
Normal file
20
src/Library/src/RENAME_ME_global.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2018-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#ifndef RENAME_ME_GLOBAL_H
|
||||||
|
#define RENAME_ME_GLOBAL_H
|
||||||
|
|
||||||
|
#include <QtCore/qglobal.h>
|
||||||
|
|
||||||
|
#if defined(RENAME_ME_LIBRARY)
|
||||||
|
# define RENAME_ME_EXPORT Q_DECL_EXPORT
|
||||||
|
#else
|
||||||
|
# define RENAME_ME_EXPORT Q_DECL_IMPORT
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif //RENAME_ME_GLOBAL_H
|
||||||
|
|
73
tests/.gitignore
vendored
Normal file
73
tests/.gitignore
vendored
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# This file is used to ignore files which are generated
|
||||||
|
# ----------------------------------------------------------------------------
|
||||||
|
|
||||||
|
*~
|
||||||
|
*.autosave
|
||||||
|
*.a
|
||||||
|
*.core
|
||||||
|
*.moc
|
||||||
|
*.o
|
||||||
|
*.obj
|
||||||
|
*.orig
|
||||||
|
*.rej
|
||||||
|
*.so
|
||||||
|
*.so.*
|
||||||
|
*_pch.h.cpp
|
||||||
|
*_resource.rc
|
||||||
|
*.qm
|
||||||
|
.#*
|
||||||
|
*.*#
|
||||||
|
core
|
||||||
|
!core/
|
||||||
|
tags
|
||||||
|
.DS_Store
|
||||||
|
.directory
|
||||||
|
*.debug
|
||||||
|
Makefile*
|
||||||
|
*.prl
|
||||||
|
*.app
|
||||||
|
moc_*.cpp
|
||||||
|
ui_*.h
|
||||||
|
qrc_*.cpp
|
||||||
|
Thumbs.db
|
||||||
|
*.res
|
||||||
|
*.rc
|
||||||
|
/.qmake.cache
|
||||||
|
/.qmake.stash
|
||||||
|
|
||||||
|
# qtcreator generated files
|
||||||
|
*.pro.user*
|
||||||
|
|
||||||
|
# xemacs temporary files
|
||||||
|
*.flc
|
||||||
|
|
||||||
|
# Vim temporary files
|
||||||
|
.*.swp
|
||||||
|
|
||||||
|
# Visual Studio generated files
|
||||||
|
*.ib_pdb_index
|
||||||
|
*.idb
|
||||||
|
*.ilk
|
||||||
|
*.pdb
|
||||||
|
*.sln
|
||||||
|
*.suo
|
||||||
|
*.vcproj
|
||||||
|
*vcproj.*.*.user
|
||||||
|
*.ncb
|
||||||
|
*.sdf
|
||||||
|
*.opensdf
|
||||||
|
*.vcxproj
|
||||||
|
*vcxproj.*
|
||||||
|
|
||||||
|
# MinGW generated files
|
||||||
|
*.Debug
|
||||||
|
*.Release
|
||||||
|
|
||||||
|
# Python byte code
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Binaries
|
||||||
|
# --------
|
||||||
|
*.dll
|
||||||
|
*.exe
|
||||||
|
|
39
tests/CMakeLists.txt
Normal file
39
tests/CMakeLists.txt
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#
|
||||||
|
# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
# of this license document, but changing it is not allowed.
|
||||||
|
#
|
||||||
|
|
||||||
|
cmake_minimum_required(VERSION 3.14)
|
||||||
|
|
||||||
|
set(CURRENT_PROJECT ${PROJECT_NAME}Test)
|
||||||
|
|
||||||
|
include(../CMake/ProjectOut.cmake)
|
||||||
|
|
||||||
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 17)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
|
||||||
|
file(GLOB SOURCE_CPP
|
||||||
|
"*.cpp" "*.qrc"
|
||||||
|
"units/*.cpp" "units/*.qrc"
|
||||||
|
)
|
||||||
|
set(PUBLIC_INCUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||||
|
set(PUBLIC_INCUDE_DIR ${PUBLIC_INCUDE_DIR} "${CMAKE_CURRENT_SOURCE_DIR}/units")
|
||||||
|
|
||||||
|
|
||||||
|
add_executable(${CURRENT_PROJECT} ${SOURCE_CPP})
|
||||||
|
target_link_libraries(${CURRENT_PROJECT} PRIVATE Qt::Test RENAME_ME)
|
||||||
|
|
||||||
|
target_include_directories(${CURRENT_PROJECT} PUBLIC ${PUBLIC_INCUDE_DIR})
|
||||||
|
|
||||||
|
|
||||||
|
include(../CMake/QuasarAppCITargets.cmake)
|
||||||
|
initTests()
|
||||||
|
addTests(${PROJECT_NAME} ${CURRENT_PROJECT})
|
84
tests/tstMain.cpp
Normal file
84
tests/tstMain.cpp
Normal file
@ -0,0 +1,84 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
#include <QtTest>
|
||||||
|
#include "exampletest.h"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The tstMain class - this is main test class
|
||||||
|
*/
|
||||||
|
class tstMain : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
private:
|
||||||
|
QList<Test*> _tests;
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
tstMain();
|
||||||
|
|
||||||
|
~tstMain();
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void initTestCase();
|
||||||
|
void unitTests();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief tstMain::tstMain
|
||||||
|
* init all availabel units for testsing
|
||||||
|
*/
|
||||||
|
tstMain::tstMain() {
|
||||||
|
|
||||||
|
// init xample unit test
|
||||||
|
_tests.push_back(new ExampleTest());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
tstMain::~tstMain() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief tstMain::initTestCase - this method contains initialization of the data tests.
|
||||||
|
*/
|
||||||
|
void tstMain::initTestCase() {
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief tstMain::unitTests create application for testing
|
||||||
|
*/
|
||||||
|
void tstMain::unitTests() {
|
||||||
|
int argc =0;
|
||||||
|
char * argv[] = {nullptr};
|
||||||
|
|
||||||
|
QCoreApplication app(argc, argv);
|
||||||
|
QCoreApplication::setApplicationName("testRENAME_ME");
|
||||||
|
QCoreApplication::setOrganizationName("QuasarApp");
|
||||||
|
|
||||||
|
auto path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
|
||||||
|
|
||||||
|
QDir(path).removeRecursively();
|
||||||
|
|
||||||
|
QTimer::singleShot(0, this, [&app, this]() {
|
||||||
|
|
||||||
|
for (auto test : qAsConst(_tests) ) {
|
||||||
|
test->test();
|
||||||
|
delete test;
|
||||||
|
}
|
||||||
|
|
||||||
|
app.exit(0);
|
||||||
|
});
|
||||||
|
|
||||||
|
app.exec();
|
||||||
|
}
|
||||||
|
|
||||||
|
QTEST_APPLESS_MAIN(tstMain)
|
||||||
|
|
||||||
|
#include "tstMain.moc"
|
22
tests/units/exampletest.cpp
Normal file
22
tests/units/exampletest.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#include "exampletest.h"
|
||||||
|
|
||||||
|
|
||||||
|
ExampleTest::ExampleTest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ExampleTest::~ExampleTest() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ExampleTest::test() {
|
||||||
|
QVERIFY(true);
|
||||||
|
}
|
26
tests/units/exampletest.h
Normal file
26
tests/units/exampletest.h
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef EXAMPLE_TEST_H
|
||||||
|
#define EXAMPLE_TEST_H
|
||||||
|
#include "test.h"
|
||||||
|
#include "testutils.h"
|
||||||
|
|
||||||
|
#include <QtTest>
|
||||||
|
|
||||||
|
class ExampleTest: public Test, protected TestUtils
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ExampleTest();
|
||||||
|
~ExampleTest();
|
||||||
|
|
||||||
|
void test();
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // EXAMPLE_TEST_H
|
9
tests/units/test.cpp
Normal file
9
tests/units/test.cpp
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#include "test.h"
|
20
tests/units/test.h
Normal file
20
tests/units/test.h
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef TEST_H
|
||||||
|
#define TEST_H
|
||||||
|
|
||||||
|
class Test
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
Test() = default;
|
||||||
|
virtual ~Test() = default;
|
||||||
|
virtual void test() = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TEST_H
|
53
tests/units/testutils.cpp
Normal file
53
tests/units/testutils.cpp
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#include "testutils.h"
|
||||||
|
|
||||||
|
#include <QCoreApplication>
|
||||||
|
#include <QDateTime>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
bool TestUtils::funcPrivateConnect(const std::function<bool()> &requestFunc,
|
||||||
|
const std::function<bool()> &checkFunc,
|
||||||
|
const std::function<QMetaObject::Connection()> &connectFunction) const {
|
||||||
|
|
||||||
|
QMetaObject::Connection m_connection = connectFunction();
|
||||||
|
if (requestFunc && !requestFunc()) {
|
||||||
|
QObject::disconnect(m_connection);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool return_value = TestUtils::wait(checkFunc, 10000);
|
||||||
|
QObject::disconnect(m_connection);
|
||||||
|
|
||||||
|
return return_value;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TestUtils::funcPrivateConnect(const std::function<bool ()> &requestFunc,
|
||||||
|
const std::function<bool ()> &checkFunc) const {
|
||||||
|
return funcPrivateConnect(requestFunc, checkFunc, [](){return QMetaObject::Connection();});
|
||||||
|
}
|
||||||
|
|
||||||
|
TestUtils::TestUtils()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
TestUtils::~TestUtils() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
bool TestUtils::wait(const std::function<bool()> &forWait, int msec) const {
|
||||||
|
auto curmsec = QDateTime::currentMSecsSinceEpoch() + msec;
|
||||||
|
while (curmsec > QDateTime::currentMSecsSinceEpoch() && !forWait()) {
|
||||||
|
QCoreApplication::processEvents();
|
||||||
|
}
|
||||||
|
QCoreApplication::processEvents();
|
||||||
|
return forWait();
|
||||||
|
}
|
||||||
|
|
32
tests/units/testutils.h
Normal file
32
tests/units/testutils.h
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
//#
|
||||||
|
//# Copyright (C) 2020-2021 QuasarApp.
|
||||||
|
//# Distributed under the lgplv3 software license, see the accompanying
|
||||||
|
//# Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
//# of this license document, but changing it is not allowed.
|
||||||
|
//#
|
||||||
|
|
||||||
|
|
||||||
|
#ifndef TESTUTILS_H
|
||||||
|
#define TESTUTILS_H
|
||||||
|
|
||||||
|
#include "functional"
|
||||||
|
#include <QMetaObject>
|
||||||
|
|
||||||
|
class TestUtils
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TestUtils();
|
||||||
|
virtual ~TestUtils();
|
||||||
|
bool wait(const std::function<bool()> &forWait, int msec) const;
|
||||||
|
|
||||||
|
|
||||||
|
bool funcPrivateConnect(const std::function<bool ()> &requestFunc,
|
||||||
|
const std::function<bool ()> &checkFunc,
|
||||||
|
const std::function<QMetaObject::Connection ()> &connectFunction) const;
|
||||||
|
|
||||||
|
bool funcPrivateConnect(const std::function<bool ()> &requestFunc,
|
||||||
|
const std::function<bool ()> &checkFunc) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TESTUTILS_H
|
Loading…
x
Reference in New Issue
Block a user