aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Evers <kristianevers@gmail.com>2020-04-18 10:49:33 +0200
committerGitHub <noreply@github.com>2020-04-18 10:49:33 +0200
commitbc79cfbfe1bc56a60b72042f498c95d46420c692 (patch)
tree47497d646cb539f8baa90f312fa3af94ad8a8e60
parenta551cab9661f58ea1a8271521dd1d65e2bf7a6a8 (diff)
parent098cd6bb88b814850dcad2f29304c161047c9f05 (diff)
downloadPROJ-bc79cfbfe1bc56a60b72042f498c95d46420c692.tar.gz
PROJ-bc79cfbfe1bc56a60b72042f498c95d46420c692.zip
Merge pull request #2163 from kbevers/backport-appveyor-speedup
[backport 7.0] AppVeyor: use Ninja generator, cache vcpkg installed packages
-rw-r--r--appveyor.yml41
-rwxr-xr-xtest/postinstall/test_cmake.bat44
2 files changed, 68 insertions, 17 deletions
diff --git a/appveyor.yml b/appveyor.yml
index 52c2c18a..62c5591f 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -7,39 +7,46 @@ environment:
# VS 2015
- platform: x86
- VS_VERSION: Visual Studio 14
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015
BUILD_SHARED_LIBS: OFF
# VS 2017
- platform: x64
- VS_VERSION: Visual Studio 15
APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
BUILD_SHARED_LIBS: ON
shallow_clone: true
+cache:
+ - C:\Tools\vcpkg\installed\ -> appveyor.yml
+
build_script:
- - echo build_script
- - git clone https://github.com/microsoft/vcpkg
- - cd vcpkg
- - bootstrap-vcpkg.bat
- - set PATH=%CD%;%PATH%
- - cd ..
- - vcpkg install sqlite3[core,tool]:"%platform%"-windows
- - vcpkg install tiff:"%platform%"-windows
- - vcpkg install curl:"%platform%"-windows
- - if "%platform%" == "x64" SET VS_FULL=%VS_VERSION% Win64
- - if "%platform%" == "x86" SET VS_FULL=%VS_VERSION%
- - echo "%VS_FULL%"
+ - set VCPKG_INSTALLED=C:\Tools\vcpkg\installed\%platform%-windows
+ # If cached directory does not exist, update vcpkg and install dependencies
+ - if not exist %VCPKG_INSTALLED%\bin (
+ cd "C:\Tools\vcpkg" &
+ git pull > nul &
+ .\bootstrap-vcpkg.bat -disableMetrics &
+ vcpkg install sqlite3[core,tool]:"%platform%"-windows &
+ vcpkg install tiff:"%platform%"-windows &
+ vcpkg install curl:"%platform%"-windows &
+ cd %APPVEYOR_BUILD_FOLDER%
+ )
+ - dir %VCPKG_INSTALLED%\bin
+ - set PATH=%VCPKG_INSTALLED%\bin;%PATH%
+ # See https://www.appveyor.com/docs/lang/cpp/
+ - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2015" if %platform%==x86
+ (call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86)
+ - if "%APPVEYOR_BUILD_WORKER_IMAGE%"=="Visual Studio 2017"
+ (call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" %platform% )
#
- set PROJ_BUILD=%APPVEYOR_BUILD_FOLDER%\build
- mkdir %PROJ_BUILD%
- cd %PROJ_BUILD%
- set PROJ_DIR=%APPVEYOR_BUILD_FOLDER%\proj_dir
- - cmake -G "%VS_FULL%" .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="%BUILD_SHARED_LIBS%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=C:/projects/proj/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
- - cmake --build . --config Release --target install
- - copy c:\projects\proj\vcpkg\installed\"%platform%"-windows\bin\*.dll %PROJ_DIR%\bin
+ - cmake -GNinja .. -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS="%BUILD_SHARED_LIBS%" -DCMAKE_C_FLAGS="/WX" -DCMAKE_CXX_FLAGS="/WX" -DCMAKE_TOOLCHAIN_FILE=c:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_INSTALL_PREFIX="%PROJ_DIR%"
+ - ninja -v
+ - ninja install
- dir %PROJ_DIR%\bin
test_script:
diff --git a/test/postinstall/test_cmake.bat b/test/postinstall/test_cmake.bat
new file mode 100755
index 00000000..8eba4e78
--- /dev/null
+++ b/test/postinstall/test_cmake.bat
@@ -0,0 +1,44 @@
+@echo off
+:: Post-install tests with CMake
+::
+:: First required argument is the installed prefix, which
+:: is used to set CMAKE_PREFIX_PATH
+
+echo Running post-install tests with CMake
+
+set CMAKE_PREFIX_PATH=%1
+if not defined CMAKE_PREFIX_PATH (
+ echo First positional argument CMAKE_PREFIX_PATH required
+ exit /B 1
+)
+
+echo CMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH%
+
+cd %~dp0
+
+cd testappprojinfo
+del /f /q build 2> nul
+
+:: Check CMake project name PROJ
+md build
+cd build
+cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
+ -DCMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH% ^
+ -DUSE_PROJ_NAME=PROJ .. || exit /B 2
+ninja -v || exit /B 3
+ctest -VV || exit /B 4
+cd ..
+del /f /q build
+
+:: Check legacy CMake project name PROJ4
+md build
+cd build
+cmake -GNinja -DCMAKE_BUILD_TYPE=Release ^
+ -DCMAKE_PREFIX_PATH=%CMAKE_PREFIX_PATH% ^
+ -DUSE_PROJ_NAME=PROJ4 .. || exit /B 2
+ninja -v || exit /B 3
+ctest -VV || exit /B 4
+cd ..
+del /f /q build
+
+cd ..