Skip to content

Commit

Permalink
Merge pull request #720 from QuasarApp/fix_documentations
Browse files Browse the repository at this point in the history
Fix documentations
  • Loading branch information
EndrII authored Oct 22, 2022
2 parents dfe0300 + 90c97eb commit 6c2b014
Show file tree
Hide file tree
Showing 6 changed files with 48 additions and 23 deletions.
8 changes: 3 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,6 @@ if (ANDROID OR IOS OR NOT QT_VERSION_MAJOR OR QA_WASM32)
return()
endif()

if (NOT QT_VERSION_MAJOR)
set(CQT_DEPLOYER_TOOL OFF CACHE BOOL "This option force disbled for Not Qt projects" FORCE)
endif()

if (${QT_VERSION_MAJOR} LESS 6)
message(WARNING "CQtDeployer tests is not available for qt5. Please build cqtdeployer with qt6")
set(CQT_DEPLOYER_TESTS OFF CACHE BOOL "This option force disbled for ANDROID IOS QA_WASM32 and Not Qt projects" FORCE)
Expand All @@ -63,6 +59,7 @@ initAll()
add_subdirectory(submodules/QuasarAppLib)
add_subdirectory(src/QtELFReader)

# disable command line tool of pe-parse
option(BUILD_COMMAND_LINE_TOOLS "Build Command Line Tools" OFF)
add_subdirectory(submodules/pe-parse)
add_subdirectory(submodules/zip)
Expand All @@ -71,6 +68,8 @@ add_subdirectory(src/Deploy)

if (DEFINED CQT_DEPLOYER_TOOL)
add_subdirectory(src/CQtDeployer)
else()
message("The ${PROJECT_NAME} console tool is disabled.")
endif()

if (CQT_DEPLOYER_TESTS)
Expand All @@ -83,4 +82,3 @@ endif()
configure_file_in("" "${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf")

addDoc(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/doxygen.conf)
addDeployFromCustomFile("CQtDeployer" "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/CQtDeployer.json")
19 changes: 18 additions & 1 deletion md/en/1_6.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,48 +24,65 @@ From now cqtdeployer using CMake build system. So from now build from source wil

## Detailed analysis of the most interesting changes.

## New options of the build

- **CQT_DEPLOYER_TESTS** "This option disables or enables tests of the CQtDeployer project. By Default enabled
- **CQT_DEPLOYER_TOOL** "This option disables or enables example app of the CQtDeployer project. By Default enabled

### New build system

From now, you can build cqtdeployer from source easier

- just clone project

``` bash

git clone https://github.com/QuasarApp/CQtDeployer.git
git submodule update --init --recursive
cd CQtDeployer

```

- create temp build directory

``` bash
mkdir build
cd build
```

- run cmake

``` bash
cmake .. -DCMAKE_PREFIX_PATH=/path/to/qt/root/dir
```

- build cqtdeployer

``` bash
make -j8
```
- create installers and packages

``` bash
make deploy
```

Done.

### Note
if you want to change Qt, Just run cmake with override qt location.

If you want to change Qt, Just run cmake with override qt location.

```bash
cmake -DCMAKE_PREFIX_PATH=/path/to/qt/root/dir
# or
cmake -DCMAKE_PREFIX_PATH=~/Qt/6.4.3/gcc_64
Expand Down
15 changes: 9 additions & 6 deletions src/CQtDeployer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ ADD_CUSTOM_TARGET(
COMMENT python "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/QIFW.py" ${QIFW_PLATFORM} ${QIFW_VERSION} "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/QIFW"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

add_dependencies(deploy${CURRENT_PROJECT} downloadQIFW)

addDeployFromCustomFile(${CURRENT_PROJECT}Single "${CMAKE_CURRENT_SOURCE_DIR}/Deploy/CQtDeployerSingle.json")

addDeploySnap(${CURRENT_PROJECT} "${CMAKE_SOURCE_DIR}/Distro/")
if (UNIX)
addDeploySnap(${CURRENT_PROJECT} "${CMAKE_SOURCE_DIR}/Distro/")

if(TARGET snapcraft${CURRENT_PROJECT})
message("snap is depends of single deploy")
add_dependencies(snapcraft${CURRENT_PROJECT} "deploy${CURRENT_PROJECT}Single")
endif()
if(TARGET snapcraft${CURRENT_PROJECT})
message("snap is depends of single deploy")
add_dependencies(snapcraft${CURRENT_PROJECT} "deploy${CURRENT_PROJECT}Single")
endif()

addReleaseSnap(${CURRENT_PROJECT})
addReleaseSnap(${CURRENT_PROJECT})
endif()
22 changes: 13 additions & 9 deletions src/CQtDeployer/Deploy/QIFW.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,17 @@
import shutil
from glob import glob

def re_path(path):
return path.replace('\\', os.sep).replace('/', os.sep)

PLATFORM = sys.argv[1]
VERSION = sys.argv[2]
PATHQIF = sys.argv[3]
PATHQIF = re_path(sys.argv[3])

if len(PLATFORM) <= 0:
PLATFORM = "linux"

if os.path.isdir(PATHQIF + "/QIF"):
if os.path.isdir(os.path.join(PATHQIF, "QIF")):
print("if target already executed")
exit(0)

Expand All @@ -32,16 +35,17 @@

subprocess.call(command)

BASEPATHQIF = PATHQIF + "/Tools/QtInstallerFramework/" + VERSION[0:3]
BASEPATHQIF = os.path.join(PATHQIF, "Tools", "QtInstallerFramework", VERSION[0:3])

for file in glob(BASEPATHQIF + "/bin/repogen*"):
for file in glob(os.path.join(BASEPATHQIF, "bin", "repogen*")):
os.remove(file)
for file in glob(BASEPATHQIF + "/bin/archivegen*"):
for file in glob(os.path.join(BASEPATHQIF, "bin", "archivegen*")):
os.remove(file)
for file in glob(BASEPATHQIF + "/bin/devtool*"):
for file in glob(os.path.join(BASEPATHQIF, "bin", "devtool*")):
os.remove(file)

os.rename(PATHQIF + "/Tools/QtInstallerFramework/" + VERSION[0:3] + "/bin/",
PATHQIF + "/QIF")
shutil.rmtree(PATHQIF + "/Tools")
os.rename(os.path.join(PATHQIF, "Tools", "QtInstallerFramework", VERSION[0:3], "bin"),
os.path.join(PATHQIF, "QIF"))

shutil.rmtree(os.path.join(PATHQIF, "Tools"))
os.remove("aqtinstall.log")
2 changes: 1 addition & 1 deletion submodules/QuasarAppLib
Submodule QuasarAppLib updated 1 files
+1 −1 CMake
5 changes: 4 additions & 1 deletion tests/tstMain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,10 @@ void tstMain::initTestCase() {
void tstMain::cleanupTestCase() {
QDir qt("./test");
qt.removeRecursively();

auto originalPath = qgetenv("CQT_TEST_ORIGINAL_PATH");
if (!originalPath.isEmpty()) {
qputenv("PATH", originalPath);
}
}

/**
Expand Down

0 comments on commit 6c2b014

Please sign in to comment.