Skip to content

Commit

Permalink
Merge pull request #166 from sakkamade/improve-documentation
Browse files Browse the repository at this point in the history
Update Documentation
  • Loading branch information
kanryu authored Apr 28, 2021
2 parents 9c3ebdb + 8bdb96c commit 57c3f86
Show file tree
Hide file tree
Showing 3 changed files with 365 additions and 122 deletions.
101 changes: 57 additions & 44 deletions HowToBuild.md
Original file line number Diff line number Diff line change
@@ -1,84 +1,90 @@
# How to build

Since I was told before that he hadn't known how to build from this source code, so I wrote this document.
Since I was told before that it is hard to understand how to build from this source code, I wrote this document.

With GPLv 3, you have copied this source code and the right to build it yourself is guaranteed, so please build it if you are interested in this application.
With GPLv 3, if you have cloned this source code, the freedom of building it yourself is guaranteed. So please build it if you are interested in this application.

If you have something you do not recognize or aware of by way of building, please send me an e-mail or open an [issue](https://github.com/kanryu/quickviewer/issues) in the project's page.

If you have something you do not recognize or are aware of when building, please send me a email or post to a issue of the project.

## 1. Setup

### Set Up Qt SDK
You should install Qt SDK on your pc.
You should install Qt SDK on your PC.

https://www.qt.io/download-open-source/


### Set up the source

Clone the repo and submodules

```
```shell
$ git clone https://github.com/kanryu/quickviewer
#

$ cd quickviewer
$ git submodule init
#

$ git submodule update
```


## 2. Make a project to build

Note: For Linux builds, [linuxdeployqt](https://github.com/probonopd/linuxdeployqt) and [appimagetool](https://github.com/AppImage/AppImageKit) are required.
Note: For Linux builds [linuxdeployqt](https://github.com/probonopd/linuxdeployqt) and [appimagetool](https://github.com/AppImage/AppImageKit) are required.

### for QtCreator

### For QtCreator

QuickViewer is developed with QtCreator.
So you just need to have QtCreator load the QVProject.pro.
So you just need to have QtCreator to load the QVProject.pro.

If you has setuped Qt SDK as 'msvc2015' or 'msvc2015_64', the distribution package is automatically generated. By running "jom install".
If you have setup Qt SDK as 'msvc2015' or 'msvc2015_64', distribution package will be automatically generated by running "jom install".

Switch to the **Projects** tab and select **Add Build Step** -> **Make**. Type install into **Make arguments:**.
Switch to the **Projects** tab, and select **Add Build Step** -> **Make**. Type "install" into **Make arguments:**.

### for command line builders

```
### For command line builders

```shell
$ cd ../
$ mkdir build
$ cd build
$ [QTSDK]/bin/qmake -o Makefile -recursive ../quickviewer/QVProject.pro
```
A Makefile for the compiler will be generated to build QuickViewer. All you have to do is build it with that Makefile.
Makefile for compiler will be generated to build QuickViewer. All you have to do is build it with that Makefile.


#### MinGW
```

```shell
$ mingw32-make
$ mingw32-make install
(created QuickViewer distribution)
```

#### VisualStudio2015

You need nmake instead of MinGW make. Of course there is a distinction x86 / x64.
You need nmake instead of MinGW make. Of course there are distinct versions: x86 / x64.

```
```shell
$ [amd64]/vsvars64.bat
$ nmake
$ nmake install
(created QuickViewer distribution)
```

### for Visual Studio 2015
### For Visual Studio 2015

Normal project generation methods are as follows:
Normal project generation method consist of following steps:

1. install VisualStudio2015Community, QtSDK(msvc2015 or msvc2015_64), QtVSTools
1. select menu [Qt VS Tools] -> [Open Qt Project File(.pro)]
1. select QVProject.pro
1. Install VisualStudio2015Community, QtSDK(msvc2015 or msvc2015_64), QtVSTools
1. Select menu [Qt VS Tools] -> [Open Qt Project File(.pro)]
1. Select QVProject.pro

However, I think it would be better to run qmake on the command line. This method is hard to make a mistake.
However, I think it would be better to run qmake in the command line. With this method it is hard to make a mistake:

```
```shell
$ cd ../
$ mkdir build
$ cd build
Expand All @@ -87,11 +93,12 @@ $ [QTSDK]/bin/qmake -tp vc ..\quickviewer\QVProject.pro -recursive QMAKE_INCDIR
```

If you debug the x64 version of QuickViewer, you may encounter an error that QtCored.dll is missing.
In that case, dropping the built QuickViewer.exe onto [QtSDK]/bin/windeployqt.exe copies the required DLLs.
In this case, drag and drop of the "QuickViewer.exe" which you built onto [QtSDK]/bin/windeployqt.exe will copy required DLLs.


## 3. Directory structure at build time
## 3. Directory structure at time of build

You can find the directories in the build directry named e.g. *'build-QVproject-Desktop_Qt_5_7_1_MSVC2015_64bit-Debug'* after building completed. (VisualStudio won't make [build])
You can find the directories in the build directory named e.g. *'build-QVproject-Desktop_Qt_5_7_1_MSVC2015_64bit-Debug'* after building completed. (VisualStudio won't make [build])

- bin
- lib
Expand All @@ -101,37 +108,39 @@ You can find the directories in the build directry named e.g. *'build-QVproject-

**bin** has executable programs built from each subproject.

To test all the functions of QuickViewer, please do the following.
To experience all the functions of QuickViewer, please do following:

```
```shell
$ cd [build]/bin
$ ln -s ../../quickviewer/QuickViewer/database database
$ ln -s ../../quickviewer/QuickViewer/shaders shaders
$ ln -s ../../quickviewer/QuickViewer/translations translations
```


## 4. Directory structure at runtime

### for Windows
### For Windows

- **[database]**
- SQLite database which contains Catalogs and thumbnails.
- SQLite database which contains Catalogs and thumbnails
- **[shaders]**
- Fragment Shaders for image resizing.(obsolete)
- Fragment Shaders for image resizing (obsolete)
- **[translations]**
- multi-language qm files.
- multi-language qm files
- **QuickViewer.exe**
- Application main
- **AssociateFilesWithQuickViewer.exe**
- Set the association of image formats with UAC
- **quickviewer.ini**
- Main configuration file. Includes keyboard and mouse settings
- **progress.ini**
- Record the last displayed image in volume
- Record the last displayed image in volume.


### for Linux (AppImage)
### For Linux (.AppImage)

Note: For Linux builds, [linuxdeployqt](https://github.com/probonopd/linuxdeployqt) and [appimagetool](https://github.com/AppImage/AppImageKit) are required.
Note: For Linux builds [linuxdeployqt](https://github.com/probonopd/linuxdeployqt) and [appimagetool](https://github.com/AppImage/AppImageKit) are required.

- **[QuickViewer-XXX-AppDir]**
- Base directory making up AppImage
Expand All @@ -153,9 +162,12 @@ Note: For Linux builds, [linuxdeployqt](https://github.com/probonopd/linuxdeploy

**AppDir/usr/bin/qt.conf** is currently not used.

> Successfully built example (not `.AppImage`) may be found [here](https://github.com/kanryu/quickviewer/issues/158#issuecomment-814652108).

## 5. Selection of rendering method

QuickViewer renders images mainly in three ways.
QuickViewer renders images primarily in three ways:

1. Standard rendering method of each OS
- on Windows, it is Windows GDI
Expand All @@ -164,22 +176,23 @@ QuickViewer renders images mainly in three ways.

If you want to use QuickViewer with OpenGL, you need to comment out the **QV_WITHOUT_OPENGL** switch in QuickViewer.pro.

I read a document that Windows GDI doesn't use hardware acceleration in Windows Vista and later, but in bilinear interpolation drawing of 2D graphics, there is no difference from GPU and it is not necessary to transfer it to drawing texture, so it is even faster .
I read a document that Windows GDI doesn't use hardware acceleration in Windows Vista and later, but in bilinear interpolation drawing of 2D graphics, there is no difference from GPU and it is not necessary to transfer it to drawing texture, so it is even faster.

Direct2D is implemented as a QPA plugin, and rendering method is automatically changed when plug-in is enabled at application startup.

Although it has not tried yet, in other OSs it should be possible to change the drawing method by other QPAs.
Although it was not tested yet, in other OSs it should be possible to change the drawing method by other QPAs.


## 6. Portable or System Standards

There will be different opinions whether an application should be able to boot on any PC from your USB flash drive or as a part of the system of the PC.
There will be different opinions whether an application should be able to start on any PC from your USB flash drive or as a part of the system of the PC.

In QuickViewer, QV_PORTABLE in QVproject.pri makes it possible to select these two policies.
In QuickViewer, QV_PORTABLE in QVproject.pri makes possible to select these two policies.

When QV_PORTABLE is defined, it becomes an application that can copy to your USB flash drive. Would you like to store data files such as ini files and DBs on the same drive as much as possible? For Linux and Mac, they are output as AppImage, dmg respectively.
When QV_PORTABLE is defined, it becomes an application that can copy to your USB flash drive. Would you like to store data files such as `.ini` files and `.DB`s in the same drive as much as possible? For Linux and Mac, they are output as `.AppImage`, `.dmg` respectively.

If not, QuickViewer will be built as an application embedded in the system. On Windows it will be installed into "C:\Program FIles".
On Linux it will be /usr/local/bin. That may be executed with the system-specific shared libraries (eg 7z).
On Linux it will be /usr/local/bin. That may be executed with the system-specific shared libraries (e.g. 7z).



Expand Down
Loading

0 comments on commit 57c3f86

Please sign in to comment.