From 353e06f1e4ed70bc69950fe41c16627b3226ce54 Mon Sep 17 00:00:00 2001 From: EndrII Date: Wed, 30 Aug 2023 18:29:45 +0200 Subject: [PATCH] init commit --- .gitmodules | 3 + CMakeLists.txt | 20 +++--- README.md | 2 +- doxygen.conf.in | 8 +-- init.sh | 62 ------------------- src/RENAME_ME/RENAME_ME.qrc | 9 --- src/RENAME_ME/src/RENAME_MEModule/qmldir | 3 - src/example/CMakeLists.txt | 16 ++--- src/example/android/AndroidManifest.xml.in | 2 +- .../deploy/{RENAME_ME.json => qTbot.json} | 4 +- .../{RENAME_ME.json.in => qTbot.json.in} | 6 +- src/{RENAME_ME => qTbot}/CMakeLists.txt | 4 +- src/{RENAME_ME => qTbot}/languages/en.ts | 0 src/qTbot/qTbot.qrc | 9 +++ .../src/public/qTbot.cpp} | 8 +-- .../RENAME_ME.h => qTbot/src/public/qTbot.h} | 12 ++-- .../src/public/qTbot}/global.h | 14 ++--- .../src/public/qTbot}/global.h.in | 14 ++--- .../src/qTbotModule/qTbot.qml} | 0 src/qTbot/src/qTbotModule/qmldir | 3 + submodules/CMake | 1 + tests/tstMain.cpp | 2 +- 22 files changed, 72 insertions(+), 130 deletions(-) delete mode 100755 init.sh delete mode 100644 src/RENAME_ME/RENAME_ME.qrc delete mode 100644 src/RENAME_ME/src/RENAME_MEModule/qmldir rename src/example/deploy/{RENAME_ME.json => qTbot.json} (87%) rename src/example/deploy/{RENAME_ME.json.in => qTbot.json.in} (76%) rename src/{RENAME_ME => qTbot}/CMakeLists.txt (90%) rename src/{RENAME_ME => qTbot}/languages/en.ts (100%) create mode 100644 src/qTbot/qTbot.qrc rename src/{RENAME_ME/src/public/RENAME_ME.cpp => qTbot/src/public/qTbot.cpp} (74%) rename src/{RENAME_ME/src/public/RENAME_ME.h => qTbot/src/public/qTbot.h} (64%) rename src/{RENAME_ME/src/public/RENAME_ME => qTbot/src/public/qTbot}/global.h (55%) rename src/{RENAME_ME/src/public/RENAME_ME => qTbot/src/public/qTbot}/global.h.in (54%) rename src/{RENAME_ME/src/RENAME_MEModule/RENAME_ME.qml => qTbot/src/qTbotModule/qTbot.qml} (100%) create mode 100644 src/qTbot/src/qTbotModule/qmldir create mode 160000 submodules/CMake diff --git a/.gitmodules b/.gitmodules index f305b28..8b95c0b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "CMake"] path = submodules/CMake url = https://github.com/QuasarApp/CMake.git +[submodule "submodules/CMake"] + path = submodules/CMake + url = https://github.com/QuasarApp/CMake.git diff --git a/CMakeLists.txt b/CMakeLists.txt index cde7b02..8376608 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ # cmake_minimum_required(VERSION 3.19) -project(RENAME_ME LANGUAGES CXX) +project(qTbot LANGUAGES CXX) if(TARGET ${PROJECT_NAME}) message("The ${PROJECT_NAME} arledy included in main Project") return() @@ -30,27 +30,27 @@ find_package(Qt6 COMPONENTS Test QUIET) include(submodules/CMake/QuasarApp.cmake) updateGitVars() -set(RENAME_ME_VERSION "0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}") -set(RENAME_ME_PACKAGE_ID "quasarapp.core.RENAME_ME") +set(QTBOT_VERSION "0.${GIT_COMMIT_COUNT}.${GIT_COMMIT_HASH}") +set(QTBOT_PACKAGE_ID "quasarapp.core.qTbot") -option(RENAME_ME_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ON) -option(RENAME_ME_EXAMPLE "This option disables or enables example app of the ${PROJECT_NAME} project" ON) +option(QTBOT_TESTS "This option disables or enables tests of the ${PROJECT_NAME} project" ON) +option(QTBOT_EXAMPLE "This option disables or enables example app of the ${PROJECT_NAME} project" ON) if (ANDROID OR IOS OR QA_WASM32) - set(RENAME_ME_TESTS OFF CACHE BOOL "This option force disbled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE) + set(QTBOT_TESTS OFF CACHE BOOL "This option force disbled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE) endif() make_directory(Distro) initAll() -add_subdirectory(src/RENAME_ME) +add_subdirectory(src/qTbot) -if (DEFINED RENAME_ME_EXAMPLE) +if (DEFINED QTBOT_EXAMPLE) add_subdirectory(src/example) endif() -if (RENAME_ME_TESTS) +if (QTBOT_TESTS) add_subdirectory(tests) else() message("The ${PROJECT_NAME} tests is disabled.") @@ -58,4 +58,4 @@ endif() configure_file_in(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf) addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf) -addDeployFromCustomFile("RENAME_ME" "${CMAKE_CURRENT_SOURCE_DIR}/deploy/RENAME_ME.json") +addDeployFromCustomFile("qTbot" "${CMAKE_CURRENT_SOURCE_DIR}/deploy/qTbot.json") diff --git a/README.md b/README.md index 0a44cbb..e41d1a0 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # CMakeProject Template repository for cmake project -Fork me and replase RENAME_ME to Name of your new project. +Fork me and replase qTbot to Name of your new project. 1. Clone this repository 2. Run ./init.sh NewProjectName diff --git a/doxygen.conf.in b/doxygen.conf.in index 5857193..b9ade0a 100644 --- a/doxygen.conf.in +++ b/doxygen.conf.in @@ -32,18 +32,18 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = RENAME_ME +PROJECT_NAME = qTbot # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version # control system is used. -PROJECT_NUMBER = @RENAME_ME_VERSION@ +PROJECT_NUMBER = @QTBOT_VERSION@ # Using the PROJECT_BRIEF tag one can provide an optional one line description # for a project that appears at the top of each page and should give viewer a # quick idea about the purpose of the project. Keep the description short. -PROJECT_BRIEF = RENAME_ME is base back end library for your c++ Qt projects. +PROJECT_BRIEF = qTbot is base back end library for your c++ Qt projects. # With the PROJECT_LOGO tag one can specify a logo or an icon that is included @@ -1452,7 +1452,7 @@ GENERATE_ECLIPSEHELP = NO # The default value is: org.doxygen.Project. # This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. -ECLIPSE_DOC_ID = QuasarApp.RENAME_ME +ECLIPSE_DOC_ID = QuasarApp.qTbot # If you want full control over the layout of the generated HTML pages it might # be necessary to disable the index and replace it with your own. The diff --git a/init.sh b/init.sh deleted file mode 100755 index beebd67..0000000 --- a/init.sh +++ /dev/null @@ -1,62 +0,0 @@ -#!/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" - echo "Usage: $0 " - - exit 1 -fi - -replacement="$1" - -rename_files_and_folders() { - local dir="$1" - local old_str="$2" - local new_str="$3" - - for item in "$dir"/*; do - if [ -d "$item" ]; then - new_name=$(echo "$item" | sed "s/$old_str/$new_str/g") - if [ "$item" != "$new_name" ]; then - mv "$item" "$new_name" - echo "Renamed directory: $item -> $new_name" - fi - rename_files_and_folders "$new_name" "$old_str" "$new_str" - elif [ -f "$item" ]; then - sed -i "s/$old_str/$new_str/g" "$item" - - new_name=$(echo "$item" | sed "s/$old_str/$new_str/g") - if [ "$item" != "$new_name" ]; then - mv "$item" "$new_name" - echo "Renamed file: $item -> $new_name" - fi - fi - done -} - -uppercase_string=$(echo "$replacement" | tr '[:lower:]' '[:upper:]') - -rename_files_and_folders "." "RENAME_ME_EXPORT" "${uppercase_string}_EXPORT" -rename_files_and_folders "." "RENAME_ME_VERSION" "${uppercase_string}_VERSION" -rename_files_and_folders "." "RENAME_ME_LIBRARY" "${uppercase_string}_LIBRARY" -rename_files_and_folders "." "RENAME_ME_EXAMPLE" "${uppercase_string}_EXAMPLE" -rename_files_and_folders "." "RENAME_ME_TESTS" "${uppercase_string}_TESTS" -rename_files_and_folders "." "RENAME_ME_PACKAGE_ID" "${uppercase_string}_PACKAGE_ID" - -rename_files_and_folders "." "RENAME_ME" "$replacement" - -echo "Replacement complete." - - -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 diff --git a/src/RENAME_ME/RENAME_ME.qrc b/src/RENAME_ME/RENAME_ME.qrc deleted file mode 100644 index c6c3d8e..0000000 --- a/src/RENAME_ME/RENAME_ME.qrc +++ /dev/null @@ -1,9 +0,0 @@ - - - src/RENAME_MEModule/qmldir - src/RENAME_MEModule/RENAME_ME.qml - - - languages/en.qm - - diff --git a/src/RENAME_ME/src/RENAME_MEModule/qmldir b/src/RENAME_ME/src/RENAME_MEModule/qmldir deleted file mode 100644 index 966edab..0000000 --- a/src/RENAME_ME/src/RENAME_MEModule/qmldir +++ /dev/null @@ -1,3 +0,0 @@ -module RENAME_MEModule -RENAME_ME 1.0 RENAME_ME.qml - diff --git a/src/example/CMakeLists.txt b/src/example/CMakeLists.txt index 337f8de..1d74f76 100644 --- a/src/example/CMakeLists.txt +++ b/src/example/CMakeLists.txt @@ -45,7 +45,7 @@ if (ANDROID) set(ANDROID_API_VERSION $ENV{ANDROID_API_VERSION}) set(OPENSSL_ROOT_PATH "$ENV{OPENSSL_ROOT_DIR}") - set(RENAME_ME_EXTRA_LIBS + set(qTbot_EXTRA_LIBS ${PROJECT_NAME}Library # libName ) @@ -58,7 +58,7 @@ if (ANDROID) "${SIGPATH}/quasarapp.keystore" "${SIGPASS_QUASARAPP}" "${TARGET_DIR}" - "${RENAME_ME_EXTRA_LIBS}") + "${qTbot_EXTRA_LIBS}") else() message("NO_SIGN_APP") @@ -66,7 +66,7 @@ if (ANDROID) addDeployAPK(${CURRENT_PROJECT} "${CMAKE_CURRENT_LIST_DIR}/android" "${TARGET_DIR}" - "${RENAME_ME_EXTRA_LIBS}") + "${qTbot_EXTRA_LIBS}") endif() set(manifest_file "${CMAKE_CURRENT_SOURCE_DIR}/android/AndroidManifest.xml") @@ -92,19 +92,19 @@ elseif(IOS) # set_xcode_property(${CURRENT_PROJECT} PRODUCT_BUNDLE_IDENTIFIER ${CHEATCARD_PACKAGE_ID} All) set_target_properties(${CURRENT_PROJECT} PROPERTIES - MACOSX_BUNDLE_GUI_IDENTIFIER ${RENAME_ME_PACKAGE_ID} - MACOSX_BUNDLE_BUNDLE_VERSION ${RENAME_ME_VERSION} - MACOSX_BUNDLE_SHORT_VERSION_STRING ${RENAME_ME_VERSION} + MACOSX_BUNDLE_GUI_IDENTIFIER ${QTBOT_PACKAGE_ID} + MACOSX_BUNDLE_BUNDLE_VERSION ${QTBOT_VERSION} + MACOSX_BUNDLE_SHORT_VERSION_STRING ${QTBOT_VERSION} ) else() # Desctop deploying message(GIT_COMMIT_COUNT = ${GIT_COMMIT_COUNT}) - set(DeployFile "${CMAKE_CURRENT_SOURCE_DIR}/deploy/RENAME_ME.json") + set(DeployFile "${CMAKE_CURRENT_SOURCE_DIR}/deploy/qTbot.json") configure_file("${DeployFile}.in" ${DeployFile} @ONLY) - addDeployFromCustomFile("RENAME_ME" ${DeployFile}) + addDeployFromCustomFile("qTbot" ${DeployFile}) endif() diff --git a/src/example/android/AndroidManifest.xml.in b/src/example/android/AndroidManifest.xml.in index 7f7beef..c6a19dd 100644 --- a/src/example/android/AndroidManifest.xml.in +++ b/src/example/android/AndroidManifest.xml.in @@ -1,5 +1,5 @@ - + diff --git a/src/example/deploy/RENAME_ME.json b/src/example/deploy/qTbot.json similarity index 87% rename from src/example/deploy/RENAME_ME.json rename to src/example/deploy/qTbot.json index a0e8bac..8acf751 100644 --- a/src/example/deploy/RENAME_ME.json +++ b/src/example/deploy/qTbot.json @@ -1,7 +1,7 @@ { "bin": [ - "src/build/Debug/RENAME_MEEaxample", - "src/build/Debug/RENAME_MEEaxample.exe" + "src/build/Debug/qTbotEaxample", + "src/build/Debug/qTbotEaxample.exe" ], "clear": true, "binPrefix": "/media/D/builds/build-CMakeProject-Desktop_Qt_6_5_2_GCC_64bit-Debug", diff --git a/src/example/deploy/RENAME_ME.json.in b/src/example/deploy/qTbot.json.in similarity index 76% rename from src/example/deploy/RENAME_ME.json.in rename to src/example/deploy/qTbot.json.in index 45063d4..93a5023 100644 --- a/src/example/deploy/RENAME_ME.json.in +++ b/src/example/deploy/qTbot.json.in @@ -1,7 +1,7 @@ { "bin": [ - "src/build/Debug/RENAME_MEEaxample", - "src/build/Debug/RENAME_MEEaxample.exe" + "src/build/Debug/qTbotEaxample", + "src/build/Debug/qTbotEaxample.exe" ], "clear": true, "binPrefix": "@CMAKE_BINARY_DIR@", @@ -21,7 +21,7 @@ ], "extraLib": "crypto", "targetDir": "@CMAKE_SOURCE_DIR@/Distro", - "deployVersion": "@RENAME_ME_VERSION@", + "deployVersion": "@QTBOT_VERSION@", } diff --git a/src/RENAME_ME/CMakeLists.txt b/src/qTbot/CMakeLists.txt similarity index 90% rename from src/RENAME_ME/CMakeLists.txt rename to src/qTbot/CMakeLists.txt index 939d103..d6b936f 100644 --- a/src/RENAME_ME/CMakeLists.txt +++ b/src/qTbot/CMakeLists.txt @@ -8,7 +8,7 @@ cmake_minimum_required(VERSION 3.19) set(CURRENT_PROJECT "${PROJECT_NAME}") -add_definitions(-DRENAME_ME_LIBRARY) +add_definitions(-DQTBOT_LIBRARY) file(GLOB_RECURSE SOURCE_CPP @@ -37,5 +37,5 @@ prepareQM(${CURRENT_PROJECT} ${CMAKE_CURRENT_SOURCE_DIR} "${LANGS}") set(QML_IMPORT_PATH ${QML_IMPORT_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/src" CACHE STRING "" FORCE) -set(global_file "${CMAKE_CURRENT_SOURCE_DIR}/src/public/RENAME_ME/global.h") +set(global_file "${CMAKE_CURRENT_SOURCE_DIR}/src/public/qTbot/global.h") configure_file("${global_file}.in" ${global_file} @ONLY) diff --git a/src/RENAME_ME/languages/en.ts b/src/qTbot/languages/en.ts similarity index 100% rename from src/RENAME_ME/languages/en.ts rename to src/qTbot/languages/en.ts diff --git a/src/qTbot/qTbot.qrc b/src/qTbot/qTbot.qrc new file mode 100644 index 0000000..130f342 --- /dev/null +++ b/src/qTbot/qTbot.qrc @@ -0,0 +1,9 @@ + + + src/qTbotModule/qmldir + src/qTbotModule/qTbot.qml + + + languages/en.qm + + diff --git a/src/RENAME_ME/src/public/RENAME_ME.cpp b/src/qTbot/src/public/qTbot.cpp similarity index 74% rename from src/RENAME_ME/src/public/RENAME_ME.cpp rename to src/qTbot/src/public/qTbot.cpp index f18b899..19d7548 100644 --- a/src/RENAME_ME/src/public/RENAME_ME.cpp +++ b/src/qTbot/src/public/qTbot.cpp @@ -5,18 +5,18 @@ //# of this license document, but changing it is not allowed. //# -#include "RENAME_ME.h" +#include "qTbot.h" -namespace RENAME_ME { +namespace qTbot { bool init() { - initRENAME_MEResources(); + initqTbotResources(); return true; } QString version() { - return RENAME_ME_VERSION; + return QTBOT_VERSION; } diff --git a/src/RENAME_ME/src/public/RENAME_ME.h b/src/qTbot/src/public/qTbot.h similarity index 64% rename from src/RENAME_ME/src/public/RENAME_ME.h rename to src/qTbot/src/public/qTbot.h index bee7dbf..2bb9108 100644 --- a/src/RENAME_ME/src/public/RENAME_ME.h +++ b/src/qTbot/src/public/qTbot.h @@ -5,23 +5,23 @@ //# of this license document, but changing it is not allowed. //# -#include "RENAME_ME/global.h" +#include "qTbot/global.h" #include -inline void initRENAME_MEResources() { Q_INIT_RESOURCE(RENAME_ME); } +inline void initqTbotResources() { Q_INIT_RESOURCE(qTbot); } -namespace RENAME_ME { +namespace qTbot { /** - * @brief init main initialize method of The RENAME_ME library + * @brief init main initialize method of The qTbot library * @return true if library initialized successfull */ -bool RENAME_ME_EXPORT init(); +bool QTBOT_EXPORT init(); /** * @brief version This method return string value of a library version * @return string value of a library version */ -QString RENAME_ME_EXPORT version(); +QString QTBOT_EXPORT version(); }; diff --git a/src/RENAME_ME/src/public/RENAME_ME/global.h b/src/qTbot/src/public/qTbot/global.h similarity index 55% rename from src/RENAME_ME/src/public/RENAME_ME/global.h rename to src/qTbot/src/public/qTbot/global.h index cbd3efb..1b4cea0 100644 --- a/src/RENAME_ME/src/public/RENAME_ME/global.h +++ b/src/qTbot/src/public/qTbot/global.h @@ -5,18 +5,18 @@ //# of this license document, but changing it is not allowed. //# -#ifndef RENAME_ME_GLOBAL_H -#define RENAME_ME_GLOBAL_H +#ifndef qTbot_GLOBAL_H +#define qTbot_GLOBAL_H #include -#define RENAME_ME_VERSION "0.87.648a8dc" +#define QTBOT_VERSION "0.87.648a8dc" -#if defined(RENAME_ME_LIBRARY) -# define RENAME_ME_EXPORT Q_DECL_EXPORT +#if defined(QTBOT_LIBRARY) +# define QTBOT_EXPORT Q_DECL_EXPORT #else -# define RENAME_ME_EXPORT Q_DECL_IMPORT +# define QTBOT_EXPORT Q_DECL_IMPORT #endif -#endif //RENAME_ME_GLOBAL_H +#endif //qTbot_GLOBAL_H diff --git a/src/RENAME_ME/src/public/RENAME_ME/global.h.in b/src/qTbot/src/public/qTbot/global.h.in similarity index 54% rename from src/RENAME_ME/src/public/RENAME_ME/global.h.in rename to src/qTbot/src/public/qTbot/global.h.in index 312004f..a10ec77 100644 --- a/src/RENAME_ME/src/public/RENAME_ME/global.h.in +++ b/src/qTbot/src/public/qTbot/global.h.in @@ -5,18 +5,18 @@ //# of this license document, but changing it is not allowed. //# -#ifndef RENAME_ME_GLOBAL_H -#define RENAME_ME_GLOBAL_H +#ifndef qTbot_GLOBAL_H +#define qTbot_GLOBAL_H #include -#define RENAME_ME_VERSION "@RENAME_ME_VERSION@" +#define QTBOT_VERSION "@QTBOT_VERSION@" -#if defined(RENAME_ME_LIBRARY) -# define RENAME_ME_EXPORT Q_DECL_EXPORT +#if defined(QTBOT_LIBRARY) +# define QTBOT_EXPORT Q_DECL_EXPORT #else -# define RENAME_ME_EXPORT Q_DECL_IMPORT +# define QTBOT_EXPORT Q_DECL_IMPORT #endif -#endif //RENAME_ME_GLOBAL_H +#endif //qTbot_GLOBAL_H diff --git a/src/RENAME_ME/src/RENAME_MEModule/RENAME_ME.qml b/src/qTbot/src/qTbotModule/qTbot.qml similarity index 100% rename from src/RENAME_ME/src/RENAME_MEModule/RENAME_ME.qml rename to src/qTbot/src/qTbotModule/qTbot.qml diff --git a/src/qTbot/src/qTbotModule/qmldir b/src/qTbot/src/qTbotModule/qmldir new file mode 100644 index 0000000..83f8a5c --- /dev/null +++ b/src/qTbot/src/qTbotModule/qmldir @@ -0,0 +1,3 @@ +module qTbotModule +qTbot 1.0 qTbot.qml + diff --git a/submodules/CMake b/submodules/CMake new file mode 160000 index 0000000..3b89e31 --- /dev/null +++ b/submodules/CMake @@ -0,0 +1 @@ +Subproject commit 3b89e311c350868cead4bf2a36fd557989716043 diff --git a/tests/tstMain.cpp b/tests/tstMain.cpp index 3beb3ee..f371a7a 100644 --- a/tests/tstMain.cpp +++ b/tests/tstMain.cpp @@ -57,7 +57,7 @@ tstMain::tstMain() { char * argv[] = {nullptr}; _app = new QCoreApplication(argc, argv); - QCoreApplication::setApplicationName("testRENAME_ME"); + QCoreApplication::setApplicationName("testqTbot"); QCoreApplication::setOrganizationName("QuasarApp"); auto path = QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);