diff --git a/CMakeLists.txt b/CMakeLists.txt index 2eed4829d28e..a74922774554 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,14 +29,16 @@ MESSAGE(STATUS "QGIS version: ${COMPLETE_VERSION} ${RELEASE_NAME} (${QGIS_VERSIO ############################################################# # Configure CCache if available -option(USE_CCACHE "Use ccache" ON) -if (USE_CCACHE) +IF(NOT MSVC) + option(USE_CCACHE "Use ccache" ON) + if (USE_CCACHE) find_program(CCACHE_FOUND ccache) if(CCACHE_FOUND) set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE ccache) set_property(GLOBAL PROPERTY RULE_LAUNCH_LINK ccache) endif(CCACHE_FOUND) -endif() + endif(USE_CCACHE) +endif(NOT MSVC) # in generated makefiles use relative paths so the project dir is moveable # Note commented out since it cause problems but it would be nice to resolve these and enable diff --git a/INSTALL b/INSTALL index a57c368b3643..139fbb2bc24a 100644 --- a/INSTALL +++ b/INSTALL @@ -1,10 +1,10 @@ QGIS Building QGIS from source - step by step -Friday May 11, 2018 +Wednesday June 20, 2018 -Last Updated: Friday May 11, 2018 -Last Change : Friday May 11, 2018 +Last Updated: Wednesday June 20, 2018 +Last Change : Wednesday June 20, 2018 1. Introduction @@ -430,12 +430,11 @@ To enable debug prints for the current user, execute: 4.1. Building with Microsoft Visual Studio ========================================== -This section describes how to build QGIS using Visual Studio on Windows. This -is currently also how the binary QGIS packages are made (earlier versions used -MinGW). +This section describes how to build QGIS using Visual Studio (MSVC) 2015 on Windows. +This is currently also how the binary QGIS packages are made (earlier versions used MinGW). This section describes the setup required to allow Visual Studio to be used to -build QGIS. +build QGIS. 4.1.1. Visual C++ Community Edition @@ -457,10 +456,6 @@ Download and install following packages: | OSGeo4W | http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe (32bit) or http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe (64bit) | | ninja | https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip | -OSGeo4W does not only provide ready packages for the current QGIS release and -nightly builds of master, but also offers most of the dependencies needs to -build it. - For the QGIS build you need to install following packages from cygwin: - bison @@ -469,19 +464,22 @@ For the QGIS build you need to install following packages from cygwin: and from OSGeo4W (select Advanced Installation): -- qgis-rel-deps +- qgis-dev-deps This will also select packages the above packages depend on. -If you install other packages, this might cause issues. Particularly, make sure -not to install the msinttypes package. It installs a stdint.h file in -OSGeo4W[64]\include, that conflicts with Visual Studio own stdint.h, which for -example breaks the build of the virtuallayer provider. + If you install other packages, this might cause issues. Particularly, make sure + not to install the msinttypes package. It installs a stdint.h file in + OSGeo4W[64]\include, that conflicts with Visual Studio own stdint.h, which for + example breaks the build of the virtual layer provider. Earlier versions of this document also covered how to build all above dependencies. If you're interested in that, check the history of this page in the Wiki or the SVN repository. +ninja: + copy ninja.exe to d:\OSGeo4W64\bin\ + 4.1.3. Setting up the Visual Studio project with CMake ====================================================== @@ -496,71 +494,78 @@ variables create the following batch file (assuming the above packages were installed in the default locations): @echo off - set OSGEO4W_ROOT=C:\OSGeo4W - call "%OSGEO4W_ROOT%\bin\o4w_env.bat" - call "%OSGEO4W_ROOT%\bin\py3_env.bat" - call "%OSGEO4W_ROOT%\bin\qt5_env.bat" - - set O4W_ROOT=%OSGEO4W_ROOT:\=/% - set LIB_DIR=%O4W_ROOT% - - call "C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 - path %path%;C:\Program Files\Microsoft Visual Studio 14.0\VC\bin - - path %PATH%;C:\Program Files\CMake\bin;c:\cygwin\bin - - @set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-7.2.1 - @set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include - @set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib - - set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib - set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include - + call X:\src\qgis\ms-windows\osgeo4w\msvc-env.bat x86_64 @cmd -Start the batch file and on the command prompt checkout the QGIS source from +Save the batch file as d:\OSGeo4W64\OSGeo4W-dev.bat and run it. +On the command prompt checkout the QGIS source from git to the source directory QGIS: git clone git://github.com/qgis/QGIS.git -Create a 'build' directory somewhere. This will be where all the build output -will be generated. +Using configonly.cmd to create the MSVC solution file: + We will be using the file ms-windows/osgeo4w/configonly.cmd to create an MSVC solution file. + There are a few options for a solution file, following are the options: ninja, native MSVC. + The advantage of using native MSVC solution is that you can find the root of build problems much easily. + configonly.cmd is meant to create a configured build directory with a MSVC solution file: + + ``` + configonly.cmd + ``` + +Compiling QGIS with MSVC: + We will need to run MSVC with all the environment variables set, thus we will run it as follows: + Run the batch file OSGeo4W-dev.bat you created before. On the command prompt run: devenv + From MSVC, open the solution file + d:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\qgis2.99.0.sln + Try to build the solution go grab a cup of tea, it may take a (while). + If it fails, run it again and again until there are [hopefully] no errors. + +Running QGIS from within MSVC: + Edit the properties of the project ALL_BUILD: + Debugging -> Command -> D:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo\qgis.exe + Run. + Ignore the "These projects are out of date" message, it appeares even if no files were was changed. + +Old alternative method that might still work using cmake-gui: + Create a 'build' directory somewhere. This will be where all the build output + will be generated. -Now run cmake-gui (still from cmd) and in the Where is the source code: -box, browse to the top level QGIS directory. + Now run cmake-gui (still from cmd) and in the Where is the source code: + box, browse to the top level QGIS directory. -In the Where to build the binaries: box, browse to the 'build' directory you -created. + In the Where to build the binaries: box, browse to the 'build' directory you + created. -If the path to bison and flex contains blanks, you need to use the short name -for the directory (i.e. C:\Program Files should be rewritten to -C:\Progra~n, where n is the number as shown in `dir /x C:\``). + If the path to bison and flex contains blanks, you need to use the short name + for the directory (i.e. C:\Program Files should be rewritten to + C:\Progra~n, where n is the number as shown in `dir /x C:\``). -Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python -bindings are placed into the output directory when you run the INSTALL target. + Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python + bindings are placed into the output directory when you run the INSTALL target. -Hit Configure to start the configuration and select Visual Studio 9 2008 -and keep native compilers and click Finish. + Hit Configure to start the configuration and select Visual Studio 9 2008 + and keep native compilers and click Finish. -The configuration should complete without any further questions and allow you to -click Generate. + The configuration should complete without any further questions and allow you to + click Generate. -Now close cmake-gui and continue on the command prompt by starting -vcexpress. Use File / Open / Project/Solutions and open the -qgis-x.y.z.sln File in your project directory. + Now close cmake-gui and continue on the command prompt by starting + vcexpress. Use File / Open / Project/Solutions and open the + qgis-x.y.z.sln File in your project directory. -Change Solution Configuration from Debug to RelWithDebInfo (Release -with Debug Info) or Release before you build QGIS using the ALL_BUILD -target (otherwise you need debug libraries that are not included). + Change Solution Configuration from Debug to RelWithDebInfo (Release + with Debug Info) or Release before you build QGIS using the ALL_BUILD + target (otherwise you need debug libraries that are not included). -After the build completed you should install QGIS using the INSTALL target. + After the build completed you should install QGIS using the INSTALL target. -Install QGIS by building the INSTALL project. By default this will install to -c:\Program Files\qgis (this can be changed by changing the -CMAKE_INSTALL_PREFIX variable in cmake-gui). + Install QGIS by building the INSTALL project. By default this will install to + c:\Program Files\qgis (this can be changed by changing the + CMAKE_INSTALL_PREFIX variable in cmake-gui). -You will also either need to add all the dependency DLLs to the QGIS install -directory or add their respective directories to your PATH. + You will also either need to add all the dependency DLLs to the QGIS install + directory or add their respective directories to your PATH. 4.1.4. Packaging @@ -600,7 +605,7 @@ Now create a package. ./quickpackage.sh -After this you should now have a nsis installer containing your own build +After this you should now have a nsis installer containing your own build of QGIS and all dependencies needed to run it on a windows machine. diff --git a/doc/INSTALL.html b/doc/INSTALL.html index a34cc4db9637..1c57c3b53d9f 100644 --- a/doc/INSTALL.html +++ b/doc/INSTALL.html @@ -77,13 +77,13 @@

-Last Updated: Friday May 11, 2018 -Last Change : Friday May 11, 2018 +Last Updated: Wednesday June 20, 2018 +Last Change : Wednesday June 20, 2018

@@ -701,13 +701,12 @@

4. Building on Windows

4.1. Building with Microsoft Visual Studio

-This section describes how to build QGIS using Visual Studio on Windows. This -is currently also how the binary QGIS packages are made (earlier versions used -MinGW). +This section describes how to build QGIS using Visual Studio (MSVC) 2015 on Windows. +This is currently also how the binary QGIS packages are made (earlier versions used MinGW).

This section describes the setup required to allow Visual Studio to be used to -build QGIS. +build QGIS.

4.1.1. Visual C++ Community Edition

@@ -748,11 +747,6 @@

4.1.2. Other tools and dependencies

-

-OSGeo4W does not only provide ready packages for the current QGIS release and -nightly builds of master, but also offers most of the dependencies needs to -build it. -

For the QGIS build you need to install following packages from cygwin:

@@ -768,23 +762,27 @@

4.1.2. Other tools and dependencies

    -
  • qgis-rel-deps +
  • qgis-dev-deps

This will also select packages the above packages depend on.

-If you install other packages, this might cause issues. Particularly, make sure -not to install the msinttypes package. It installs a stdint.h file in -OSGeo4W[64]\include, that conflicts with Visual Studio own stdint.h, which for -example breaks the build of the virtuallayer provider. + If you install other packages, this might cause issues. Particularly, make sure + not to install the msinttypes package. It installs a stdint.h file in + OSGeo4W[64]\include, that conflicts with Visual Studio own stdint.h, which for + example breaks the build of the virtual layer provider.

Earlier versions of this document also covered how to build all above dependencies. If you're interested in that, check the history of this page in the Wiki or the SVN repository.

+

+ninja: + copy ninja.exe to d:\OSGeo4W64\bin\ +

4.1.3. Setting up the Visual Studio project with CMake

@@ -802,31 +800,13 @@

4.1.3. Setting up the Visual Studio project with CMake

 @echo off
-set OSGEO4W_ROOT=C:\OSGeo4W
-call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
-call "%OSGEO4W_ROOT%\bin\py3_env.bat"
-call "%OSGEO4W_ROOT%\bin\qt5_env.bat"
-
-set O4W_ROOT=%OSGEO4W_ROOT:\=/%
-set LIB_DIR=%O4W_ROOT%
-
-call "C:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
-path %path%;C:\Program Files\Microsoft Visual Studio 14.0\VC\bin
-
-path %PATH%;C:\Program Files\CMake\bin;c:\cygwin\bin
-
-@set GRASS_PREFIX=c:/OSGeo4W/apps/grass/grass-7.2.1
-@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
-@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib
-
-set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib
-set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include
-
+call X:\src\qgis\ms-windows\osgeo4w\msvc-env.bat x86_64
 @cmd
 

-Start the batch file and on the command prompt checkout the QGIS source from +Save the batch file as d:\OSGeo4W64\OSGeo4W-dev.bat and run it. +On the command prompt checkout the QGIS source from git to the source directory QGIS:

@@ -835,55 +815,84 @@

4.1.3. Setting up the Visual Studio project with CMake

-Create a 'build' directory somewhere. This will be where all the build output -will be generated. +Using configonly.cmd to create the MSVC solution file: + We will be using the file ms-windows/osgeo4w/configonly.cmd to create an MSVC solution file. + There are a few options for a solution file, following are the options: ninja, native MSVC. + The advantage of using native MSVC solution is that you can find the root of build problems much easily. + configonly.cmd is meant to create a configured build directory with a MSVC solution file: +

+

+ ``` + configonly.cmd + ``` +

+

+Compiling QGIS with MSVC: + We will need to run MSVC with all the environment variables set, thus we will run it as follows: + Run the batch file OSGeo4W-dev.bat you created before. On the command prompt run: devenv + From MSVC, open the solution file + d:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\qgis2.99.0.sln + Try to build the solution go grab a cup of tea, it may take a. + If it fails, run it again and again until there are [hopefully] no errors. +

+

+Running QGIS from within MSVC: + Edit the properties of the project ALL_BUILD: + Debugging -> Command -> D:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo\qgis.exe + Run. + Ignore the "These projects are out of date" message, it appeares even if no files were was changed. +

+

+Old alternative method that might still work using cmake-gui: + Create a 'build' directory somewhere. This will be where all the build output + will be generated.

-Now run cmake-gui (still from cmd) and in the Where is the source code: -box, browse to the top level QGIS directory. + Now run cmake-gui (still from cmd) and in the Where is the source code: + box, browse to the top level QGIS directory.

-In the Where to build the binaries: box, browse to the 'build' directory you -created. + In the Where to build the binaries: box, browse to the 'build' directory you + created.

-If the path to bison and flex contains blanks, you need to use the short name -for the directory (i.e. C:\Program Files should be rewritten to -C:\Progra~n, where n is the number as shown in `dir /x C:\``). + If the path to bison and flex contains blanks, you need to use the short name + for the directory (i.e. C:\Program Files should be rewritten to + C:\Progra~n, where n is the number as shown in `dir /x C:\``).

-Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python -bindings are placed into the output directory when you run the INSTALL target. + Verify that the 'BINDINGS_GLOBAL_INSTALL' option is not checked, so that python + bindings are placed into the output directory when you run the INSTALL target.

-Hit Configure to start the configuration and select Visual Studio 9 2008 -and keep native compilers and click Finish. + Hit Configure to start the configuration and select Visual Studio 9 2008 + and keep native compilers and click Finish.

-The configuration should complete without any further questions and allow you to -click Generate. + The configuration should complete without any further questions and allow you to + click Generate.

-Now close cmake-gui and continue on the command prompt by starting -vcexpress. Use File / Open / Project/Solutions and open the -qgis-x.y.z.sln File in your project directory. + Now close cmake-gui and continue on the command prompt by starting + vcexpress. Use File / Open / Project/Solutions and open the + qgis-x.y.z.sln File in your project directory.

-Change Solution Configuration from Debug to RelWithDebInfo (Release -with Debug Info) or Release before you build QGIS using the ALL_BUILD -target (otherwise you need debug libraries that are not included). + Change Solution Configuration from Debug to RelWithDebInfo (Release + with Debug Info) or Release before you build QGIS using the ALL_BUILD + target (otherwise you need debug libraries that are not included).

-After the build completed you should install QGIS using the INSTALL target. + After the build completed you should install QGIS using the INSTALL target.

-Install QGIS by building the INSTALL project. By default this will install to -c:\Program Files\qgis<version> (this can be changed by changing the -CMAKE_INSTALL_PREFIX variable in cmake-gui). + Install QGIS by building the INSTALL project. By default this will install to + c:\Program Files\qgis<version> (this can be changed by changing the + CMAKE_INSTALL_PREFIX variable in cmake-gui).

-You will also either need to add all the dependency DLLs to the QGIS install -directory or add their respective directories to your PATH. + You will also either need to add all the dependency DLLs to the QGIS install + directory or add their respective directories to your PATH.

4.1.4. Packaging

@@ -937,7 +946,7 @@

4.1.5. Packaging your own build of QGIS

-After this you should now have a nsis installer containing your own build +After this you should now have a nsis installer containing your own build of QGIS and all dependencies needed to run it on a windows machine.

diff --git a/doc/msvc.t2t b/doc/msvc.t2t index 102127f36bb9..dd062f8bb1ed 100644 --- a/doc/msvc.t2t +++ b/doc/msvc.t2t @@ -1,11 +1,11 @@ ==Building with Microsoft Visual Studio== -This section describes how to build QGIS using Visual Studio (MSVC) 2015 on Windows. +This section describes how to build QGIS using Visual Studio (MSVC) 2015 on Windows. This is currently also how the binary QGIS packages are made (earlier versions used MinGW). This section describes the setup required to allow Visual Studio to be used to -build QGIS. +build QGIS. ===Visual C++ Community Edition=== @@ -23,10 +23,6 @@ Download and install following packages: | OSGeo4W | http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86.exe (32bit) or http://download.osgeo.org/osgeo4w/osgeo4w-setup-x86_64.exe (64bit) | | ninja | https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-win.zip | -cygwin: - You should install cygwin to c:\cygwin (and not c:\cygwin64, which is the default for the x64) - otherwise you would need to edit some batch files. - For the QGIS build you need to install following packages from cygwin: - bison - flex @@ -35,7 +31,7 @@ For the QGIS build you need to install following packages from cygwin: and from OSGeo4W (select //Advanced Installation//): -- qgis-rel-deps +- qgis-dev-deps - This will also select packages the above packages depend on. @@ -43,7 +39,7 @@ This will also select packages the above packages depend on. If you install other packages, this might cause issues. Particularly, make sure **not** to install the msinttypes package. It installs a stdint.h file in OSGeo4W[64]\include, that conflicts with Visual Studio own stdint.h, which for - example breaks the build of the virtuallayer provider. + example breaks the build of the virtual layer provider. Earlier versions of this document also covered how to build all above dependencies. If you're interested in that, check the history of this page in the Wiki @@ -51,7 +47,7 @@ or the SVN repository. ninja: copy ninja.exe to d:\OSGeo4W64\bin\ - + === Setting up the Visual Studio project with CMake === /!\ Consider this section as example. It tends to outdate, when OSGeo4W and @@ -65,24 +61,7 @@ installed in the default locations): ``` @echo off - -set OSGEO4W_ROOT=D:\OSGeo4W64 -call "%OSGEO4W_ROOT%\bin\o4w_env.bat" -call "%OSGEO4W_ROOT%\bin\qt5_env.bat" -call "%OSGEO4W_ROOT%\bin\py3_env.bat" - -set VS140COMNTOOLS=%PROGRAMFILES(x86)%\Microsoft Visual Studio 14.0\Common7\Tools\ -call "%PROGRAMFILES(x86)%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 - -set INCLUDE=%INCLUDE%;%PROGRAMFILES(x86)%\Microsoft SDKs\Windows\v7.1A\include -set LIB=%LIB%;%PROGRAMFILES(x86)%\Microsoft SDKs\Windows\v7.1A\lib - -path %PATH%;%PROGRAMFILES%\CMake\bin;c:\cygwin\bin - -@set GRASS_PREFIX="%OSGEO4W_ROOT%\apps\grass\grass-7.2.1 -@set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include -@set LIB=%LIB%;%OSGEO4W_ROOT%\lib;%OSGEO4W_ROOT%\lib - +call X:\src\qgis\ms-windows\osgeo4w\msvc-env.bat x86_64 @cmd ``` @@ -94,41 +73,28 @@ git to the source directory ``QGIS``: git clone git://github.com/qgis/QGIS.git ``` -Using package-nightly.cmd to create the MSVC solution file: - We will be using the file ms-windows/osgeo4w/package-nightly.cmd to create an MSVC solution file. +Using configonly.cmd to create the MSVC solution file: + We will be using the file ms-windows/osgeo4w/configonly.cmd to create an MSVC solution file. There are a few options for a solution file, following are the options: ninja, native MSVC. The advantage of using native MSVC solution is that you can find the root of build problems much easily. - Currently the package-nightly.cmd file creates a ninja solution. - In order to modify it to create an MSVC solution instead, edit it and replace the following line: - - ``cmake -G Ninja ^`` - with - ``cmake -G "Visual Studio 14 2015 Win64" ^`` - - Currently, package-nightly.cmd will also build QGIS. if you want it only to create the solution file, - then following the line: - ``if errorlevel 1 (echo cmake failed & goto error)`` - add the following line: - ``goto end`` - - Running package-nightly.cmd: - Run the batch file OSGeo4W-dev.bat you created before. On the command prompt run: + configonly.cmd is meant to create a configured build directory with a MSVC solution file: + ``` - package-nightly.cmd 2.99.0 1 qgis-dev x86_64 + configonly.cmd ``` - + Compiling QGIS with MSVC: We will need to run MSVC with all the environment variables set, thus we will run it as follows: Run the batch file OSGeo4W-dev.bat you created before. On the command prompt run: ``devenv`` - From MSVC, open the solution file - ``d:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-dev-x86_64\qgis2.99.0.sln`` - Try to build the solution [go grab a cup of tea, it may take a while]. + From MSVC, open the solution file + ``d:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\qgis2.99.0.sln`` + Try to build the solution [go grab a cup of tea, it may take a while]. If it fails, run it again and again until there are [hopefully] no errors. -Running QGIS from within MSVC: +Running QGIS from within MSVC: Edit the properties of the project ALL_BUILD: - Debugging -> Command -> D:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-dev-x86_64\output\bin\RelWithDebInfo\qgis.exe + Debugging -> Command -> D:\OSGeo4W64\QGIS\ms-windows\osgeo4w\build-qgis-test-x86_64\output\bin\RelWithDebInfo\qgis.exe Run. Ignore the "These projects are out of date" message, it appeares even if no files were was changed. @@ -168,8 +134,8 @@ Old alternative method that might still work using cmake-gui: Install QGIS by building the INSTALL project. By default this will install to c:\Program Files\qgis (this can be changed by changing the - CMAKE_INSTALL_PREFIX variable in cmake-gui). - + CMAKE_INSTALL_PREFIX variable in cmake-gui). + You will also either need to add all the dependency DLLs to the QGIS install directory or add their respective directories to your PATH. @@ -212,7 +178,7 @@ Now create a package. ./quickpackage.sh ``` -After this you should now have a nsis installer containing your own build +After this you should now have a nsis installer containing your own build of QGIS and all dependencies needed to run it on a windows machine. diff --git a/ms-windows/osgeo4w/msvc-env.bat b/ms-windows/osgeo4w/msvc-env.bat new file mode 100644 index 000000000000..36ffc3ce1e55 --- /dev/null +++ b/ms-windows/osgeo4w/msvc-env.bat @@ -0,0 +1,72 @@ +@echo off +REM *************************************************************************** +REM msvc-env.cmd +REM --------------------- +REM begin : June 2018 +REM copyright : (C) 2018 by Juergen E. Fischer +REM email : jef at norbit dot de +REM *************************************************************************** +REM * * +REM * This program is free software; you can redistribute it and/or modify * +REM * it under the terms of the GNU General Public License as published by * +REM * the Free Software Foundation; either version 2 of the License, or * +REM * (at your option) any later version. * +REM * * +REM *************************************************************************** + +set ARCH=%1 +if not "%ARCH%"=="x86" if not "%ARCH%"=="x86_64" ( + goto usage +) + +if "%OSGEO4W_ROOT%"=="" ( + if "%ARCH%"=="x86" ( + set OSGEO4W_ROOT=C:\OSGeo4W + set VCARCH=x86 + ) else ( + set OSGEO4W_ROOT=C:\OSGeo4W64 + set VCARCH=amd64 + ) +) + +if not exist "%OSGEO4W_ROOT%\bin\o4w_env.bat" (echo o4w_env.bat not found & goto error) +call "%OSGEO4W_ROOT%\bin\o4w_env.bat" +call "%OSGEO4W_ROOT%\bin\py3_env.bat" +call "%OSGEO4W_ROOT%\bin\qt5_env.bat" + +if not "%PROGRAMFILES(X86)%"=="" set PF86=%PROGRAMFILES(X86)% +if "%PF86%"=="" set PF86=%PROGRAMFILES% +if "%PF86%"=="" (echo PROGRAMFILES not set & goto error) + +set VS140COMNTOOLS=%PF86%\Microsoft Visual Studio 14.0\Common7\Tools\ +call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" %VCARCH% +path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin + +set GRASS7= +if exist %OSGEO4W_ROOT%\bin\grass72.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass72.bat +if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat +if "%GRASS7%"=="" (echo GRASS7 not found & goto error) +for /f "usebackq tokens=1" %%a in (`%GRASS7% --config path`) do set GRASS_PREFIX=%%a + +set PYTHONPATH= +if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;%PROGRAMFILES%\CMake\bin +if exist "%PF86%\CMake\bin" path %PATH%;%PF86%\CMake\bin +if exist c:\cygwin64\bin path %PATH%;c:\cygwin64\bin +if exist c:\cygwin\bin path %PATH%;c:\cygwin\bin +path + +set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib +set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include + +goto end + +:usage +echo usage: %0 arch +echo sample: %0 x86_64 +exit /b 1 + +:error +echo ENV ERROR %ERRORLEVEL%: %DATE% %TIME% +exit /b 1 + +:end diff --git a/ms-windows/osgeo4w/package-nightly.cmd b/ms-windows/osgeo4w/package-nightly.cmd index d1e4345685da..f0f54eba05ee 100644 --- a/ms-windows/osgeo4w/package-nightly.cmd +++ b/ms-windows/osgeo4w/package-nightly.cmd @@ -30,39 +30,21 @@ if not "%SHA%"=="" set SHA=-%SHA% if "%SITE%"=="" set SITE=qgis.org set BUILDDIR=%CD%\build-%PACKAGENAME%-%ARCH% - -if "%OSGEO4W_ROOT%"=="" ( - if "%ARCH%"=="x86" ( - set OSGEO4W_ROOT=C:\OSGeo4W - ) else ( - set OSGEO4W_ROOT=C:\OSGeo4W64 - ) -) - if not exist "%BUILDDIR%" mkdir %BUILDDIR% if not exist "%BUILDDIR%" (echo could not create build directory %BUILDDIR% & goto error) -if not exist "%OSGEO4W_ROOT%\bin\o4w_env.bat" (echo o4w_env.bat not found & goto error) -call "%OSGEO4W_ROOT%\bin\o4w_env.bat" -call "%OSGEO4W_ROOT%\bin\py3_env.bat" -call "%OSGEO4W_ROOT%\bin\qt5_env.bat" +call msvc-env.bat %ARCH% set O4W_ROOT=%OSGEO4W_ROOT:\=/% set LIB_DIR=%O4W_ROOT% -if not "%PROGRAMFILES(X86)%"=="" set PF86=%PROGRAMFILES(X86)% -if "%PF86%"=="" set PF86=%PROGRAMFILES% -if "%PF86%"=="" (echo PROGRAMFILES not set & goto error) - if "%ARCH%"=="x86" goto cmake_x86 goto cmake_x86_64 :cmake_x86 -call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 -path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin -set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib -if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\SetupAPI.Lib +set SETUPAPI_LIBRARY=%PF86%\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib +if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Windows Kits\8.0\Lib\win8\um\x86\SetupAPI.Lib if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error) set CMAKE_OPT=^ @@ -73,11 +55,9 @@ set CMAKE_OPT=^ goto cmake :cmake_x86_64 -call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 -path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin\amd64 -set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib -if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\SetupAPI.Lib +set SETUPAPI_LIBRARY=%PF86%\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib +if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Windows Kits\8.0\Lib\win8\um\x64\SetupAPI.Lib if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error) set CMAKE_OPT=^ @@ -89,19 +69,13 @@ set CMAKE_OPT=^ -D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE :cmake -set GRASS7= -if exist %OSGEO4W_ROOT%\bin\grass72.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass72.bat -if exist %OSGEO4W_ROOT%\bin\grass74.bat set GRASS7=%OSGEO4W_ROOT%\bin\grass74.bat -if "%GRASS7%"=="" (echo GRASS7 not found & goto error) - -for /f "usebackq tokens=1" %%a in (`%GRASS7% --config path`) do set GRASS7_PATH=%%a -for %%i in ("%GRASS7_PATH%") do set GRASS7_VERSION=%%~nxi +for %%i in ("%GRASS_PREFIX%") do set GRASS7_VERSION=%%~nxi set GRASS7_VERSION=%GRASS7_VERSION:grass-=% set GRASS_VERSIONS=%GRASS7_VERSION% -set PYTHONPATH= -if exist "%PF86%\CMake\bin" path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin -if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;c:\cygwin\bin;%PROGRAMFILES%\CMake\bin +set TAR=tar.exe +if exist "c:\cygwin\bin\tar.exe" set TAR=c:\cygwin64\bin\tar.exe +if exist "c:\cygwin64\bin\tar.exe" set TAR=c:\cygwin64\bin\tar.exe PROMPT qgis%VERSION%$g @@ -155,10 +129,9 @@ touch %SRCDIR%\CMakeLists.txt echo CMAKE: %DATE% %TIME% if errorlevel 1 goto error -set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib -set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include +if "%CMAKEGEN%"=="" set CMAKEGEN=Ninja -cmake -G Ninja ^ +cmake -G "%CMAKEGEN%" ^ -D CMAKE_CXX_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^ -D CMAKE_C_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^ -D CMAKE_LINKER="%CMAKE_COMPILER_PATH:\=/%/link.exe" ^ @@ -171,7 +144,7 @@ cmake -G Ninja ^ -D WITH_GRASS=TRUE ^ -D WITH_3D=TRUE ^ -D WITH_GRASS7=TRUE ^ - -D GRASS_PREFIX7=%GRASS7_PATH:\=/% ^ + -D GRASS_PREFIX7=%GRASS_PREFIX:\=/% ^ -D WITH_GLOBE=FALSE ^ -D WITH_ORACLE=TRUE ^ -D WITH_CUSTOM_WIDGETS=TRUE ^ @@ -196,6 +169,8 @@ cmake -G Ninja ^ %SRCDIR:\=/% if errorlevel 1 (echo cmake failed & goto error) +if "%CONFIGONLY%"=="1" (echo Exiting after configuring build directory: %CD% & goto end) + :skipcmake if exist ..\noclean (echo skip clean & goto skipclean) echo CLEAN: %DATE% %TIME% @@ -264,6 +239,7 @@ cd .. sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversions@/%GRASS_VERSIONS%/g' postinstall-dev.bat >%OSGEO4W_ROOT%\etc\postinstall\%PACKAGENAME%.bat if errorlevel 1 (echo creation of desktop postinstall failed & goto error) + sed -e 's/@package@/%PACKAGENAME%/g' -e 's/@version@/%VERSION%/g' -e 's/@grassversions@/%GRASS_VERSIONS%/g' preremove-dev.bat >%OSGEO4W_ROOT%\etc\preremove\%PACKAGENAME%.bat if errorlevel 1 (echo creation of desktop preremove failed & goto error) @@ -306,7 +282,7 @@ move %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages\PyQt5\uic\widget-plugins\qgi if errorlevel 1 (echo move of customwidgets binding failed & goto error) if not exist %ARCH%\release\qgis\%PACKAGENAME% mkdir %ARCH%\release\qgis\%PACKAGENAME% -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^ --exclude-from exclude ^ --exclude "*.pyc" ^ apps/%PACKAGENAME% ^ @@ -320,7 +296,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS if errorlevel 1 (echo tar failed & goto error) if not exist %ARCH%\release\qgis\%PACKAGENAME%-pdb mkdir %ARCH%\release\qgis\%PACKAGENAME%-pdb -tar -C %BUILDDIR% -cjf %ARCH%/release/qgis/%PACKAGENAME%-pdb/%PACKAGENAME%-pdb-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %BUILDDIR% -cjf %ARCH%/release/qgis/%PACKAGENAME%-pdb/%PACKAGENAME%-pdb-%VERSION%-%PACKAGE%.tar.bz2 ^ apps/%PACKAGENAME%/pdb if errorlevel 1 (echo tar failed & goto error) diff --git a/ms-windows/osgeo4w/package.cmd b/ms-windows/osgeo4w/package.cmd index 1e10829bdee1..8b451119e2d6 100644 --- a/ms-windows/osgeo4w/package.cmd +++ b/ms-windows/osgeo4w/package.cmd @@ -30,39 +30,21 @@ if not "%SHA%"=="" set SHA=-%SHA% if "%SITE%"=="" set SITE=qgis.org set BUILDDIR=%CD%\build-%PACKAGENAME%-%ARCH% - -if "%OSGEO4W_ROOT%"=="" ( - if "%ARCH%"=="x86" ( - set OSGEO4W_ROOT=C:\OSGeo4W - ) else ( - set OSGEO4W_ROOT=C:\OSGeo4W64 - ) -) - if not exist "%BUILDDIR%" mkdir %BUILDDIR% if not exist "%BUILDDIR%" (echo could not create build directory %BUILDDIR% & goto error) -if not exist "%OSGEO4W_ROOT%\bin\o4w_env.bat" (echo o4w_env.bat not found & goto error) -call "%OSGEO4W_ROOT%\bin\o4w_env.bat" -call "%OSGEO4W_ROOT%\bin\py3_env.bat" -call "%OSGEO4W_ROOT%\bin\qt5_env.bat" +call msvc-env.bat %ARCH% set O4W_ROOT=%OSGEO4W_ROOT:\=/% set LIB_DIR=%O4W_ROOT% -if not "%PROGRAMFILES(X86)%"=="" set PF86=%PROGRAMFILES(X86)% -if "%PF86%"=="" set PF86=%PROGRAMFILES% -if "%PF86%"=="" (echo PROGRAMFILES not set & goto error) - if "%ARCH%"=="x86" goto cmake_x86 goto cmake_x86_64 :cmake_x86 -call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86 -path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin -set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib -if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x86\SetupAPI.Lib +set SETUPAPI_LIBRARY=%PF86%\Windows Kits\10\Lib\10.0.14393.0\um\x86\SetupAPI.Lib +if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Windows Kits\8.0\Lib\win8\um\x86\SetupAPI.Lib if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error) set CMAKE_OPT=^ @@ -71,11 +53,9 @@ set CMAKE_OPT=^ goto cmake :cmake_x86_64 -call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64 -path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin\amd64 -set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib -if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=c:\Program Files (x86)\Windows Kits\8.0\Lib\win8\um\x64\SetupAPI.Lib +set SETUPAPI_LIBRARY=%PF86%\Windows Kits\10\Lib\10.0.14393.0\um\x64\SetupAPI.Lib +if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PF86%\Windows Kits\8.0\Lib\win8\um\x64\SetupAPI.Lib if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error) set CMAKE_OPT=^ @@ -95,9 +75,9 @@ for %%i in ("%GRASS7_PATH%") do set GRASS7_VERSION=%%~nxi set GRASS7_VERSION=%GRASS7_VERSION:grass-=% set GRASS_VERSIONS=%GRASS7_VERSION% -set PYTHONPATH= -if exist "%PF86%\CMake\bin" path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin -if exist "%PROGRAMFILES%\CMake\bin" path %PATH%;c:\cygwin\bin;%PROGRAMFILES%\CMake\bin +set TAR=tar.exe +if exist "c:\cygwin\bin\tar.exe" set TAR=c:\cygwin64\bin\tar.exe +if exist "c:\cygwin64\bin\tar.exe" set TAR=c:\cygwin64\bin\tar.exe PROMPT qgis%VERSION%$g @@ -151,10 +131,9 @@ touch %SRCDIR%\CMakeLists.txt echo CMAKE: %DATE% %TIME% if errorlevel 1 goto error -set LIB=%LIB%;%OSGEO4W_ROOT%\apps\Qt5\lib;%OSGEO4W_ROOT%\lib -set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\apps\Qt5\include;%OSGEO4W_ROOT%\include +if "%CMAKEGEN%"=="" set CMAKEGEN=Ninja -cmake -G Ninja ^ +cmake -G "%CMAKEGEN%" ^ -D CMAKE_CXX_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^ -D CMAKE_C_COMPILER="%CMAKE_COMPILER_PATH:\=/%/cl.exe" ^ -D CMAKE_LINKER="%CMAKE_COMPILER_PATH:\=/%/link.exe" ^ @@ -167,7 +146,7 @@ cmake -G Ninja ^ -D WITH_GRASS=TRUE ^ -D WITH_3D=TRUE ^ -D WITH_GRASS7=TRUE ^ - -D GRASS_PREFIX7=%GRASS7_PATH:\=/% ^ + -D GRASS_PREFIX7=%GRASS_PREFIX:\=/% ^ -D WITH_GLOBE=FALSE ^ -D WITH_ORACLE=TRUE ^ -D WITH_CUSTOM_WIDGETS=TRUE ^ @@ -193,6 +172,8 @@ cmake -G Ninja ^ %SRCDIR:\=/% if errorlevel 1 (echo cmake failed & goto error) +if "%CONFIGONLY%"=="1" (echo Exiting after configuring build directory: %CD% & goto end) + :skipcmake if exist ..\noclean (echo skip clean & goto skipclean) echo CLEAN: %DATE% %TIME% @@ -310,7 +291,7 @@ for %%i in (%packages%) do ( if not exist %ARCH%\release\qgis\%PACKAGENAME%%%i mkdir %ARCH%\release\qgis\%PACKAGENAME%%%i ) -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-common/%PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-common/%PACKAGENAME%-common-%VERSION%-%PACKAGE%.tar.bz2 ^ --exclude-from exclude ^ --exclude "*.pyc" ^ "apps/%PACKAGENAME%/bin/qgispython.dll" ^ @@ -351,7 +332,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-common/%PACKAGENAME "etc/postinstall/%PACKAGENAME%-common.bat" if errorlevel 1 (echo tar common failed & goto error) -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-server/%PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-server/%PACKAGENAME%-server-%VERSION%-%PACKAGE%.tar.bz2 ^ --exclude-from exclude ^ --exclude "*.pyc" ^ "apps/%PACKAGENAME%/bin/qgis_mapserv.fcgi.exe" ^ @@ -387,7 +368,7 @@ move %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages\PyQt5\uic\widget-plugins\qgi if errorlevel 1 (echo move of customwidgets binding failed & goto error) if not exist %ARCH%\release\qgis\%PACKAGENAME% mkdir %ARCH%\release\qgis\%PACKAGENAME% -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERSION%-%PACKAGE%.tar.bz2 ^ --exclude-from exclude ^ --exclude "*.pyc" ^ --exclude "apps/%PACKAGENAME%/python/qgis/_server.pyd" ^ @@ -426,7 +407,7 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%/%PACKAGENAME%-%VERS "etc/preremove/%PACKAGENAME%.bat" if errorlevel 1 (echo tar desktop failed & goto error) -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-grass-plugin-common/%PACKAGENAME%-grass-plugin-common-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-grass-plugin-common/%PACKAGENAME%-grass-plugin-common-%VERSION%-%PACKAGE%.tar.bz2 ^ --exclude-from exclude ^ --exclude "*.pyc" ^ --exclude "apps/%PACKAGENAME%/grass/modules/qgis.d.rast6.exe" ^ @@ -449,7 +430,7 @@ for %%g IN (%GRASS_VERSIONS%) do ( set w=!v! if !v!==6 set w= - tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-grass-plugin!w!/%PACKAGENAME%-grass-plugin!w!-%VERSION%-%PACKAGE%.tar.bz2 ^ + %TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-grass-plugin!w!/%PACKAGENAME%-grass-plugin!w!-%VERSION%-%PACKAGE%.tar.bz2 ^ "apps/%PACKAGENAME%/bin/qgisgrass!v!.dll" ^ "apps/%PACKAGENAME%/grass/bin/qgis.g.browser!v!.exe" ^ "apps/%PACKAGENAME%/grass/modules/qgis.d.rast!v!.exe" ^ @@ -465,12 +446,12 @@ for %%g IN (%GRASS_VERSIONS%) do ( if errorlevel 1 (echo tar grass-plugin!w! failed & goto error) ) -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-oracle-provider/%PACKAGENAME%-oracle-provider-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-oracle-provider/%PACKAGENAME%-oracle-provider-%VERSION%-%PACKAGE%.tar.bz2 ^ "apps/%PACKAGENAME%/plugins/oracleprovider.dll" ^ "apps/%PACKAGENAME%/qtplugins/sqldrivers/qsqlocispatial.dll" if errorlevel 1 (echo tar oracle-provider failed & goto error) -tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-devel/%PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 ^ +%TAR% -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-devel/%PACKAGENAME%-devel-%VERSION%-%PACKAGE%.tar.bz2 ^ --exclude-from exclude ^ --exclude "*.pyc" ^ "apps/%PACKAGENAME%/FindQGIS.cmake" ^