summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortostercx <tostercx@gmail.com>2014-09-30 00:18:11 +0300
committertostercx <tostercx@gmail.com>2014-09-30 00:18:11 +0300
commit292124cc07368df7ea161bff786f1da683ada1e6 (patch)
tree0d4dd187f038c12bb537a52e910636739a9b88b8
parent344267fcf52ff9ff72673e390b8094dce28a7bc1 (diff)
downloadlibgd-292124cc07368df7ea161bff786f1da683ada1e6.tar.gz
squash everything
-rw-r--r--.gitignore9
-rw-r--r--CMakeLists.txt17
-rw-r--r--appveyor.yml353
-rw-r--r--cmake/modules/FindICONV.cmake64
-rw-r--r--src/CMakeLists.txt4
-rw-r--r--src/gd.h1
-rw-r--r--tests/bmp/CMakeLists.txt3
-rw-r--r--tests/freetype/CMakeLists.txt5
-rw-r--r--tests/gd/CMakeLists.txt3
-rw-r--r--tests/gd/gd_versiontest.c3
-rw-r--r--tests/gd2/CMakeLists.txt3
-rw-r--r--tests/gdimagearc/CMakeLists.txt3
-rw-r--r--tests/gdimagecolorclosest/CMakeLists.txt3
-rw-r--r--tests/gdimagecolordeallocate/CMakeLists.txt3
-rw-r--r--tests/gdimagecolorexact/CMakeLists.txt3
-rw-r--r--tests/gdimagecolorreplace/CMakeLists.txt3
-rw-r--r--tests/gdimagecolorresolve/CMakeLists.txt3
-rw-r--r--tests/gdimagecolortransparent/CMakeLists.txt3
-rw-r--r--tests/gdimagecopy/CMakeLists.txt3
-rw-r--r--tests/gdimagecopyrotated/CMakeLists.txt3
-rw-r--r--tests/gdimagefill/CMakeLists.txt3
-rw-r--r--tests/gdimagefilledellipse/CMakeLists.txt3
-rw-r--r--tests/gdimagefilledpolygon/CMakeLists.txt3
-rw-r--r--tests/gdimagefilledrectangle/CMakeLists.txt3
-rw-r--r--tests/gdimagefilltoborder/CMakeLists.txt3
-rw-r--r--tests/gdimageline/CMakeLists.txt3
-rw-r--r--tests/gdimageopenpolygon/CMakeLists.txt3
-rw-r--r--tests/gdimagepixelate/CMakeLists.txt3
-rw-r--r--tests/gdimagepolygon/CMakeLists.txt3
-rw-r--r--tests/gdimagerectangle/CMakeLists.txt3
-rw-r--r--tests/gdimagerotate/CMakeLists.txt3
-rw-r--r--tests/gdimagescatterex/CMakeLists.txt3
-rw-r--r--tests/gdimagesetpixel/CMakeLists.txt3
-rw-r--r--tests/gdimagestringft/CMakeLists.txt3
-rw-r--r--tests/gdimagestringftex/CMakeLists.txt3
-rw-r--r--tests/gdnewfilectx/CMakeLists.txt3
-rw-r--r--tests/gdtiled/CMakeLists.txt3
-rw-r--r--tests/gif/CMakeLists.txt3
-rw-r--r--tests/jpeg/CMakeLists.txt3
-rw-r--r--tests/png/CMakeLists.txt3
-rw-r--r--tests/tga/CMakeLists.txt3
-rw-r--r--tests/tiff/CMakeLists.txt3
-rw-r--r--tests/wbmp/CMakeLists.txt3
-rw-r--r--tests/xpm/CMakeLists.txt3
-rw-r--r--windows/Makefile.vc2
-rw-r--r--windows/run_tests.bat4
46 files changed, 463 insertions, 107 deletions
diff --git a/.gitignore b/.gitignore
index 914db25..cb0d817 100644
--- a/.gitignore
+++ b/.gitignore
@@ -52,6 +52,7 @@ Makefile.in
# Common GD artifacts.
/config/gdlib-config
/config/gdlib.pc
+/src/config.h
/src/annotate
/src/circletexttest
/src/fontconfigtest
@@ -218,6 +219,8 @@ Makefile.in
/docs/naturaldocs/html/
/docs/naturaldocs/project/Data/
-gd-win-dependencies
-build_x86
-build_x64
+gd-dotnet-bindings-generator
+build_msvc12_x86
+build_msvc12_x64
+build_mingw_x86
+build_mingw_x64
diff --git a/CMakeLists.txt b/CMakeLists.txt
index edf1960..17df17b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -13,6 +13,7 @@ OPTION(ENABLE_PNG "Enable PNG support" 0)
OPTION(ENABLE_LIQ "Enable libimagequant support" 0)
OPTION(ENABLE_JPEG "Enable JPEG support" 0)
OPTION(ENABLE_TIFF "Enable TIFF support" 0)
+OPTION(ENABLE_ICONV "Enable ICONV support" 0)
OPTION(ENABLE_XPM "Enable XPM support" 0)
OPTION(ENABLE_FREETYPE "Enable Freetype2 support" 0)
OPTION(ENABLE_FONTCONFIG "Enable FontConfig support" 0)
@@ -86,6 +87,10 @@ else (USE_EXT_GD)
if (ENABLE_PNG)
FIND_PACKAGE(PNG REQUIRED)
endif (ENABLE_PNG)
+
+ if (ENABLE_ICONV)
+ FIND_PACKAGE(ICONV REQUIRED)
+ endif (ENABLE_ICONV)
FIND_PACKAGE(ZLIB)
@@ -141,6 +146,12 @@ else (USE_EXT_GD)
INCLUDE_DIRECTORIES(${PNG_INCLUDE_DIR})
SET(HAVE_LIBPNG 1)
ENDIF(PNG_FOUND)
+
+ IF(ICONV_FOUND)
+ INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
+ SET(HAVE_ICONV 1)
+ SET(HAVE_ICONV_H 1)
+ ENDIF(ICONV_FOUND)
IF(LIQ_FOUND)
INCLUDE_DIRECTORIES(${LIQ_INCLUDE_DIR})
@@ -190,9 +201,9 @@ else (USE_EXT_GD)
if(NOT MINGW AND MSVC_VERSION GREATER 1399)
ADD_DEFINITIONS("/D_CRT_SECURE_NO_DEPRECATE")
endif(NOT MINGW AND MSVC_VERSION GREATER 1399)
- if (MINGW OR MSYS)
- ADD_DEFINITIONS("-mms-bitfields -m32")
- endif (MINGW OR MSYS)
+ #if (MINGW OR MSYS)
+ # ADD_DEFINITIONS("-mms-bitfields -m32")
+ #endif (MINGW OR MSYS)
else (WIN32)
SET(GD_LIB gd)
endif (WIN32)
diff --git a/appveyor.yml b/appveyor.yml
index ec7a2ea..82fd522 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -1,29 +1,344 @@
+shallow_clone: true
+
+
+
+environment:
+ # settings
+ with_zlib: 1 # libgd actually won't build without it..
+ with_libpng: 1 # needs zlib
+ with_libjpeg: 1 # will download nasm; removing jpeg or png will break current tests
+ with_freetype: 1 # removing breaks bindings freetype test
+ with_iconv: 1
+ with_tiff: 1 # needs zlib and jpeg
+
+
+ matrix:
+ - build_platform: "x86"
+ build_compiler: "msvc"
+
+ - build_platform: "x64"
+ build_compiler: "msvc"
+
+ - build_platform: "x86"
+ build_compiler: "mingw"
+ build_bindings: 1
+
+ - build_platform: "x64"
+ build_compiler: "mingw"
+ build_bindings: 1
+
+
+
install:
+ - ps: $nl = "`r`n"
+ - ps: $wc = New-Object 'System.Net.WebClient'
+ - ps: if($env:build_platform -eq 'x64') {$env:vc_arg = 'x86_amd64'}
+ else {$env:vc_arg = 'x86'}
+
+ # functions
+ - ps: function print-file($txt) {
+ Get-Content $txt | ForEach-Object { echo "$_" }}
+
+ - ps: function invoke($exe, $al, $output=0) {
+ echo "$nl> INVOKE $exe $al <$nl$nl";
+ if($al) {Measure-Command {$process = (start-process $exe $al -Wait -NoNewWindow -RedirectStandardOutput C:\out.txt -RedirectStandardError C:\err.txt);}}
+ else {Measure-Command {$process = (start-process $exe -Wait -NoNewWindow -RedirectStandardOutput C:\out.txt -RedirectStandardError C:\err.txt);}}
+ if($output) {
+ echo "stdout:"; print-file 'C:\out.txt';
+ echo "stderr:"; print-file 'C:\err.txt'; }
+ return $process.ExitCode; }
+
+ - ps: function Push-Ctest-Results($dir, $prefix='') {
+ $head = "<?xml version=`"1.0`" encoding=`"utf-8`"?>`n<assembly name=`"`" run-date=`"1970-01-01`" run-time=`"00:00:00`" configFile=`"`" time=`"0`" total=`"0`" passed=`"0`" failed=`"0`" skipped=`"0`" environment=`"`">`n<class time=`"0`" name=`"`" total=`"0`" passed=`"0`" failed=`"0`" skipped=`"0`">`n";
+ $foot = "</class>`n</assembly>`n";
+ $out = Select-String '(?s)\d+\/\d+ Testing.*?end time.*?[-]+' -input ((Get-Content $dir\Testing\Temporary\LastTest*.log) -join "`n") -AllMatches;
+ $xml = $head;
+ $num = 0;
+ Select-String '(\w+)\s+(\d+)\s+([\d\.]{5})' -input (Get-Content $dir\Testing\Temporary\CTestCostData.txt)-AllMatches | % {$_.Matches} | % {
+ $name = $prefix + $_.Groups[1].Value;
+ $res = @{$true="Pass";$false="Fail"}[$_.Groups[2].Value -eq 1];
+ $time = $_.Groups[3].Value;
+ $output = [Security.SecurityElement]::Escape($out.Matches[$num].Value);
+ $num++;
+ $xml += "<test name=`"$name`" type=`"`" method=`"`" result=`"$res`" time=`"$time`">`n<output>$output</output>`n</test>`n"};
+ $xml += $foot;
+ $xml > ".\xunit_tmp.xml";
+ $wc.UploadFile("https://ci.appveyor.com/api/testresults/xunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\xunit_tmp.xml)); }
+
+
# fetch deps
- - git clone https://github.com/imazen/gd-win-dependencies.git --branch september-2014 --depth 1
+ - ps: if($env:build_bindings -eq 1) { invoke 'git' 'clone https://github.com/imazen/gd-dotnet-bindings-generator.git --depth 1 --branch itanium --single-branch' }
+ - ps: if($env:with_zlib -eq 1) { invoke 'git' 'clone https://github.com/imazen/zlib.git --depth 1' }
+ - ps: if($env:with_libpng -eq 1) { invoke 'git' 'clone https://github.com/imazen/libpng.git --depth 1' }
+ - ps: if($env:with_libjpeg -eq 1) { invoke 'git' 'clone https://github.com/imazen/libjpeg-turbo.git --depth 1' }
+ - ps: if($env:with_freetype -eq 1) { invoke 'git' 'clone https://github.com/imazen/freetype.git --depth 1' }
+ - ps: if($env:with_iconv -eq 1 -and $env:build_compiler -eq 'msvc') { invoke 'git' 'clone https://github.com/imazen/libiconv.git --depth 1' }
+ - ps: if($env:with_iconv -eq 1 -and $env:build_compiler -eq 'mingw') { invoke 'git' 'clone https://github.com/imazen/libiconv.git --depth 1 --branch preconfigured-makefiles3 --single-branch' }
+ - ps: if($env:with_tiff -eq 1) { invoke 'git' 'clone https://github.com/tostercx/libtiff.git --depth 1' }
+
+ # get nasm
+ - if [%with_libjpeg%]==[1] cinst nasm
+ - ps: if($env:with_libjpeg -eq 1) { $env:path="C:\Program Files (x86)\nasm;$($env:path)" }
+
+ # get mingw-w64 (C:\mingw64)
+ - ps: if($env:build_compiler -eq 'mingw' -and $env:build_platform -eq 'x64') {
+ invoke 'curl' '-L -o mw64.7z "http://mingw.blob.core.windows.net/x86-64-491-release-posix-seh-rt-v3-rev1/mw64.7z"';
+ invoke '7z' 'x -oC:\ mw64.7z'; }
+
+
+ # get mingw-w64-32bit (C:\mingw32)
+ - ps: if($env:build_compiler -eq 'mingw' -and $env:build_platform -eq 'x86' -and $env:build_bindings -eq 1) {
+ invoke 'curl' '-L -o mw64-32.7z "http://mingw.blob.core.windows.net/i686-491-release-posix-dwarf-rt-v3-rev1/mw32.7z"';
+ invoke '7z' 'x -oC:\ mw64-32.7z'; }
+
+
+ # sh is breaking mingw builds; remove
+ - for %%i in (sh.exe) do @del "%%~$PATH:i"
-build_script:
- - "\"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall\""
- - nmake /f windows\Makefile.vc all
- - "\"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\VC\\vcvarsall\" x86_amd64"
- - nmake /f windows\Makefile.vc all
-after_build:
- - 7z a libgd-x86.zip .\build_x86\libgd.dll .\build_x86\libgd.lib .\build_x86\libgd_a.lib
- - 7z a libgd-x64.zip .\build_x64\libgd.dll .\build_x64\libgd.lib .\build_x64\libgd_a.lib
+build_script:
+
+ # set env
+
+ - '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall" %vc_arg%'
+ - if [%build_compiler%]==[mingw] if [%build_platform%]==[x86] SET PATH=C:\MinGW\bin;%PATH%
+ - if [%build_compiler%]==[mingw] if [%build_platform%]==[x64] SET PATH=C:\mingw64\bin;%PATH%
+
+
+ - if not exist deps\lib mkdir deps\lib
+ - if not exist deps\inc mkdir deps\inc
+
+
+
+ # build msvc deps
+
+ - if [%build_compiler%]==[msvc] (
+ (if [%with_zlib%]==[1] (
+ cd zlib &&
+ nmake /f win32/Makefile.msc &&
+ copy zlib_a.lib ..\deps\lib\zlib.lib &&
+ copy zconf.h ..\deps\inc\ &&
+ copy zlib.h ..\deps\inc\ &&
+ copy zutil.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_libpng%]==[1] (
+ cd libpng &&
+ nmake /f scripts/makefile.msc &&
+ copy libpng.lib ..\deps\lib\ &&
+ copy png.h ..\deps\inc\ &&
+ copy pngconf.h ..\deps\inc\ &&
+ copy pnglibconf.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_libjpeg%]==[1] (
+ cd libjpeg-turbo &&
+ (if [%build_platform%]==[x86] (cmake -G "Visual Studio 12")
+ else if [%build_platform%]==[x64] (cmake -G "Visual Studio 12 Win64")) &&
+ msbuild libjpeg-turbo.sln /p:Configuration=Release /v:m &&
+ copy release\jpeg-static.lib ..\deps\lib\libjpeg_a.lib &&
+ copy jpeglib.h ..\deps\inc\ &&
+ copy jconfig.h ..\deps\inc\ &&
+ copy jerror.h ..\deps\inc\ &&
+ copy jmorecfg.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_freetype%]==[1] (
+ cd freetype &&
+ msbuild builds\windows\vc2013\freetype.sln /p:Configuration=Release /v:m &&
+ (if [%build_platform%]==[x86] (copy objs\win32\vc2013\freetype253.lib ..\deps\lib\freetype.lib)
+ else if [%build_platform%]==[x64] (copy builds\windows\vc2013\x64\Release\freetype253.lib ..\deps\lib\freetype.lib)) &&
+ mkdir ..\deps\inc\freetype\config &&
+ copy include\*.h ..\deps\inc\freetype\ &&
+ copy include\config ..\deps\inc\freetype\config &&
+ cd ..)) &&
+ (if [%with_iconv%]==[1] (
+ cd libiconv &&
+ msbuild MSVC12\libiconv.sln /p:Configuration=Release /v:m &&
+ (if [%build_platform%]==[x86] (copy MSVC12\libiconv_static\Release\libiconv_a.lib ..\deps\lib\)
+ else if [%build_platform%]==[x64] (copy MSVC12\libiconv_static\x64\Release\libiconv_a.lib ..\deps\lib\)) &&
+ copy source\include\iconv.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_tiff%]==[1] (
+ cd libtiff &&
+ nmake /f makefile.vc &&
+ copy libtiff\libtiff.lib ..\deps\lib\ &&
+ copy libtiff\tiff.h ..\deps\inc\ &&
+ copy libtiff\tiffconf.h ..\deps\inc\ &&
+ copy libtiff\tiffio.h ..\deps\inc\ &&
+ copy libtiff\tiffvers.h ..\deps\inc\ &&
+ cd ..)))
+
+
+ # build mingw deps
+
+ - if [%build_compiler%]==[mingw] (
+ (if [%with_zlib%]==[1] (
+ cd zlib &&
+ mingw32-make -fwin32/Makefile.gcc &&
+ copy libz.a ..\deps\lib\ &&
+ copy zconf.h ..\deps\inc\ &&
+ copy zlib.h ..\deps\inc\ &&
+ copy zutil.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_libpng%]==[1] (
+ cd libpng &&
+ mingw32-make -fscripts/makefile.gcc &&
+ copy libpng.a ..\deps\lib\ &&
+ copy png.h ..\deps\inc\ &&
+ copy pngconf.h ..\deps\inc\ &&
+ copy pnglibconf.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_libjpeg%]==[1] (
+ cd libjpeg-turbo &&
+ cmake -G "MinGW Makefiles" &&
+ mingw32-make &&
+ copy libjpeg.a ..\deps\lib\ &&
+ copy jpeglib.h ..\deps\inc\ &&
+ copy jconfig.h ..\deps\inc\ &&
+ copy jerror.h ..\deps\inc\ &&
+ copy jmorecfg.h ..\deps\inc\ &&
+ cd ..)) &&
+ (if [%with_freetype%]==[1] (
+ cd freetype &&
+ mingw32-make &&
+ mingw32-make &&
+ copy objs\freetype.a ..\deps\lib\ &&
+ mkdir ..\deps\inc\freetype\config &&
+ copy include\*.h ..\deps\inc\freetype\ &&
+ copy include\config ..\deps\inc\freetype\config &&
+ cd ..)) &&
+ (if [%with_iconv%]==[1] (
+ cd libiconv\source &&
+ c:\mingw\msys\1.0\bin\bash -c "PATH=/c/mingw/msys/1.0/bin:$PATH; make" &&
+ copy lib\.libs\libiconv.a ..\..\deps\lib\ &&
+ copy include\iconv.h ..\..\deps\inc\ &&
+ cd ..\..)) &&
+ (if [%with_tiff%]==[1] (
+ cd libtiff\libtiff &&
+ mingw32-make -fmakefile.mingw &&
+ cd .. &&
+ copy libtiff\libtiff.a ..\deps\lib\ &&
+ copy libtiff\tiff.h ..\deps\inc\ &&
+ copy libtiff\tiffconf.h ..\deps\inc\ &&
+ copy libtiff\tiffio.h ..\deps\inc\ &&
+ copy libtiff\tiffvers.h ..\deps\inc\ &&
+ cd ..)))
+
+
+
+
+ # build msvc x86
+
+ - if [%build_compiler%]==[msvc] if [%build_platform%]==[x86] (
+ mkdir build_msvc12_x86 &&
+ cd build_msvc12_x86 &&
+ cmake -G "Visual Studio 12" -DCMAKE_C_FLAGS=/Qvec-report:1 -DCMAKE_CXX_FLAGS=/Qvec-report:1 -DCMAKE_LIBRARY_PATH=deps\lib -DCMAKE_INCLUDE_PATH=deps\inc;deps\inc\freetype -DBUILD_TEST=1 -DENABLE_PNG=%with_libpng% -DENABLE_JPEG=%with_libjpeg% -DENABLE_FREETYPE=%with_freetype% -DENABLE_ICONV=%with_iconv% -DENABLE_TIFF=%with_tiff% -Wno-dev .. &&
+ msbuild gd.sln /p:Configuration=Release /v:m &&
+ cd .. )
+
+ - ps: if($env:build_compiler -eq 'msvc' -and $env:build_platform -eq 'x86') {
+ invoke '7z' 'a libgd-msvc12-x86.zip .\build_msvc12_x86\Bin\Release\libgd.dll .\build_msvc12_x86\Bin\Release\libgd.lib .\build_msvc12_x86\Bin\Release\libgd-static.lib';
+ Push-AppveyorArtifact libgd-msvc12-x86.zip; }
+
+
+
+ # build msvc x64
+
+ - if [%build_compiler%]==[msvc] if [%build_platform%]==[x64] (
+ mkdir build_msvc12_x64 &&
+ cd build_msvc12_x64 &&
+ cmake -G "Visual Studio 12 Win64" -DCMAKE_C_FLAGS=/Qvec-report:1 -DCMAKE_CXX_FLAGS=/Qvec-report:1 -DCMAKE_LIBRARY_PATH=deps\lib -DCMAKE_INCLUDE_PATH=deps\inc;deps\inc\freetype -DBUILD_TEST=1 -DENABLE_PNG=%with_libpng% -DENABLE_JPEG=%with_libjpeg% -DENABLE_FREETYPE=%with_freetype% -DENABLE_ICONV=%with_iconv% -DENABLE_TIFF=%with_tiff% -Wno-dev .. &&
+ msbuild gd.sln /p:Configuration=Release /v:m &&
+ cd ..)
+
+ - ps: if($env:build_compiler -eq 'msvc' -and $env:build_platform -eq 'x64') {
+ invoke '7z' 'a libgd-msvc12-x64.zip .\build_msvc12_x64\Bin\Release\libgd.dll .\build_msvc12_x64\Bin\Release\libgd.lib .\build_msvc12_x64\Bin\Release\libgd-static.lib';
+ Push-AppveyorArtifact libgd-msvc12-x64.zip; }
+
+
+
+ # build mingw x86
+
+ - if [%build_compiler%]==[mingw] if [%build_platform%]==[x86] (
+ mkdir build_mingw_x86 &&
+ cd build_mingw_x86 &&
+ cmake -G "MinGW Makefiles" -DCMAKE_LIBRARY_PATH=deps\lib -DCMAKE_INCLUDE_PATH=deps\inc;deps\inc\freetype -DBUILD_TEST=1 -DENABLE_PNG=%with_libpng% -DENABLE_JPEG=%with_libjpeg% -DENABLE_FREETYPE=%with_freetype% -DENABLE_ICONV=%with_iconv% -DENABLE_TIFF=%with_tiff% -Wno-dev .. &&
+ mingw32-make &&
+ cd ..)
+
+ - ps: if($env:build_compiler -eq 'mingw' -and $env:build_platform -eq 'x86') {
+ invoke '7z' 'a libgd-mingw-x86.zip .\build_mingw_x86\Bin\liblibgd.dll .\build_mingw_x86\Bin\liblibgd.dll.a .\build_mingw_x86\Bin\liblibgd-static.a';
+ Push-AppveyorArtifact libgd-mingw-x86.zip; }
+
+
+
+ # build mingw x64
+
+ - if [%build_compiler%]==[mingw] if [%build_platform%]==[x64] (
+ mkdir build_mingw_x64 &&
+ cd build_mingw_x64 &&
+ cmake -G "MinGW Makefiles" -DCMAKE_C_FLAGS=-m64 -DCMAKE_CXX_FLAGS=-m64 -DCMAKE_LIBRARY_PATH=deps\lib -DCMAKE_INCLUDE_PATH=deps\inc;deps\inc\freetype -DBUILD_TEST=1 -DENABLE_PNG=%with_libpng% -DENABLE_JPEG=%with_libjpeg% -DENABLE_FREETYPE=%with_freetype% -DENABLE_ICONV=%with_iconv% -DENABLE_TIFF=%with_tiff% -Wno-dev .. &&
+ mingw32-make &&
+ cd ..)
+
+ - ps: if($env:build_compiler -eq 'mingw' -and $env:build_platform -eq 'x64') {
+ invoke '7z' 'a libgd-mingw-x64.zip .\build_mingw_x64\Bin\liblibgd.dll .\build_mingw_x64\Bin\liblibgd.dll.a .\build_mingw_x64\Bin\liblibgd-static.a';
+ Push-AppveyorArtifact libgd-mingw-x64.zip; }
+
+
+
+ # build bindings
+
+ - '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall"'
+ - if [%build_bindings%]==[1] if [%build_compiler%]==[mingw] (
+ cd gd-dotnet-bindings-generator &&
+ msbuild LibGD.CLI\LibGD.CLI.csproj /p:Configuration=Debug /p:Platform=AnyCPU /v:m &&
+ copy ..\build_mingw_%build_platform%\Bin\liblibgd.dll LibGD.CLI\bin\Debug\liblibgd.dll &&
+ cd LibGD.CLI\bin\Debug &&
+ (if [%build_platform%]==[x86] (LibGD.CLI.exe %APPVEYOR_BUILD_FOLDER%\src C:\mingw32\bin\mingw32-make.exe liblibgd.dll)
+ else if [%build_platform%]==[x64] (LibGD.CLI.exe %APPVEYOR_BUILD_FOLDER%\src C:\mingw64\bin\mingw32-make.exe liblibgd.dll)) &&
+ appveyor PushArtifact LibGD.cs &&
+ cd ..\..\.. &&
+ msbuild LibGD.Tests\LibGD.Tests.csproj /p:Configuration=Debug /p:Platform=AnyCPU /v:m &&
+ cd..)
+
+ - ps: if($env:build_bindings -eq 1 -and $env:build_compiler -eq 'mingw') {
+ invoke '7z' "a LibGDSharp-$($env:build_platform).zip .\gd-dotnet-bindings-generator\LibGD.CLI\bin\Debug\liblibgd.dll .\gd-dotnet-bindings-generator\LibGD.CLI\bin\Debug\LibGDSharp.dll";
+ Push-AppveyorArtifact "LibGDSharp-$($env:build_platform).zip"; }
-test_script:
- - set PLATFORM=x86
- - windows\run_tests
- - set PLATFORM=x64
- - windows\run_tests
-artifacts:
- - path: libgd-x86.zip
- name: libgd-x86.zip
- - path: libgd-x64.zip
- name: libgd-x64.zip \ No newline at end of file
+test_script:
+ - if [%build_compiler%]==[msvc] if [%build_platform%]==[x86] (
+ cd build_msvc12_x86 &&
+ ctest -C Release &&
+ cd ..)
+ - ps: if($env:build_compiler -eq 'msvc' -and $env:build_platform -eq 'x86') { Push-Ctest-Results 'build_msvc12_x86' 'libgd (msvc x86) '; Push-AppveyorArtifact build_msvc12_x86\Testing\Temporary\LastTest*.log }
+
+
+ - if [%build_compiler%]==[msvc] if [%build_platform%]==[x64] (
+ cd build_msvc12_x64 &&
+ ctest -C Release &&
+ cd ..)
+ - ps: if($env:build_compiler -eq 'msvc' -and $env:build_platform -eq 'x64') { Push-Ctest-Results 'build_msvc12_x64' 'libgd (msvc x64) '; Push-AppveyorArtifact build_msvc12_x64\Testing\Temporary\LastTest*.log }
+
+
+ - if [%build_compiler%]==[mingw] if [%build_platform%]==[x86] (
+ cd build_mingw_x86 &&
+ ctest -C Release &&
+ cd ..)
+ - ps: if($env:build_compiler -eq 'mingw' -and $env:build_platform -eq 'x86') { Push-Ctest-Results 'build_mingw_x86' 'libgd (mingw x86) '; Push-AppveyorArtifact build_mingw_x86\Testing\Temporary\LastTest*.log }
+
+
+ - if [%build_compiler%]==[mingw] if [%build_platform%]==[x64] (
+ cd build_mingw_x64 &&
+ ctest -C Release &&
+ cd ..)
+ - ps: if($env:build_compiler -eq 'mingw' -and $env:build_platform -eq 'x64') { Push-Ctest-Results 'build_mingw_x64' 'libgd (mingw x64) '; Push-AppveyorArtifact build_mingw_x64\Testing\Temporary\LastTest*.log }
+
+
+ - if [%build_bindings%]==[1] if [%build_compiler%]==[mingw] (
+ copy gd-dotnet-bindings-generator\LibGD.CLI\bin\Debug\liblibgd.dll gd-dotnet-bindings-generator\LibGD.Tests\bin\Debug\liblibgd.dll &&
+ if [%build_platform%]==[x86] (nunit-console-x86 gd-dotnet-bindings-generator\LibGD.Tests\bin\Debug\LibGD.Tests.dll)
+ else if [%build_platform%]==[x64] (nunit-console gd-dotnet-bindings-generator\LibGD.Tests\bin\Debug\LibGD.Tests.dll)) \ No newline at end of file
diff --git a/cmake/modules/FindICONV.cmake b/cmake/modules/FindICONV.cmake
new file mode 100644
index 0000000..49d5f6b
--- /dev/null
+++ b/cmake/modules/FindICONV.cmake
@@ -0,0 +1,64 @@
+# - Try to find Iconv
+# Once done this will define
+#
+# ICONV_FOUND - system has Iconv
+# ICONV_INCLUDE_DIR - the Iconv include directory
+# ICONV_LIBRARIES - Link these to use Iconv
+# ICONV_SECOND_ARGUMENT_IS_CONST - the second argument for iconv() is const
+#
+include(CheckCCompilerFlag)
+include(CheckCSourceCompiles)
+
+IF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+ # Already in cache, be silent
+ SET(ICONV_FIND_QUIETLY TRUE)
+ENDIF (ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+
+FIND_PATH(ICONV_INCLUDE_DIR iconv.h HINTS /sw/include/ PATHS /opt/local)
+
+FIND_LIBRARY(ICONV_LIBRARIES NAMES libiconv_a iconv libiconv c PATHS /opt/local)
+
+IF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+ SET(ICONV_FOUND TRUE)
+ENDIF(ICONV_INCLUDE_DIR AND ICONV_LIBRARIES)
+
+set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
+set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
+IF(ICONV_FOUND)
+ check_c_compiler_flag("-Werror" ICONV_HAVE_WERROR)
+ set (CMAKE_C_FLAGS_BACKUP "${CMAKE_C_FLAGS}")
+ if(ICONV_HAVE_WERROR)
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")
+ endif(ICONV_HAVE_WERROR)
+ check_c_source_compiles("
+ #include <iconv.h>
+ int main(){
+ iconv_t conv = 0;
+ const char* in = 0;
+ size_t ilen = 0;
+ char* out = 0;
+ size_t olen = 0;
+ iconv(conv, &in, &ilen, &out, &olen);
+ return 0;
+ }
+" ICONV_SECOND_ARGUMENT_IS_CONST )
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS_BACKUP}")
+ENDIF(ICONV_FOUND)
+set(CMAKE_REQUIRED_INCLUDES)
+set(CMAKE_REQUIRED_LIBRARIES)
+
+IF(ICONV_FOUND)
+ IF(NOT ICONV_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Iconv: ${ICONV_LIBRARIES}")
+ ENDIF(NOT ICONV_FIND_QUIETLY)
+ELSE(ICONV_FOUND)
+ IF(Iconv_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Iconv")
+ ENDIF(Iconv_FIND_REQUIRED)
+ENDIF(ICONV_FOUND)
+
+MARK_AS_ADVANCED(
+ ICONV_INCLUDE_DIR
+ ICONV_LIBRARIES
+ ICONV_SECOND_ARGUMENT_IS_CONST
+) \ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 5e0dd04..1b2112f 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -81,8 +81,8 @@ endif (MINGW OR MSYS)
INCLUDE_DIRECTORIES(BEFORE "${PROJECT_BINARY_DIR}" "${CMAKE_BINARY_DIR}" "${GD_SOURCE_DIR}/src")
-target_link_libraries(${GD_LIB} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES})
-target_link_libraries(${GD_LIB_STATIC} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES} )
+target_link_libraries(${GD_LIB} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${ICONV_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES})
+target_link_libraries(${GD_LIB_STATIC} ${ZLIB_LIBRARIES} ${FREETYPE_LIBRARIES} ${PNG_LIBRARIES} ${ICONV_LIBRARIES} ${LIQ_LIBRARIES} ${JPEG_LIBRARIES} ${TIFF_LIBRARIES} ${XPM_LIBRARIES} ${FONTCONFIG_LIBRARY} ${VPX_LIBRARIES} )
set(GD_PROGRAMS annotate gdparttopng gdtopng gd2copypal gd2topng pngtogd pngtogd2 webpng gd2togif gdcmpgif giftogd2)
foreach(program ${GD_PROGRAMS})
diff --git a/src/gd.h b/src/gd.h
index f26e270..5fcbd97 100644
--- a/src/gd.h
+++ b/src/gd.h
@@ -78,6 +78,7 @@ extern "C" {
#define BGD_DECLARE(rt) BGD_EXPORT_DATA_PROT rt BGD_STDCALL
#ifdef _MSC_VER
+# define _ALLOW_KEYWORD_MACROS
# define inline __inline
# define strcasecmp _stricmp
#endif
diff --git a/tests/bmp/CMakeLists.txt b/tests/bmp/CMakeLists.txt
index 3e456f7..751c303 100644
--- a/tests/bmp/CMakeLists.txt
+++ b/tests/bmp/CMakeLists.txt
@@ -7,6 +7,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest ${GD_LIB})
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/freetype/CMakeLists.txt b/tests/freetype/CMakeLists.txt
index dbc580e..201d19a 100644
--- a/tests/freetype/CMakeLists.txt
+++ b/tests/freetype/CMakeLists.txt
@@ -1,10 +1,9 @@
SET(TESTS_FILES
- bug00132
+# bug00132
)
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gd/CMakeLists.txt b/tests/gd/CMakeLists.txt
index ccda060..c532717 100644
--- a/tests/gd/CMakeLists.txt
+++ b/tests/gd/CMakeLists.txt
@@ -9,6 +9,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gd/gd_versiontest.c b/tests/gd/gd_versiontest.c
index 3cb5d7b..7ed201d 100644
--- a/tests/gd/gd_versiontest.c
+++ b/tests/gd/gd_versiontest.c
@@ -3,7 +3,6 @@
#include "gd.h"
#include "gdtest.h"
-
int main()
{
char buffer[100];
@@ -13,7 +12,7 @@ int main()
gdTestAssert(GD_RELEASE_VERSION == gdReleaseVersion());
gdTestAssert(strcmp(GD_EXTRA_VERSION, gdExtraVersion()) == 0);
- snprintf(buffer, sizeof(buffer), "%d.%d.%d%s", GD_MAJOR_VERSION, GD_MINOR_VERSION,
+ sprintf(buffer, "%d.%d.%d%s", GD_MAJOR_VERSION, GD_MINOR_VERSION,
GD_RELEASE_VERSION, GD_EXTRA_VERSION);
gdTestAssert(strcmp(GD_VERSION_STRING, gdVersionString()) == 0);
diff --git a/tests/gd2/CMakeLists.txt b/tests/gd2/CMakeLists.txt
index c9bd5e5..68a064c 100644
--- a/tests/gd2/CMakeLists.txt
+++ b/tests/gd2/CMakeLists.txt
@@ -9,6 +9,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagearc/CMakeLists.txt b/tests/gdimagearc/CMakeLists.txt
index 82cc9b8..4725dae 100644
--- a/tests/gdimagearc/CMakeLists.txt
+++ b/tests/gdimagearc/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecolorclosest/CMakeLists.txt b/tests/gdimagecolorclosest/CMakeLists.txt
index 1b2f83e..30a47c0 100644
--- a/tests/gdimagecolorclosest/CMakeLists.txt
+++ b/tests/gdimagecolorclosest/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecolordeallocate/CMakeLists.txt b/tests/gdimagecolordeallocate/CMakeLists.txt
index 996bd24..7958cd6 100644
--- a/tests/gdimagecolordeallocate/CMakeLists.txt
+++ b/tests/gdimagecolordeallocate/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecolorexact/CMakeLists.txt b/tests/gdimagecolorexact/CMakeLists.txt
index a724d13..f62bc26 100644
--- a/tests/gdimagecolorexact/CMakeLists.txt
+++ b/tests/gdimagecolorexact/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecolorreplace/CMakeLists.txt b/tests/gdimagecolorreplace/CMakeLists.txt
index f88a8a0..915d9d4 100644
--- a/tests/gdimagecolorreplace/CMakeLists.txt
+++ b/tests/gdimagecolorreplace/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecolorresolve/CMakeLists.txt b/tests/gdimagecolorresolve/CMakeLists.txt
index 2ab9444..4b91825 100644
--- a/tests/gdimagecolorresolve/CMakeLists.txt
+++ b/tests/gdimagecolorresolve/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecolortransparent/CMakeLists.txt b/tests/gdimagecolortransparent/CMakeLists.txt
index 9e6c82f..5f580f7 100644
--- a/tests/gdimagecolortransparent/CMakeLists.txt
+++ b/tests/gdimagecolortransparent/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecopy/CMakeLists.txt b/tests/gdimagecopy/CMakeLists.txt
index 209257a..0b0ccdd 100644
--- a/tests/gdimagecopy/CMakeLists.txt
+++ b/tests/gdimagecopy/CMakeLists.txt
@@ -6,6 +6,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagecopyrotated/CMakeLists.txt b/tests/gdimagecopyrotated/CMakeLists.txt
index 4a0e083..7f75aa7 100644
--- a/tests/gdimagecopyrotated/CMakeLists.txt
+++ b/tests/gdimagecopyrotated/CMakeLists.txt
@@ -6,6 +6,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagefill/CMakeLists.txt b/tests/gdimagefill/CMakeLists.txt
index c0fe799..ef85f1c 100644
--- a/tests/gdimagefill/CMakeLists.txt
+++ b/tests/gdimagefill/CMakeLists.txt
@@ -8,6 +8,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagefilledellipse/CMakeLists.txt b/tests/gdimagefilledellipse/CMakeLists.txt
index 8d047e7..fb1ed6c 100644
--- a/tests/gdimagefilledellipse/CMakeLists.txt
+++ b/tests/gdimagefilledellipse/CMakeLists.txt
@@ -7,6 +7,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagefilledpolygon/CMakeLists.txt b/tests/gdimagefilledpolygon/CMakeLists.txt
index be8ab7c..2ca4bf5 100644
--- a/tests/gdimagefilledpolygon/CMakeLists.txt
+++ b/tests/gdimagefilledpolygon/CMakeLists.txt
@@ -9,6 +9,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagefilledrectangle/CMakeLists.txt b/tests/gdimagefilledrectangle/CMakeLists.txt
index 9a82b99..7392070 100644
--- a/tests/gdimagefilledrectangle/CMakeLists.txt
+++ b/tests/gdimagefilledrectangle/CMakeLists.txt
@@ -7,6 +7,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagefilltoborder/CMakeLists.txt b/tests/gdimagefilltoborder/CMakeLists.txt
index 966bff0..e24a69a 100644
--- a/tests/gdimagefilltoborder/CMakeLists.txt
+++ b/tests/gdimagefilltoborder/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimageline/CMakeLists.txt b/tests/gdimageline/CMakeLists.txt
index fb3212e..78f11d4 100644
--- a/tests/gdimageline/CMakeLists.txt
+++ b/tests/gdimageline/CMakeLists.txt
@@ -9,6 +9,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimageopenpolygon/CMakeLists.txt b/tests/gdimageopenpolygon/CMakeLists.txt
index 09a2267..4e54fff 100644
--- a/tests/gdimageopenpolygon/CMakeLists.txt
+++ b/tests/gdimageopenpolygon/CMakeLists.txt
@@ -8,6 +8,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagepixelate/CMakeLists.txt b/tests/gdimagepixelate/CMakeLists.txt
index 1f11825..2d10b21 100644
--- a/tests/gdimagepixelate/CMakeLists.txt
+++ b/tests/gdimagepixelate/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagepolygon/CMakeLists.txt b/tests/gdimagepolygon/CMakeLists.txt
index 92802ec..679e939 100644
--- a/tests/gdimagepolygon/CMakeLists.txt
+++ b/tests/gdimagepolygon/CMakeLists.txt
@@ -8,6 +8,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagerectangle/CMakeLists.txt b/tests/gdimagerectangle/CMakeLists.txt
index 223b381..2c73ef9 100644
--- a/tests/gdimagerectangle/CMakeLists.txt
+++ b/tests/gdimagerectangle/CMakeLists.txt
@@ -6,6 +6,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagerotate/CMakeLists.txt b/tests/gdimagerotate/CMakeLists.txt
index 6aa98d2..3dde7a5 100644
--- a/tests/gdimagerotate/CMakeLists.txt
+++ b/tests/gdimagerotate/CMakeLists.txt
@@ -6,6 +6,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagescatterex/CMakeLists.txt b/tests/gdimagescatterex/CMakeLists.txt
index 3e51d34..13de90a 100644
--- a/tests/gdimagescatterex/CMakeLists.txt
+++ b/tests/gdimagescatterex/CMakeLists.txt
@@ -6,6 +6,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagesetpixel/CMakeLists.txt b/tests/gdimagesetpixel/CMakeLists.txt
index 907616d..1fb1f38 100644
--- a/tests/gdimagesetpixel/CMakeLists.txt
+++ b/tests/gdimagesetpixel/CMakeLists.txt
@@ -7,6 +7,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagestringft/CMakeLists.txt b/tests/gdimagestringft/CMakeLists.txt
index 7ff29cb..c3338c0 100644
--- a/tests/gdimagestringft/CMakeLists.txt
+++ b/tests/gdimagestringft/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdimagestringftex/CMakeLists.txt b/tests/gdimagestringftex/CMakeLists.txt
index 7252bd2..5d26668 100644
--- a/tests/gdimagestringftex/CMakeLists.txt
+++ b/tests/gdimagestringftex/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdnewfilectx/CMakeLists.txt b/tests/gdnewfilectx/CMakeLists.txt
index 75de828..9fd4caf 100644
--- a/tests/gdnewfilectx/CMakeLists.txt
+++ b/tests/gdnewfilectx/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gdtiled/CMakeLists.txt b/tests/gdtiled/CMakeLists.txt
index 90e15da..cc47150 100644
--- a/tests/gdtiled/CMakeLists.txt
+++ b/tests/gdtiled/CMakeLists.txt
@@ -5,6 +5,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/gif/CMakeLists.txt b/tests/gif/CMakeLists.txt
index a155559..a64f785 100644
--- a/tests/gif/CMakeLists.txt
+++ b/tests/gif/CMakeLists.txt
@@ -14,6 +14,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/jpeg/CMakeLists.txt b/tests/jpeg/CMakeLists.txt
index d68028b..9151f60 100644
--- a/tests/jpeg/CMakeLists.txt
+++ b/tests/jpeg/CMakeLists.txt
@@ -10,6 +10,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/png/CMakeLists.txt b/tests/png/CMakeLists.txt
index dd0b4c4..128b51d 100644
--- a/tests/png/CMakeLists.txt
+++ b/tests/png/CMakeLists.txt
@@ -13,6 +13,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/tga/CMakeLists.txt b/tests/tga/CMakeLists.txt
index a88872a..48f9412 100644
--- a/tests/tga/CMakeLists.txt
+++ b/tests/tga/CMakeLists.txt
@@ -6,6 +6,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/tiff/CMakeLists.txt b/tests/tiff/CMakeLists.txt
index aefdaf7..da49800 100644
--- a/tests/tiff/CMakeLists.txt
+++ b/tests/tiff/CMakeLists.txt
@@ -7,6 +7,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/wbmp/CMakeLists.txt b/tests/wbmp/CMakeLists.txt
index aac4f69..531933a 100644
--- a/tests/wbmp/CMakeLists.txt
+++ b/tests/wbmp/CMakeLists.txt
@@ -7,6 +7,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/tests/xpm/CMakeLists.txt b/tests/xpm/CMakeLists.txt
index f90d3c6..e0a789c 100644
--- a/tests/xpm/CMakeLists.txt
+++ b/tests/xpm/CMakeLists.txt
@@ -8,6 +8,5 @@ SET(TESTS_FILES
FOREACH(test_name ${TESTS_FILES})
add_executable(${test_name} "${test_name}.c")
target_link_libraries (${test_name} gdTest)
- get_target_property(test_path ${test_name} LOCATION)
- ADD_TEST(${test_name} ${test_path})
+ add_test(NAME ${test_name} COMMAND ${test_name})
ENDFOREACH(test_name)
diff --git a/windows/Makefile.vc b/windows/Makefile.vc
index 39849f0..f17c50d 100644
--- a/windows/Makefile.vc
+++ b/windows/Makefile.vc
@@ -18,7 +18,7 @@ PLATFORM=x64
PLATFORM=$(PLATFORM:X=x)
-BUILD_DIR=build_$(PLATFORM)
+BUILD_DIR=build_msvc12_$(PLATFORM)
GD_DLL=libgd.dll
GD_LIB=libgd_a.lib
diff --git a/windows/run_tests.bat b/windows/run_tests.bat
index ee3d788..5dadb05 100644
--- a/windows/run_tests.bat
+++ b/windows/run_tests.bat
@@ -4,8 +4,8 @@ if [%PLATFORM%]==[] set PLATFORM=x86
if [%PREFERREDTOOLARCHITECTURE%]==[x64] set PLATFORM=x64
set PLATFORM=%PLATFORM:X=x%
-if exist build_%PLATFORM%\tests (cd build_%PLATFORM%\tests) else (
- if exist ..\build_%PLATFORM%\tests (cd ..\build_%PLATFORM%\tests) else (
+if exist build_msvc12_%PLATFORM%\tests (cd build_msvc12_%PLATFORM%\tests) else (
+ if exist ..\build_%PLATFORM%\tests (cd ..\build_msvc12_%PLATFORM%\tests) else (
echo unable to find test dir
exit /b 1
)