-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed project file and build scripts to allow configuration using e…
…nvironment variables. Updated build instructions. Added deploy target and build scripts for Linux. albar965/littlenavmap#387
- Loading branch information
Showing
7 changed files
with
359 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,80 @@ | ||
Build Instructions | ||
------------------------------------------------------ | ||
# Build Instructions | ||
|
||
Qt development packages of Core, Widgets, XML and SQL are needed with minimum version 5.4. | ||
Additionally my atools static library is needed. | ||
The atools static library is required. Clone atools (`git clone https://github.com/albar965/atools.git`) | ||
and follow the build instructions there. The instructions in this `BUILD.txt` file assume that atools was installed | ||
and compiled successfully and Qt Creator was configured accordingly. | ||
|
||
- Clone atools GIT repository | ||
- Clone navdatareader GIT repository into the same directory | ||
Clone the navdatareader GIT repository into the same directory as atools. You can use another | ||
directory but then you need to adapt the configuration by changing environment variables. | ||
|
||
Windows | ||
------------------------------------------------------ | ||
Look at the `navdatareader.pro` file. There is a list of documented environment variables that can | ||
be set to customize the build. Most of these variables are optional and use a reasonable default | ||
value. Set these variables in the Qt Creator GUI or on the command line. | ||
|
||
- Get and install Qt Creator from http://www.qt.io. Preferrably use the default installation | ||
directory "C:\Qt" | ||
There is no need to edit the `*.pro` files. | ||
|
||
- Clone atools from GIT to e.g.: "C:\Projects\atools" | ||
- Clone navdatareader from GIT to e.g.: "C:\Projects\navdatareader" | ||
Both projects have to reside in the same directory. | ||
## Default paths and Environment Variables | ||
|
||
- Use "../build-%{CurrentProject:Name}-%{CurrentBuild:Name}" for "Default build directory" | ||
in the Qt Creator options dialog. | ||
- Import atools and navdatareader into the Qt creator workspace. | ||
- Configure the projects and enable shadow build for release or debug versions. | ||
The projects can be built with almost no configuration changes since all project files fall back to sensible | ||
default paths if the corresponding environment variables are not set. `APROJECTS` is the placeholder for the base directory in | ||
the examples below. Avoid paths with spaces if possible. | ||
|
||
If the shadow build is configured properly: | ||
- atools uses the build directory of e.g.: "C:\Projects\build-atools-release" | ||
- navdatareader uses the build directory of e.g.: "C:\Projects\build-navdatareader-release" | ||
* `APROJECTS/atools/src` Sources. `ATOOLS_INC_PATH` | ||
* `APROJECTS/build-atools-debug` atools debug build. `ATOOLS_LIB_PATH` | ||
* `APROJECTS/build-atools-release` atools release build. `ATOOLS_LIB_PATH` | ||
* `APROJECTS/build-navdatareader-debug` Navdatareader debug build. | ||
* `APROJECTS/build-navdatareader-release` Navdatareader release build. | ||
* `APROJECTS/deploy` Target for `make deploy`. `DEPLOY_BASE` | ||
* `APROJECTS/navdatareader` Sources. | ||
|
||
- Set the build kit for atools and navdatareader to MinGW 32bit. MSVC is untested. | ||
- Add "DEFINES+=SIMCONNECT_DUMMY DEFINES-=SIMCONNECT_REAL" to | ||
atools and navdatareader qmake parameters if FSX/P3D SimConnect is not installed. | ||
## Windows | ||
|
||
- Run qmake from Qt Creator for both projects | ||
- Build both projects from Qt Creator | ||
- Deploy navdatareader | ||
- Clone navdatareader from GIT (`git clone https://github.com/albar965/navdatareader.git`) | ||
to e.g.: `C:\Projects\navdatareader` | ||
- For navdatareader use the build directory of e.g.: `C:\Projects\build-navdatareader-release`. Otherwise | ||
change the paths with envronment variables (see `navdatareader.pro` file). | ||
- Import navdatareader into the Qt Creator workspace (atools should be already there). | ||
- Configure the project and enable the shadow build for release or debug versions. | ||
- Set the build kit for atools and navdatareader to MinGW 32bit. | ||
- Run qmake from Qt Creator for all projects | ||
- Build all projects from Qt Creator | ||
- Create and run the target `deploy`. This will create a directory `DEPLOY_BASE\Navdatareader` with the program. | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
albar965
Author
Owner
|
||
|
||
Do not use the default shadow build directory names, this will break project dependencies. | ||
The navdatareader project can be built using the MinGW environment only. MSVC will not work. | ||
|
||
## Linux | ||
|
||
Linux / macOS | ||
------------------------------------------------------ | ||
Install Qt development packages. Version at least 5.6. | ||
|
||
Build atools according to instructions in BUILD.txt. | ||
You can build the program on Linux or macOS similar to the Windows instructions above either using | ||
the Qt Creator GUI or the command line. | ||
|
||
The following assumes that atools was already installed and built. | ||
|
||
### To build the navdatareader release version: | ||
|
||
Create all build directories on the same level as the source directories "atools" and "navdatareader". | ||
``` | ||
mkdir build-navdatareader-release | ||
cd build-navdatareader-release | ||
qmake ../navdatareader/navdatareader.pro CONFIG+=release | ||
make | ||
``` | ||
|
||
To build the release version: | ||
- mkdir build-navdatareader-release | ||
- cd build-navdatareader-release | ||
- qmake ../navdatareader/navdatareader.pro CONFIG+=release | ||
- make | ||
### To build the navdatareader debug version: | ||
|
||
To build the debug version: | ||
- mkdir build-navdatareader-debug | ||
- cd build-navdatareader-debug | ||
- qmake ../navdatareader/navdatareader.pro CONFIG+=debug | ||
- make | ||
``` | ||
mkdir build-navdatareader-debug | ||
cd build-navdatareader-debug | ||
qmake ../navdatareader/navdatareader.pro CONFIG+=debug | ||
make | ||
``` | ||
|
||
Branches / Project Dependencies | ||
------------------------------------------------------ | ||
## Branches / Project Dependencies | ||
|
||
Make sure to use the correct branches to avoid breaking dependencies. | ||
The branch master is the unstable development branch but all software should compile there. | ||
|
||
For releases check the release/MAJOR.MINOR branches to get the correct dependencies. | ||
The atools branch is usually one MAJOR number ahead. | ||
The atools branch is one MAJOR number ahead. | ||
|
||
So a project branch release/1.2 should work well with atools release/2.2 for example. | ||
So Navdatareader branch `release/1.2` should work well with atools `release/2.2` for example. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
# Echo all commands and exit on failure | ||
set -e | ||
set -x | ||
|
||
# Error checking for required variable APROJECTS | ||
if [ -z "$APROJECTS" ] ; then echo APROJECTS environment variable not set ; exit 1 ; fi | ||
if [ ! -d "$APROJECTS" ]; then echo "$APROJECTS" does not exist ; exit 1 ; fi | ||
|
||
# ============================================================================= | ||
# Set the required environment variable APROJECTS to the base directory for | ||
# atools and navdatareader. | ||
|
||
# ============================================================================= | ||
# Configuration can be overloaded on the command line by setting the | ||
# variables below before calling this script. | ||
# | ||
# See the *.pro project files for more information. | ||
# | ||
# Example: | ||
# export QMAKE_STATIC=~/Projekte/build-qt-5.12.0-release/bin/qmake | ||
# export MARBLE_LIB_PATH=~/Programme/Marble-debug/lib | ||
# export MARBLE_INC_PATH=~/Programme/Marble-debug/include | ||
|
||
export CONF_TYPE=${CONF_TYPE:-"release"} | ||
export ATOOLS_INC_PATH=${ATOOLS_INC_PATH:-"${APROJECTS}/atools/src"} | ||
export ATOOLS_LIB_PATH=${ATOOLS_LIB_PATH:-"${APROJECTS}/build-atools-${CONF_TYPE}"} | ||
|
||
# Defines the used Qt for all builds | ||
export QMAKE_SHARED=${QMAKE_SHARED:-"${HOME}/Qt/5.9.5/gcc_64/bin/qmake"} | ||
|
||
# Do not change the DEPLOY_BASE since some scripts depend on it | ||
export DEPLOY_BASE="${APROJECTS}/deploy" | ||
|
||
# =========================================================================== | ||
# ========================== navdatareader - shared Qt | ||
# =========================================================================== | ||
|
||
# =========================================================================== | ||
# ========================== atools | ||
rm -rf ${APROJECTS}/build-atools-${CONF_TYPE} | ||
mkdir -p ${APROJECTS}/build-atools-${CONF_TYPE} | ||
cd ${APROJECTS}/build-atools-${CONF_TYPE} | ||
|
||
${QMAKE_SHARED} ${APROJECTS}/atools/atools.pro -spec linux-g++ CONFIG+=${CONF_TYPE} | ||
make -j4 | ||
|
||
# =========================================================================== | ||
# ========================== navdatareader | ||
rm -rf ${APROJECTS}/build-navdatareader-${CONF_TYPE} | ||
mkdir -p ${APROJECTS}/build-navdatareader-${CONF_TYPE} | ||
cd ${APROJECTS}/build-navdatareader-${CONF_TYPE} | ||
|
||
${QMAKE_SHARED} ${APROJECTS}/navdatareader/navdatareader.pro -spec linux-g++ CONFIG+=${CONF_TYPE} | ||
make -j4 | ||
|
||
make copydata | ||
make deploy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
set -x | ||
|
||
bash pull_all.sh | ||
|
||
bash build_release.sh | ||
|
||
bash pack_deploy.sh | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/bin/bash | ||
|
||
# Echo all commands and exit on failure | ||
set -e | ||
set -x | ||
|
||
# Error checking for required variable APROJECTS | ||
if [ -z "$APROJECTS" ] ; then echo APROJECTS environment variable not set ; exit 1 ; fi | ||
if [ ! -d "$APROJECTS" ]; then echo "$APROJECTS" does not exist ; exit 1 ; fi | ||
|
||
# Override by envrionment variable for another target | ||
export SSH_DEPLOY_TARGET=${SSH_DEPLOY_TARGET:-"darkon:/data/alex/Public/Releases"} | ||
|
||
export FILENAME=`date "+20%y%m%d-%H%M"` | ||
|
||
( | ||
cd ${APROJECTS}/deploy | ||
|
||
tar cfvz Navdatareader.tar.gz "Navdatareader" | ||
) | ||
|
||
scp ${APROJECTS}/deploy/Navdatareader.tar.gz ${SSH_DEPLOY_TARGET}/Navdatareader-linux-${FILENAME}.tar.gz | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
# Echo all commands and exit on failure | ||
set -e | ||
set -x | ||
|
||
# Error checking for required variable APROJECTS | ||
if [ -z "$APROJECTS" ] ; then echo APROJECTS environment variable not set ; exit 1 ; fi | ||
if [ ! -d "$APROJECTS" ]; then echo "$APROJECTS" does not exist ; exit 1 ; fi | ||
|
||
cd ${APROJECTS}/atools | ||
|
||
git pull --verbose --tags | ||
|
||
cd ${APROJECTS}/navdatareader | ||
|
||
git pull --verbose --tags | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Could you elaborate on this step? I'm not sure what to do to "create" the deploy step. I'm able to build and run navdata reader from within Qt, but I can't figure out how to get it to run on its own.
When I go into the Build menu there is a "Deploy" option but it doesn't seem to do anything.