diff --git a/fg-from-scratch/README.md b/fg-from-scratch/README.md index c9b1dba..5cddcd7 100644 --- a/fg-from-scratch/README.md +++ b/fg-from-scratch/README.md @@ -1,41 +1,40 @@ ## fg-from-scratch Windows utility to download, compile, and stage TerraGear and its dependencies -Copyright (C) 2018 Scott Giese (xDraconian) scttgs0@gmail.com +Copyright (C) 2018-2019 Scott Giese (xDraconian) scttgs0@gmail.com ### Purpose: -Simplify the process of producing a working version of the TerraGear tools for Windows users. +Simplify the process of producing a working version of the OSG, SimGear, FlightGear, and TerraGear for Windows users. If you find this script useful, or not useful, please share your experience with me via a brief email. ### Approach: Rather than leveraging the popular Win.3rdParty download, this script compiles all dependencies on your hardware. This eliminates many of the problems associated with mixed compilation in which -your compiled binary become in conflict with 3rd-party binaries. +your compiled binary comes into conflict with 3rd-party binaries. -vcpkg is leveraged to download and compile all the dependencies required by TerraGear. - -This script could be expanded to include compiling FlightGear and/or any of the other FlightGear -submodules (FGCom, Atlas, OpenRadar, etc.) +vcpkg is leveraged to download and compile all the dependencies required. ### Supported Platform: Windows 10 ### Prerequisites: - Visual Studio Community 2017 + Visual Studio Community 2017 + https://www.visualstudio.com/downloads/ Include the C++ package which includes the MSVC 19.14 compiler - CMake 3.11.3 + CMake 3.11.3 + https://cmake.org/download/ The script assumes the installation folder is c:\Program Files\. - Qt 5.10.1 + Qt 5.10.1 + https://www.qt.io/download/ The script assumes the installation folder is C:\Qt\. - Git 2.17.1 + Git 2.17.1 + https://git-scm.com/download/win/ The script assumes the installation folder is reflected on your PATH. +Author's configuration: Visual Studio Community 2019, CMake 3.15.3, Qt 5.13.1, Git 2.18.0 + ### Recommended: Before running the script for the first time, set this environment variable: @@ -47,23 +46,29 @@ You can execute the above command via a Command Terminal or via Powershell Admin ### Usage: The script is intended to be run multiple times. During the first execution, all the packages are downloaded and compiled. Any time the script is executed afterward, the packages will update themselves. -Note: Because failures can sometimes occur, the script will download packages after the first execution. Once you confirm that all packages have successfully been downloaded, you can optimize the script by adding REM at the beginning of the line. Refer to the comments within the script. +Note: Because failures can occur, the script will continue to download packages even after the first execution. Run the command script interactively. No log is produced. fg-from-scratch.cmd -Runs the command script and routes STDOUT and STDERR to a log file. **The prompts have been removed, so it is no longer necessary to monitor the log while it is running.** +Run the command script and routes STDOUT and STDERR to a log file. fg-from-scratch.cmd > scratch.log 2>&1 +**Fix for the "White Text" issue** - pass either -wt or - -whitetext as an argument: + + fg-from-scratch.cmd -wt > scratch.log 2>&1 + +The above command will force the usage of James' customized OSG source repo to leverage his workaround. + Options for monitoring the log file while the script is running: Start the script and then - Load the log file into Notepad++ (https://notepad-plus-plus.org/). - Turn on feature "Monitor" via Notepad++ - **[Preferred]** Load the log file into WinTail (http://www.baremetalsoft.com/wintail/) -### Example Project +### TerraGear Example Project Refer to CustomSceneryProjects/Test folder for an example of scenery generation. generate.cmd > generate.log 2>&1 diff --git a/fg-from-scratch/fg-from-scratch.cmd b/fg-from-scratch/fg-from-scratch.cmd index d1d628a..742aa08 100644 --- a/fg-from-scratch/fg-from-scratch.cmd +++ b/fg-from-scratch/fg-from-scratch.cmd @@ -18,28 +18,41 @@ REM along with this program; if not, write to the Free Software REM Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. REM Defaults +set ROOT_DIR=%CD% set WHITE_TEXT_FIX=0 set OSG_SOURCE_PATH=scratch-source/openscenegraph-3.6-git set OSG_BUILD_PATH=scratch-build/openscenegraph-3.6 +set WT_GDAL_INCLUDE_DIR=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include +set WT_GDAL_LIBRARY=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib +set WT_GDAL_LIBRARY_DEBUG=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/gdald.lib REM Process arguments :parse if "%~1"=="" goto endparse -if "%~1"=="-wt"( +if "%~1"=="-wt" ( set WHITE_TEXT_FIX=1 set OSG_SOURCE_PATH=scratch-source/openscenegraph-fix-git set OSG_BUILD_PATH=scratch-build/openscenegraph-fix + set WT_GDAL_INCLUDE_DIR= + set WT_GDAL_LIBRARY= + set WT_GDAL_LIBRARY_DEBUG= ) -if "%~1"=="--whitetext"( +if "%~1"=="--whitetext" ( set WHITE_TEXT_FIX=1 set OSG_SOURCE_PATH=scratch-source/openscenegraph-fix-git set OSG_BUILD_PATH=scratch-build/openscenegraph-fix + set WT_GDAL_INCLUDE_DIR= + set WT_GDAL_LIBRARY= + set WT_GDAL_LIBRARY_DEBUG= ) SHIFT goto parse :endparse -set ROOT_DIR=%CD% +echo White Text Fix: %WHITE_TEXT_FIX% +echo %OSG_SOURCE_PATH% +echo %OSG_BUILD_PATH% + set PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/bin;%ROOT_DIR%/vcpkg-git/installed/x64-windows/include;%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib;%PATH% REM Determine location of Qt5 @@ -102,10 +115,10 @@ if %WHITE_TEXT_FIX%==1 ( mkdir scratch-build\openscenegraph-fix ) if not exist scratch-source/openscenegraph-fix-git/NUL ( - echo Downloading OpenSceneGraph (white text fix) . . . + echo Downloading OpenSceneGraph . . . git clone -b fgfs-342-1 https://github.com/zakalawe/osg.git scratch-source/openscenegraph-fix-git ) else ( - echo Updating OpenSceneGraph (white text fix) . . . + echo Updating OpenSceneGraph . . . cd scratch-source/openscenegraph-fix-git git pull ) @@ -184,9 +197,9 @@ cmake ..\..\%OSG_SOURCE_PATH% -G %CMAKE_TOOLCHAIN% ^ -DFREETYPE_INCLUDE_DIR_ft2build:PATH=%ROOT_DIR%/vcpkg-git/packages/freetype_x64-windows/include ^ -DFREETYPE_LIBRARY_RELEASE:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freetype.lib ^ -DFREETYPE_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freetyped.lib ^ - -DGDAL_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ - -DGDAL_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/gdal.lib ^ - -DGDAL_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/gdald.lib ^ + -DGDAL_INCLUDE_DIR:PATH=%WT_GDAL_INCLUDE_DIR% ^ + -DGDAL_LIBRARY:FILEPATH=%WT_GDAL_LIBRARY% ^ + -DGDAL_LIBRARY_DEBUG:FILEPATH=%WT_GDAL_LIBRARY_DEBUG% ^ -DGLUT_INCLUDE_DIR:PATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/include ^ -DGLUT_LIBRARY:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/lib/freeglut.lib ^ -DGLUT_LIBRARY_DEBUG:FILEPATH=%ROOT_DIR%/vcpkg-git/installed/x64-windows/debug/lib/freeglut.lib ^