updates and fixes for windows qt5/py3 build

This commit is contained in:
Juergen E. Fischer 2017-01-15 01:21:02 +01:00
parent ea116fd893
commit 6a56cb0dd0
94 changed files with 454 additions and 637 deletions

View File

@ -569,15 +569,16 @@ IF(COMMAND cmake_policy)
IF(NOT "${CMAKE_VERSION}" VERSION_LESS "3.3")
cmake_policy(SET CMP0063 NEW)
ENDIF(NOT "${CMAKE_VERSION}" VERSION_LESS "3.3")
IF(MSVC)
cmake_policy(SET CMP0020 NEW)
ENDIF(MSVC)
ENDIF(COMMAND cmake_policy)
IF (WIN32)
IF(PEDANTIC AND NOT APPLE)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
ENDIF(PEDANTIC AND NOT APPLE)
ENDIF(WIN32)
IF (PEDANTIC AND NOT WIN32 AND NOT APPLE)
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--no-undefined")
SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,--no-undefined")
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--no-undefined")
ENDIF(PEDANTIC AND NOT WIN32 AND NOT APPLE)
SET(CMAKE_CXX_VISIBILITY_PRESET hidden)
INCLUDE(GenerateExportHeader)

View File

@ -41,7 +41,7 @@ FIND_PATH(PROJ_INCLUDE_DIR proj_api.h
"$ENV{LIB_DIR}/include"
)
FIND_LIBRARY(PROJ_LIBRARY NAMES proj proj_i PATHS
FIND_LIBRARY(PROJ_LIBRARY NAMES proj_i proj PATHS
"$ENV{LIB}"
"$ENV{LIB_DIR}/lib"
)

View File

@ -97,12 +97,6 @@ MACRO(GENERATE_SIP_PYTHON_MODULE_CODE MODULE_NAME MODULE_SIP CPP_FILES)
ENDIF(MSVC)
SET(SIPCMD ${SIP_BINARY_PATH} ${_sip_tags} -w -e ${_sip_x} ${SIP_EXTRA_OPTIONS} -j ${SIP_CONCAT_PARTS} -c ${CMAKE_CURRENT_BINARY_DIR}/${_module_path} ${_sip_includes} ${_abs_module_sip})
SET(SUPPRESS_SIP_WARNINGS FALSE CACHE BOOL "Hide SIP warnings")
MARK_AS_ADVANCED(SUPPRESS_SIP_WARNINGS)
IF(SUPPRESS_SIP_WARNINGS)
SET(SIPCMD ${SIPCMD} 2> /dev/null || true)
ENDIF(SUPPRESS_SIP_WARNINGS)
ADD_CUSTOM_COMMAND(
OUTPUT ${_sip_output_files}
COMMAND ${CMAKE_COMMAND} -E echo ${message}

View File

@ -1,8 +1,10 @@
@echo off
call "%~dp0\o4w_env.bat"
call "%OSGEO4W_ROOT%"\apps\grass\grass-@grassversion@\etc\env.bat
call "%~dp0\qt5_env.bat"
call "%~dp0\py3_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\@package@\bin;%OSGEO4W_ROOT%\apps\grass\grass-@grassversion@\lib;%OSGEO4W_ROOT%\apps\grass\grass-@grassversion@\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
start "QGIS Browser" /B "%OSGEO4W_ROOT%"\bin\@package@-browser-bin.exe %*

View File

@ -1,7 +1,9 @@
@echo off
call "%~dp0\o4w_env.bat"
call "%~dp0\qt5_env.bat"
call "%~dp0\py3_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\@package@\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
start "QGIS Browser" /B "%OSGEO4W_ROOT%"\bin\@package@-browser-bin.exe %*

View File

@ -1,6 +1,7 @@
@echo off
call "%~dp0\o4w_env.bat"
call "%~dp0\qt5_env.bat"
path %OSGEO4W_ROOT%\apps\@package@\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
start "Qt Designer with QGIS custom widgets" /B "%OSGEO4W_ROOT%"\bin\designer.exe %*

View File

@ -0,0 +1,7 @@
@echo off
call %OSGEO4W_ROOT%\bin\o4w_env.bat
call py3_env.bat
call qt5_env.bat
call "c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
path %PATH%;c:\cygwin\bin;c:\program files\cmake\bin
%OSGEO4W_ROOT%\bin\ninja -j4 -C ..\build-qgis-dev-x86_64

View File

@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 14
VisualStudioVersion = 14.0.25420.1
MinimumVisualStudioVersion = 10.0.40219.1
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ninja", "ninja.vcxproj", "{02B448C7-945C-46D6-954C-AEAE0653BA59}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
RelWithDebInfo|Win32 = RelWithDebInfo|Win32
RelWithDebInfo|x64 = RelWithDebInfo|x64
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{02B448C7-945C-46D6-954C-AEAE0653BA59}.RelWithDebInfo|Win32.ActiveCfg = Release|Win32
{02B448C7-945C-46D6-954C-AEAE0653BA59}.RelWithDebInfo|Win32.Build.0 = Release|Win32
{02B448C7-945C-46D6-954C-AEAE0653BA59}.RelWithDebInfo|x64.ActiveCfg = Release|x64
{02B448C7-945C-46D6-954C-AEAE0653BA59}.RelWithDebInfo|x64.Build.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -0,0 +1,108 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Debug|x64">
<Configuration>Debug</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|x64">
<Configuration>Release</Configuration>
<Platform>x64</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{02B448C7-945C-46D6-954C-AEAE0653BA59}</ProjectGuid>
<Keyword>MakeFileProj</Keyword>
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>Makefile</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v140</PlatformToolset>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakeBuildCommandLine>ninja -C ../build-qgis-dev-x86 all</NMakeBuildCommandLine>
<NMakeOutput>..\build-qgis-dev-x86\output\bin\qgis.exe</NMakeOutput>
<NMakePreprocessorDefinitions>WIN32;_DEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<OutDir>..\build-qgis-dev-x86</OutDir>
<IntDir />
<NMakeReBuildCommandLine>ninja -C ../build-qgis-dev-x86 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ../build-qgis-dev-x86 clean</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakeBuildCommandLine>ninja -C ../build-qgis-dev-x86 all</NMakeBuildCommandLine>
<NMakeOutput>..\build-qgis-dev-x86\output\bin\qgis.exe</NMakeOutput>
<NMakePreprocessorDefinitions>WIN32;NDEBUG;$(NMakePreprocessorDefinitions)</NMakePreprocessorDefinitions>
<OutDir>..\build-qgis-dev-x86</OutDir>
<IntDir />
<NMakeReBuildCommandLine>ninja -C ../build-qgis-dev-x86 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ../build-qgis-dev-x86 clean</NMakeCleanCommandLine>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<NMakeBuildCommandLine>ninja -C ../build-qgis-dev-x86_64 -j4 -k1000 all</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ../build-qgis-dev-x86_64 -j4 -k1000 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ../build-qgis-dev-x86_64 clean</NMakeCleanCommandLine>
<NMakeOutput>..\build-qgis-dev-x86_64\output\bin\qgis.exe</NMakeOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<NMakeBuildCommandLine>ninja -C ../build-qgis-dev-x86_64 -j4 -k1000 all</NMakeBuildCommandLine>
<NMakeReBuildCommandLine>ninja -C ../build-qgis-dev-x86_64 -j4 -k1000 clean all</NMakeReBuildCommandLine>
<NMakeCleanCommandLine>ninja -C ../build-qgis-dev-x86_64 clean</NMakeCleanCommandLine>
<NMakeOutput>..\build-qgis-dev-x86_64\output\bin\qgis.exe</NMakeOutput>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<BuildLog>
<Path>x86.log</Path>
</BuildLog>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<BuildLog>
<Path>x86.log</Path>
</BuildLog>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -44,6 +44,8 @@ if not exist "%BUILDDIR%" (echo could not create build directory %BUILDDIR% & go
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"
set O4W_ROOT=%OSGEO4W_ROOT:\=/%
set LIB_DIR=%O4W_ROOT%
@ -56,35 +58,33 @@ if "%ARCH%"=="x86" goto cmake_x86
goto cmake_x86_64
:cmake_x86
set GRASS6_VERSION=6.4.4
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x86 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 10.0\VC\bin
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
set CMAKE_OPT=^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python27/sip.exe ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /ZI /MP /Od /D NDEBUG /D QGISDEBUG" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex_i.lib
goto cmake
:cmake_x86_64
set GRASS6_VERSION=6.4.3
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 10.0\VC\bin\amd64
set SETUPAPI_LIBRARY=%PF86%\Microsoft SDKs\Windows\v7.0A\Lib\x64\SetupAPI.Lib
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=%PF86%\Microsoft SDKs\Windows\v7.0A\Lib\x64\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Lib\x64\SetupAPI.lib
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)
set CMAKE_OPT=^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/bin/sip.exe ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D CMAKE_CXX_FLAGS_RELWITHDEBINFO="/MD /Zi /MP /Od /D NDEBUG /D QGISDEBUG" ^
-D CMAKE_PDB_OUTPUT_DIRECTORY_RELWITHDEBINFO=%BUILDDIR%\apps\%PACKAGENAME%\pdb ^
-D SETUPAPI_LIBRARY="%SETUPAPI_LIBRARY%" ^
@ -94,10 +94,11 @@ set CMAKE_OPT=^
for /f "usebackq tokens=1" %%a in (`%OSGEO4W_ROOT%\bin\grass72 --config path`) do set GRASS72_PATH=%%a
for %%i in ("%GRASS72_PATH%") do set GRASS72_VERSION=%%~nxi
set GRASS72_VERSION=%GRASS72_VERSION:grass-=%
set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS72_VERSION%
set GRASS_VERSIONS=%GRASS72_VERSION%
set PYTHONPATH=
path %PF86%\CMake\bin;%PATH%;c:\cygwin\bin
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
PROMPT qgis%VERSION%$g
@ -158,33 +159,32 @@ cmake -G Ninja ^
-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" ^
-D BUILDNAME="%PACKAGENAME%-%VERSION%%SHA%-Nightly-VC10-%ARCH%" ^
-D BUILDNAME="%PACKAGENAME%-%VERSION%%SHA%-Nightly-VC14-%ARCH%" ^
-D SITE="%SITE%" ^
-D PEDANTIC=TRUE ^
-D WITH_QSPATIALITE=TRUE ^
-D WITH_SERVER=TRUE ^
-D SERVER_SKIP_ECW=TRUE ^
-D WITH_GRASS=TRUE ^
-D WITH_GRASS6=TRUE ^
-D WITH_GRASS6=FALSE ^
-D WITH_GRASS7=TRUE ^
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS6_VERSION% ^
-D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^
-D WITH_GLOBE=TRUE ^
-D WITH_GLOBE=FALSE ^
-D WITH_TOUCH=TRUE ^
-D WITH_ORACLE=TRUE ^
-D WITH_QTWEBKIT=FALSE ^
-D WITH_CUSTOM_WIDGETS=TRUE ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
-D CMAKE_CONFIGURATION_TYPES=%BUILDCONF% ^
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c.lib ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python3.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python36/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python36/libs/python36.lib ^
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
-D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^
-D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^
-D QT_HEADERS_DIR=%O4W_ROOT%/apps/qt5/include ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
@ -199,6 +199,10 @@ cmake -G Ninja ^
-D WITH_INTERNAL_MOCK=FALSE ^
-D WITH_INTERNAL_HTTPLIB2=FALSE ^
-D WITH_INTERNAL_FUTURE=FALSE ^
-D QCA_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Qt5\include\QtCrypto ^
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca.lib ^
-D QSCINTILLA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qscintilla2.lib ^
-D SUPPRESS_SIP_WARNINGS=TRUE ^
%CMAKE_OPT% ^
%SRCDIR:\=/%
if errorlevel 1 (echo cmake failed & goto error)
@ -303,8 +307,8 @@ if not exist %PKGDIR%\qtplugins\designer mkdir %PKGDIR%\qtplugins\designer
move %OSGEO4W_ROOT%\apps\qt4\plugins\designer\qgis_customwidgets.dll %PKGDIR%\qtplugins\designer
if errorlevel 1 (echo move of customwidgets failed & goto error)
if not exist %PKGDIR%\python\PyQt4\uic\widget-plugins mkdir %PKGDIR%\python\PyQt4\uic\widget-plugins
move %OSGEO4W_ROOT%\apps\Python27\Lib\site-packages\PyQt4\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt4\uic\widget-plugins
if not exist %PKGDIR%\python\PyQt5\uic\widget-plugins mkdir %PKGDIR%\python\PyQt5\uic\widget-plugins
move %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages\PyQt5\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt5\uic\widget-plugins
if errorlevel 1 (echo move of customwidgets binding failed & goto error)
if not exist %ARCH%\release\qgis\%PACKAGENAME% mkdir %ARCH%\release\qgis\%PACKAGENAME%

View File

@ -44,6 +44,8 @@ if not exist "%BUILDDIR%" (echo could not create build directory %BUILDDIR% & go
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"
set O4W_ROOT=%OSGEO4W_ROOT:\=/%
set LIB_DIR=%O4W_ROOT%
@ -56,31 +58,28 @@ if "%ARCH%"=="x86" goto cmake_x86
goto cmake_x86_64
:cmake_x86
set GRASS6_VERSION=6.4.4
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" x86
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x86 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 10.0\VC\bin
path %path%;%PF86%\Microsoft Visual Studio 14.0\VC\bin
set CMAKE_COMPILER_PATH=%PF86%\Microsoft Visual Studio 14.0\VC\bin
set CMAKE_OPT=^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python27/sip.exe ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt.lib
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
goto cmake
:cmake_x86_64
set GRASS6_VERSION=6.4.3
call "%PF86%\Microsoft Visual Studio 10.0\VC\vcvarsall.bat" amd64
call "%PF86%\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" amd64
if exist "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" call "c:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.Cmd" /x64 /Release
path %path%;%PF86%\Microsoft Visual Studio 10.0\VC\bin
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
set SETUPAPI_LIBRARY=%PF86%\Microsoft SDKs\Windows\v7.0A\Lib\x64\SetupAPI.Lib
if not exist "%SETUPAPI_LIBRARY%" set SETUPAPI_LIBRARY=%PROGRAMFILES%\Microsoft SDKs\Windows\v7.1\Lib\x64\SetupAPI.lib
if not exist "%SETUPAPI_LIBRARY%" (echo SETUPAPI_LIBRARY not found & goto error)
set CMAKE_OPT=^
-D SPATIALINDEX_LIBRARY=%O4W_ROOT%/lib/spatialindex-64.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/bin/sip.exe ^
-D QWT_LIBRARY=%O4W_ROOT%/lib/qwt5.lib ^
-D SIP_BINARY_PATH=%O4W_ROOT%/apps/Python36/sip.exe ^
-D SETUPAPI_LIBRARY="%SETUPAPI_LIBRARY%" ^
-D CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_NO_WARNINGS=TRUE
@ -88,10 +87,10 @@ set CMAKE_OPT=^
for /f "usebackq tokens=1" %%a in (`%OSGEO4W_ROOT%\bin\grass72 --config path`) do set GRASS72_PATH=%%a
for %%i in ("%GRASS72_PATH%") do set GRASS72_VERSION=%%~nxi
set GRASS72_VERSION=%GRASS72_VERSION:grass-=%
set GRASS_VERSIONS=%GRASS6_VERSION% %GRASS72_VERSION%
set GRASS_VERSIONS=%GRASS72_VERSION%
set PYTHONPATH=
path %PF86%\CMake\bin;%PATH%;c:\cygwin\bin
path %PATH%;c:\cygwin\bin;%PF86%\CMake\bin
PROMPT qgis%VERSION%$g
@ -149,20 +148,23 @@ set LIB=%LIB%;%OSGEO4W_ROOT%\lib
set INCLUDE=%INCLUDE%;%OSGEO4W_ROOT%\include
cmake -G Ninja ^
-D BUILDNAME="%PACKAGENAME%-%VERSION%%SHA%-Release-VC10-%ARCH%" ^
-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" ^
-D BUILDNAME="%PACKAGENAME%-%VERSION%%SHA%-Release-VC14-%ARCH%" ^
-D SITE="%SITE%" ^
-D PEDANTIC=TRUE ^
-D WITH_QSPATIALITE=TRUE ^
-D WITH_SERVER=TRUE ^
-D SERVER_SKIP_ECW=TRUE ^
-D WITH_GRASS=TRUE ^
-D WITH_GRASS6=TRUE ^
-D WITH_GRASS6=FALSE ^
-D WITH_GRASS7=TRUE ^
-D GRASS_PREFIX=%O4W_ROOT%/apps/grass/grass-%GRASS6_VERSION% ^
-D GRASS_PREFIX7=%GRASS72_PATH:\=/% ^
-D WITH_GLOBE=TRUE ^
-D WITH_GLOBE=FALSE ^
-D WITH_TOUCH=TRUE ^
-D WITH_ORACLE=TRUE ^
-D WITH_QTWEBKIT=FALSE ^
-D WITH_CUSTOM_WIDGETS=TRUE ^
-D CMAKE_CXX_FLAGS_RELEASE="/MD /MP /O2 /Ob2 /D NDEBUG" ^
-D CMAKE_BUILD_TYPE=%BUILDCONF% ^
@ -170,13 +172,12 @@ cmake -G Ninja ^
-D GEOS_LIBRARY=%O4W_ROOT%/lib/geos_c.lib ^
-D SQLITE3_LIBRARY=%O4W_ROOT%/lib/sqlite3_i.lib ^
-D SPATIALITE_LIBRARY=%O4W_ROOT%/lib/spatialite_i.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python27/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python27/libs/python27.lib ^
-D PYTHON_EXECUTABLE=%O4W_ROOT%/bin/python3.exe ^
-D PYTHON_INCLUDE_PATH=%O4W_ROOT%/apps/Python36/include ^
-D PYTHON_LIBRARY=%O4W_ROOT%/apps/Python36/libs/python36.lib ^
-D QT_BINARY_DIR=%O4W_ROOT%/bin ^
-D QT_LIBRARY_DIR=%O4W_ROOT%/lib ^
-D QT_HEADERS_DIR=%O4W_ROOT%/include/qt4 ^
-D QWT_INCLUDE_DIR=%O4W_ROOT%/include/qwt ^
-D QT_HEADERS_DIR=%O4W_ROOT%/apps/qt5/include ^
-D CMAKE_INSTALL_PREFIX=%O4W_ROOT%/apps/%PACKAGENAME% ^
-D FCGI_INCLUDE_DIR=%O4W_ROOT%/include ^
-D FCGI_LIBRARY=%O4W_ROOT%/lib/libfcgi.lib ^
@ -187,7 +188,14 @@ cmake -G Ninja ^
-D WITH_INTERNAL_DATEUTIL=FALSE ^
-D WITH_INTERNAL_PYTZ=FALSE ^
-D WITH_INTERNAL_SIX=FALSE ^
-D WITH_INTERNAL_NOSE2=FALSE ^
-D WITH_INTERNAL_MOCK=FALSE ^
-D WITH_INTERNAL_HTTPLIB2=FALSE ^
-D WITH_INTERNAL_FUTURE=FALSE ^
-D QCA_INCLUDE_DIR=%OSGEO4W_ROOT%\apps\Qt5\include\QtCrypto ^
-D QCA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qca.lib ^
-D QSCINTILLA_LIBRARY=%OSGEO4W_ROOT%\apps\Qt5\lib\qscintilla2.lib ^
-D SUPPRESS_SIP_WARNINGS=TRUE ^
%CMAKE_OPT% ^
%SRCDIR:\=/%
if errorlevel 1 (echo cmake failed & goto error)
@ -208,6 +216,8 @@ if exist ..\skiptests goto skiptests
echo RUN_TESTS: %DATE% %TIME%
set oldtemp=%TEMP%
set oldtmp=%TMP%
set oldpath=%PATH%
for %%g IN (%GRASS_VERSIONS%) do (
set path=!path!;%OSGEO4W_ROOT%\apps\grass\grass-%%g\lib
@ -362,8 +372,8 @@ if not exist %PKGDIR%\qtplugins\designer mkdir %PKGDIR%\qtplugins\designer
move %OSGEO4W_ROOT%\apps\qt4\plugins\designer\qgis_customwidgets.dll %PKGDIR%\qtplugins\designer
if errorlevel 1 (echo move of customwidgets failed & goto error)
if not exist %PKGDIR%\python\PyQt4\uic\widget-plugins mkdir %PKGDIR%\python\PyQt4\uic\widget-plugins
move %OSGEO4W_ROOT%\apps\Python27\Lib\site-packages\PyQt4\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt4\uic\widget-plugins
if not exist %PKGDIR%\python\PyQt5\uic\widget-plugins mkdir %PKGDIR%\python\PyQt5\uic\widget-plugins
move %OSGEO4W_ROOT%\apps\Python36\Lib\site-packages\PyQt5\uic\widget-plugins\qgis_customwidgets.py %PKGDIR%\python\PyQt5\uic\widget-plugins
if errorlevel 1 (echo move of customwidgets binding failed & goto error)
if not exist %ARCH%\release\qgis\%PACKAGENAME% mkdir %ARCH%\release\qgis\%PACKAGENAME%

View File

@ -1,4 +1,5 @@
call "%OSGEO4W_ROOT%\bin\o4w_env.bat"
call "%OSGEO4W_ROOT%\bin\qt5_env.bat"
path %PATH%;%OSGEO4W_ROOT%\apps\@package@\bin
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
"%OSGEO4W_ROOT%\apps\@package@\crssync"

View File

@ -1,5 +1,7 @@
@echo off
call "%~dp0\o4w_env.bat"
call "%~dp0\qt5_env.bat"
call "%~dp0\py3_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\@package@\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
@ -7,6 +9,6 @@ set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
set PYTHONPATH=%OSGEO4W_ROOT%\apps\@package@\python;%PYTHONPATH%
"%OSGEO4W_ROOT%"\bin\python.exe %*

View File

@ -8,5 +8,5 @@ set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
start "QGIS" /B "%OSGEO4W_ROOT%"\bin\@package@-bin.exe %*

View File

@ -1,5 +1,6 @@
@echo off
call "%~dp0\o4w_env.bat"
call "%~dp0\qt5_env.bat"
@echo off
path %OSGEO4W_ROOT%\apps\@package@\bin;%PATH%
set QGIS_PREFIX_PATH=%OSGEO4W_ROOT:\=/%/apps/@package@
@ -7,5 +8,5 @@ set GDAL_FILENAME_IS_UTF8=YES
rem Set VSI cache to be used as buffer, see #6448
set VSI_CACHE=TRUE
set VSI_CACHE_SIZE=1000000
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt4\plugins
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\@package@\qtplugins;%OSGEO4W_ROOT%\apps\qt5\plugins
start "QGIS" /B "%OSGEO4W_ROOT%"\bin\@package@-bin.exe %*

View File

@ -70,9 +70,6 @@ ADD_SUBDIRECTORY(PyQt)
ADD_SUBDIRECTORY(pyplugin_installer)
ADD_SUBDIRECTORY(ext-libs)
ADD_SUBDIRECTORY(testing)
IF (PYQT5_VERSION_NUM)
ADD_SUBDIRECTORY(sip_helpers)
ENDIF (PYQT5_VERSION_NUM)
IF(POLICY CMP0040)
CMAKE_POLICY (POP) # see PUSH above
@ -118,8 +115,6 @@ INCLUDE_DIRECTORIES(
../src/gui/effects
../src/gui/layertree
sip_helpers
${CMAKE_BINARY_DIR} # qgsconfig.h, qgsversion.h
${CMAKE_BINARY_DIR}/src/core
${CMAKE_BINARY_DIR}/src/analysis
@ -142,37 +137,12 @@ IF(NOT QT_MOBILITY_LOCATION_FOUND)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} MOBILITY_LOCATION)
ENDIF(NOT QT_MOBILITY_LOCATION_FOUND)
IF(PYQT4_VERSION_NUM LESS 263680) # 0x040600
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} PROXY_FACTORY)
ENDIF(PYQT4_VERSION_NUM LESS 263680)
#
IF(NOT PYQT4_VERSION_NUM LESS 264194) # 0x040802
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QSETTYPE_CONVERSION)
ENDIF(NOT PYQT4_VERSION_NUM LESS 264194)
IF(PYQT4_VERSION_NUM LESS 264196) # 0x040804
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QLISTCONSTPTR_CONVERSION)
ENDIF(PYQT4_VERSION_NUM LESS 264196)
IF(NOT PYQT4_VERSION_NUM LESS 264453) # 0x040905
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} QVECTORINT_CONVERSION)
ENDIF(NOT PYQT4_VERSION_NUM LESS 264453)
IF (NOT PYQT5_VERSION_NUM)
SET(SIP_DISABLE_FEATURES ${SIP_DISABLE_FEATURES} CHIMERA_NULL_VARIANT_CONVERSION)
ENDIF (NOT PYQT5_VERSION_NUM)
# core module
FILE(GLOB_RECURSE sip_files_core core/*.sip)
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core})
SET(SIP_EXTRA_OPTIONS ${PYQT_SIP_FLAGS} -o -a ${CMAKE_BINARY_DIR}/python/qgis.core.api)
GENERATE_SIP_PYTHON_MODULE_CODE(qgis._core core/core.sip cpp_files)
IF (PYQT5_VERSION_NUM)
BUILD_SIP_PYTHON_MODULE(qgis._core core/core.sip ${cpp_files} $<TARGET_OBJECTS:qgis_sip_helpers> qgis_core)
ELSE (PYQT5_VERSION_NUM)
BUILD_SIP_PYTHON_MODULE(qgis._core core/core.sip ${cpp_files} "" qgis_core)
ENDIF (PYQT5_VERSION_NUM)
BUILD_SIP_PYTHON_MODULE(qgis._core core/core.sip ${cpp_files} "" qgis_core)
SET(SIP_CORE_CPP_FILES ${cpp_files})
# additional gui includes
@ -225,7 +195,7 @@ IF (WITH_SERVER AND WITH_SERVER_PLUGINS)
ENDIF (WITH_SERVER AND WITH_SERVER_PLUGINS)
# additional analysis includes
INCLUDE_DIRECTORIES(
INCLUDE_DIRECTORIES(BEFORE
../src/analysis/vector
../src/analysis/raster
../src/analysis/network

View File

@ -1,5 +1,4 @@
%Module(name=qgis._analysis,
version=0,
keyword_arguments="Optional")
%Import QtCore/QtCoremod.sip

View File

@ -300,12 +300,10 @@ class QgsComposition : QGraphicsScene, QgsExpressionContextGenerator
*/
QList<QgsComposerItem*> selectedComposerItems( const bool includeLockedItems = true );
%If (QLISTCONSTPTR_CONVERSION)
/** Returns pointers to all composer maps in the scene
@note available in python bindings only with PyQt >= 4.8.4
*/
* @note available in python bindings only with PyQt >= 4.8.4
*/
QList<const QgsComposerMap*> composerMapItems() const;
%End
/** Return composer items of a specific type
* @param itemList list of item type to store matching items in

View File

@ -22,12 +22,6 @@ which are not wrapped by PyQt:
- NULL QVariant which is missing in PyQt5 with sip.enableautoconversion
*/
%Feature QSETINT_CONVERSION
%Feature QSETTYPE_CONVERSION
%Feature QLISTCONSTPTR_CONVERSION
%Feature QVECTORINT_CONVERSION
%Feature CHIMERA_NULL_VARIANT_CONVERSION
%ModuleHeaderCode
// From Python 2.5, some functions use Py_ssize_t instead of int
@ -403,7 +397,6 @@ template <TYPE>
};
%If (QSETINT_CONVERSION)
%MappedType QSet<int>
{
%TypeHeaderCode
@ -450,8 +443,6 @@ template <TYPE>
return sipGetState(sipTransferObj);
%End
};
%End
%MappedType QList<qint64>
@ -551,80 +542,6 @@ template <TYPE>
};
%If (QSETTYPE_CONVERSION)
template <TYPE>
%MappedType QSet<TYPE>
{
%TypeHeaderCode
#include <QSet>
%End
%ConvertFromTypeCode
// Create the list.
PyObject *l;
if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;
// Set the list elements.
int i=0;
for (QSet<TYPE>::iterator it = sipCpp->begin(); it != sipCpp->end(); ++it, ++i)
{
TYPE *t = new TYPE(*it);
PyObject *tobj;
if ((tobj = sipConvertFromNewType(t, sipType_TYPE, sipTransferObj)) == NULL)
{
Py_DECREF(l);
delete t;
return NULL;
}
PyList_SET_ITEM(l, i, tobj);
}
return l;
%End
%ConvertToTypeCode
// Check the type if that is all that is required.
if (sipIsErr == NULL)
{
if (!PyList_Check(sipPy))
return 0;
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
if (!sipCanConvertToType(PyList_GET_ITEM(sipPy, i), sipType_TYPE, SIP_NOT_NONE))
return 0;
return 1;
}
QSet<TYPE> *qset = new QSet<TYPE>;
for (int i = 0; i < PyList_GET_SIZE(sipPy); ++i)
{
int state;
TYPE* t = reinterpret_cast<TYPE *>(sipConvertToType(PyList_GET_ITEM(sipPy, i), sipType_TYPE, sipTransferObj, SIP_NOT_NONE, &state, sipIsErr));
if (*sipIsErr)
{
sipReleaseType(t, sipType_TYPE, state);
delete qset;
return 0;
}
qset->insert(*t);
sipReleaseType(t, sipType_TYPE, state);
}
*sipCppPtr = qset;
return sipGetState(sipTransferObj);
%End
};
%End
template<TYPE>
%MappedType QMap<qint64, QMap<int, TYPE> >
{
@ -747,7 +664,7 @@ template<TYPE>
// QMap<qint64, TYPE> is implemented as a Python dictionary.
template<TYPE>
%MappedType QMap<qint64, TYPE> /DocType="dict-of-qint64-TYPE"/
%MappedType QMap<qint64, TYPE>
{
%TypeHeaderCode
#include <qmap.h>
@ -1873,7 +1790,7 @@ template <TYPE>
};
// QList<QgsField> is implemented as a Python list of QgsField.
%MappedType QList<QgsField> /DocType="list-of-qgsfield"/
%MappedType QList<QgsField>
{
%TypeHeaderCode
#include <qgsfield.h>
@ -1976,68 +1893,38 @@ template <TYPE>
%End
};
%If (QVECTORINT_CONVERSION)
// QVector<int> is implemented as a Python list of integers.
%MappedType QVector<int> /DocType="list-of-int"/
%ModuleCode
bool null_from_qvariant_converter( const QVariant *varp, PyObject **objp )
{
%TypeHeaderCode
#include <qvector.h>
%End
static bool sWatchDog = false;
%ConvertFromTypeCode
// Create the list.
PyObject *l;
if ( sWatchDog )
return false;
if ((l = PyList_New(sipCpp->size())) == NULL)
return NULL;
// Set the list elements.
for (int i = 0; i < sipCpp->size(); ++i)
{
PyObject *pobj;
// Convert to a Python long to make sure it doesn't get interpreted as
// a signed value.
if ((pobj = SIPLong_FromLong(sipCpp->value(i))) == NULL)
{
Py_DECREF(l);
return NULL;
}
PyList_SET_ITEM(l, i, pobj);
}
return l;
%End
%ConvertToTypeCode
// Check the type if that is all that is required.
if (sipIsErr == NULL)
return PyList_Check(sipPy);
QVector<int> *qv = new QVector<int>;
for (SIP_SSIZE_T i = 0; i < PyList_GET_SIZE(sipPy); ++i)
qv->append(SIPLong_AsLong(PyList_GET_ITEM(sipPy, i)));
*sipCppPtr = qv;
return sipGetState(sipTransferObj);
%End
};
%End
%If (CHIMERA_NULL_VARIANT_CONVERSION)
%ModuleHeaderCode
#include "qgissiphelper.h"
// If we deal with a NULL QVariant (and it's not a QByteArray which properly
// maps NULL values)
// If there are more cases like QByteArray, we should consider using a whitelist
// instead of a blacklist.
if ( varp->isNull() && varp->type() != QVariant::ByteArray )
{
sWatchDog = true;
PyObject* vartype = sipConvertFromEnum( varp->type(), sipType_QVariant_Type );
*objp = PyObject_Call(( PyObject * )sipTypeAsPyTypeObject( sipType_QVariant ), PyTuple_Pack( 1, vartype ), nullptr );
sWatchDog = false;
return true;
}
else
{
return false;
}
}
%End
%PostInitialisationCode //#spellok
// Import the Chimera helper registration functions.
typedef bool ( *FromQVariantConverterFn )( const QVariant *, PyObject ** );
void (*register_from_qvariant_converter)(FromQVariantConverterFn);
register_from_qvariant_converter = (void (*)(FromQVariantConverterFn))sipImportSymbol("pyqt5_register_from_qvariant_convertor"); //#spellok
register_from_qvariant_converter(null_from_qvariant_converter);
%End
%End

View File

@ -1,5 +1,4 @@
%Module(name=qgis._core,
version=0,
keyword_arguments="Optional")
%Import QtXml/QtXmlmod.sip

View File

@ -28,7 +28,6 @@ class QgsDatumTransformStore
*/
QgsCoordinateTransform transformation( QgsMapLayer* layer ) const;
void readXml( const QDomNode& parentNode );
void writeXml( QDomNode& parentNode, QDomDocument& theDoc ) const;

View File

@ -4,7 +4,7 @@ typedef QMap<int, QVariant> QgsAttributeMap;
typedef QVector<QVariant> QgsAttributes;
// QgsAttributes is implemented as a Python list of Python objects.
%MappedType QgsAttributes /DocType="list-of-attributes"/
%MappedType QgsAttributes
{
%TypeHeaderCode
#include <qgsfeature.h>

View File

@ -1,5 +1,3 @@
%Feature PROXY_FACTORY
/*
* \class QgsNetworkAccessManager
* \brief network access manager for QGIS
@ -31,7 +29,6 @@ class QgsNetworkAccessManager : QNetworkAccessManager
//! destructor
~QgsNetworkAccessManager();
%If (PROXY_FACTORY)
//! insert a factory into the proxy factories list
void insertProxyFactory( QNetworkProxyFactory *factory /Transfer/ );
@ -40,7 +37,6 @@ class QgsNetworkAccessManager : QNetworkAccessManager
//! retrieve proxy factory list
const QList<QNetworkProxyFactory *> proxyFactories() const;
%End
//! retrieve fall back proxy (for urls that no factory returned proxies for)
const QNetworkProxy &fallbackProxy() const;

View File

@ -70,5 +70,6 @@ class QgsVectorLayerFeatureIterator : QgsAbstractFeatureIterator
//void updateFeatureGeometry( QgsFeature& f );
private:
QgsVectorLayerFeatureIterator();
QgsVectorLayerFeatureIterator( const QgsVectorLayerFeatureIterator &rhs );
};

View File

@ -31,16 +31,16 @@ class QgsRasterProjector : QgsRasterInterface
int bandCount() const;
int dataType( int bandNo ) const;
Qgis::DataType dataType( int bandNo ) const;
/** \brief set source and destination CRS */
//! \brief set source and destination CRS
void setCrs( const QgsCoordinateReferenceSystem & theSrcCRS, const QgsCoordinateReferenceSystem & theDestCRS,
int srcDatumTransform = -1, int destDatumTransform = -1 );
/** \brief Get source CRS */
//! \brief Get source CRS
QgsCoordinateReferenceSystem sourceCrs() const;
/** \brief Get destination CRS */
//! \brief Get destination CRS
QgsCoordinateReferenceSystem destinationCrs() const;
Precision precision() const;
@ -50,11 +50,11 @@ class QgsRasterProjector : QgsRasterInterface
QgsRasterBlock *block( int bandNo, const QgsRectangle & extent, int width, int height, QgsRasterBlockFeedback* feedback = nullptr ) / Factory /;
/** Calculate destination extent and size from source extent and size */
//! Calculate destination extent and size from source extent and size
bool destExtentSize( const QgsRectangle& theSrcExtent, int theSrcXSize, int theSrcYSize,
QgsRectangle& theDestExtent, int& theDestXSize, int& theDestYSize );
/** Calculate destination extent and size from source extent and size */
//! Calculate destination extent and size from source extent and size
static bool extentSize( const QgsCoordinateTransform& ct,
const QgsRectangle& theSrcExtent, int theSrcXSize, int theSrcYSize,
QgsRectangle& theDestExtent, int& theDestXSize, int& theDestYSize );

View File

@ -1,5 +1,4 @@
%Module(name=qgis._gui,
version=0,
keyword_arguments="Optional")
%Feature HAVE_QSCI_SIP

View File

@ -22,7 +22,6 @@ class QgsMapCanvas : QGraphicsView
//! Constructor
QgsMapCanvas( QWidget * parent /TransferThis/ = 0 );
//! Destructor
~QgsMapCanvas();
//! Returns the magnification factor
@ -95,7 +94,7 @@ class QgsMapCanvas : QGraphicsView
QgsRectangle fullExtent() const;
//! Set the extent of the map canvas
void setExtent( const QgsRectangle &r );
void setExtent( const QgsRectangle &r, bool magnified = false );
//! Get the current map canvas rotation in clockwise degrees
//! @note added in 2.8
@ -140,10 +139,10 @@ class QgsMapCanvas : QGraphicsView
@param ids the feature ids*/
void panToFeatureIds( QgsVectorLayer* layer, const QgsFeatureIds& ids );
/** Pan to the selected features of current (vector) layer keeping same extent. */
//! Pan to the selected features of current (vector) layer keeping same extent.
void panToSelected( QgsVectorLayer* layer = 0 );
/** \brief Sets the map tool currently being used on the canvas */
//! \brief Sets the map tool currently being used on the canvas
void setMapTool( QgsMapTool* mapTool );
/** \brief Unset the current map tool or last non zoom tool
@ -154,19 +153,19 @@ class QgsMapCanvas : QGraphicsView
*/
void unsetMapTool( QgsMapTool* mapTool );
/** Returns the currently active tool*/
//! Returns the currently active tool
QgsMapTool* mapTool();
/** Write property of QColor bgColor. */
//! Write property of QColor bgColor.
void setCanvasColor( const QColor & _newVal );
/** Read property of QColor bgColor. */
//! Read property of QColor bgColor.
QColor canvasColor() const;
/** Set color of selected vector features */
//! Set color of selected vector features
//! @note added in 2.4
void setSelectionColor( const QColor& color );
/** Emits signal scaleChanged to update scale in main window */
//! Emits signal scaleChanged to update scale in main window
void updateScale();
//! return the map layer at position index in the layer stack
@ -218,7 +217,7 @@ class QgsMapCanvas : QGraphicsView
//! returns current layer (set by legend widget)
QgsMapLayer* currentLayer();
//! set the wheel zoom factor
//! set wheel zoom factor (should be greater than 1)
void setWheelFactor( double factor );
//! Zoom to a specific scale
@ -298,6 +297,7 @@ class QgsMapCanvas : QGraphicsView
* @note added in 2.8
*/
QgsSnappingUtils* snappingUtils() const;
/** Assign an instance of snapping utils to the map canvas.
* The instance is not owned by the canvas, so it is possible to use one instance in multiple canvases.
*
@ -332,16 +332,17 @@ class QgsMapCanvas : QGraphicsView
*/
// const QgsExpressionContextScope& expressionContextScope() const;
/** Sets the segmentation tolerance applied when rendering curved geometries
/** Sets the segmentation tolerance applied when rendering curved geometries
@param tolerance the segmentation tolerance*/
void setSegmentationTolerance( double tolerance );
/** Sets segmentation tolerance type (maximum angle or maximum difference between curve and approximation)
@param type the segmentation tolerance typename*/
void setSegmentationToleranceType( QgsAbstractGeometry::SegmentationToleranceType type );
public slots:
/** Repaints the canvas map*/
//! Repaints the canvas map
void refresh();
//! Receives signal about selection change, and pass it on with layer info
@ -361,7 +362,7 @@ class QgsMapCanvas : QGraphicsView
//! State of render suppression flag
bool renderFlag();
/** A simple helper method to find out if on the fly projections are enabled or not */
//! A simple helper method to find out if on the fly projections are enabled or not
bool hasCrsTransformEnabled();
//! stop rendering (if there is any right now)
@ -395,6 +396,7 @@ class QgsMapCanvas : QGraphicsView
void zoomOut();
signals:
/** Emits current mouse position
\note changed in 1.3 */
void xyCoordinates( const QgsPoint &p );
@ -426,11 +428,11 @@ class QgsMapCanvas : QGraphicsView
void renderComplete( QPainter * );
// ### QGIS 3: renamte to mapRefreshFinished()
/** Emitted when canvas finished a refresh request. */
//! Emitted when canvas finished a refresh request.
void mapCanvasRefreshed();
// ### QGIS 3: rename to mapRefreshStarted()
/** Emitted when the canvas is about to be rendered. */
//! Emitted when the canvas is about to be rendered.
void renderStarting();
//! Emitted when a new set of layers has been received
@ -528,6 +530,6 @@ class QgsMapCanvas : QGraphicsView
//! Make sure the datum transform store is properly populated
void updateDatumTransformEntries();
private:
private:
void connectNotify( const char * signal );
}; // class QgsMapCanvas

View File

@ -15,7 +15,6 @@ class QgsMapCanvasItem : QGraphicsItem
//! function to be implemented by derived classes
virtual void paint( QPainter * painter ) = 0;
//! paint function called by map canvas
virtual void paint( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget = 0 );
@ -34,7 +33,6 @@ class QgsMapCanvasItem : QGraphicsItem
//! called on changed extent or resize event to update position of the item
virtual void updatePosition();
//! default implementation for canvas items
virtual QRectF boundingRect() const;
//! returns canvas item rectangle in map units

View File

@ -13,18 +13,10 @@ class QgsMapToolTouch : QgsMapTool
void activate();
void deactivate();
//! Overridden mouse move event
virtual void canvasMoveEvent( QgsMapMouseEvent * e );
//! Overridden mouse release event
virtual void canvasReleaseEvent( QgsMapMouseEvent * e );
//! Overridden Mouse double click event.
virtual void canvasDoubleClickEvent( QgsMapMouseEvent * e );
virtual bool isTransient();
bool gestureEvent( QGestureEvent *event );
virtual void canvasMoveEvent( QgsMapMouseEvent *e );
virtual void canvasReleaseEvent( QgsMapMouseEvent *e );
virtual void canvasDoubleClickEvent( QgsMapMouseEvent *e );
virtual Flags flags() const;
bool gestureEvent( QGestureEvent *e );
};
%End

View File

@ -1,10 +1,10 @@
/** \ingroup gui
* \class QgsTreeWidgetItem
* \note added in QGIS 3.0
* QTreeWidgetItem subclass with custom handling for item sorting.
*
* QgsTreeWidgetItem allows for items to be sorted using a specified user role, and
* also correctly handles sorting numeric or mixed text and numeric values.
* \note added in QGIS 3.0
*/
class QgsTreeWidgetItem : QTreeWidgetItem
{
@ -97,12 +97,14 @@ class QgsTreeWidgetItem : QTreeWidgetItem
virtual bool operator<( const QTreeWidgetItem &other ) const;
bool operator>=( const QTreeWidgetItem &other ) const;
};
/** \ingroup gui
* \class QgsTreeWidgetItemObject
* \note added in QGIS 3.0
* Custom QgsTreeWidgetItem with extra signals when item is edited.
* \note added in QGIS 3.0
*/
class QgsTreeWidgetItemObject: QObject, QgsTreeWidgetItem
{
@ -116,14 +118,14 @@ class QgsTreeWidgetItemObject: QObject, QgsTreeWidgetItem
*/
explicit QgsTreeWidgetItemObject( int type = Type );
/** Constructs a tree widget item of the specified type and appends it to the items in the given parent. */
//! Constructs a tree widget item of the specified type and appends it to the items in the given parent.
explicit QgsTreeWidgetItemObject( QTreeWidget * parent /TransferThis/, int type = Type );
/** Sets the value for the item's column and role to the given value. */
//! Sets the value for the item's column and role to the given value.
virtual void setData( int column, int role, const QVariant & value );
signals:
/** This signal is emitted when the contents of the column in the specified item has been edited by the user. */
//! This signal is emitted when the contents of the column in the specified item has been edited by the user.
void itemEdited( QTreeWidgetItem* item, int column );
};

View File

@ -20,20 +20,19 @@ class QgsServerProjectParser
{
%TypeHeaderCode
#include "qgsserverprojectparser.h"
%End
public:
/** Takes ownership of the document*/
QgsServerProjectParser( QDomDocument* xmlDoc, const QString& filePath );
QString projectPath();
QString projectPath() const;
const QDomDocument* xmlDocument();
const QDomDocument* xmlDocument() const;
/** Returns project layers by id*/
//! Returns project layers by id
void projectLayerMap( QMap<QString, QgsMapLayer*>& layerMap ) const;
/** Converts a (possibly relative) path to absolute*/
//! Converts a (possibly relative) path to absolute
QString convertToAbsolutePath( const QString& file ) const;
/** Creates a maplayer object from <maplayer> element. The layer cash owns the maplayer, so don't delete it
@ -42,10 +41,10 @@ class QgsServerProjectParser
QgsMapLayer* mapLayerFromLayerId( const QString& lId, bool useCache = true ) const;
/** Returns the layer id under a <legendlayer> tag in the QGIS projectfile*/
//! Returns the layer id under a <legendlayer> tag in the QGIS projectfile
QString layerIdFromLegendLayer( const QDomElement& legendLayer ) const;
/** @param considerMapExtent Take user-defined map extent instead of data-calculated extent if present in project file*/
//! @param considerMapExtent Take user-defined map extent instead of data-calculated extent if present in project file
void combineExtentAndCrsOfGroupChildren( QDomElement& groupElement, QDomDocument& doc, bool considerMapExtent = false ) const;
void addLayerProjectSettings( QDomElement& layerElem, QDomDocument& doc, QgsMapLayer* currentLayer ) const;
@ -54,7 +53,7 @@ class QgsServerProjectParser
bool crsSetForLayer( const QDomElement& layerElement, QSet<QString> &crsSet ) const;
const QgsCoordinateReferenceSystem& projectCrs() const;
QgsCoordinateReferenceSystem projectCrs() const;
QgsRectangle mapRectangle() const;
@ -70,15 +69,12 @@ class QgsServerProjectParser
QDomElement propertiesElem() const;
const QSet<QString>& restrictedLayers() const;
QSet<QString> restrictedLayers() const;
bool useLayerIds() const;
QHash< QString, QDomElement > projectLayerElementsByName() const;
QHash< QString, QDomElement > projectLayerElementsById() const;
// SIP doesn't like QMap:
// void layerFromLegendLayer( const QDomElement& legendLayerElem, QMap< int, QgsMapLayer*>& layers, bool useCache = true ) const;
QStringList wfsLayerNames() const;
QStringList wcsLayerNames() const;
@ -86,10 +82,8 @@ class QgsServerProjectParser
QList<QDomElement> publishedComposerElements() const;
//QList< QPair< QString, QgsDatumTransformStore::Entry > > layerCoordinateTransforms() const;
/** Returns the text of the <layername> element for a layer element
@return id or a null string in case of error*/
@return name or a null string in case of error*/
QString layerName( const QDomElement& layerElem ) const;
QString serviceUrl() const;
@ -99,16 +93,22 @@ class QgsServerProjectParser
QStringList wfsLayers() const;
QStringList wcsLayers() const;
//! Add layers for vector joins
void addJoinLayersForElement( const QDomElement& layerElem ) const;
void addValueRelationLayersForLayer( const QgsVectorLayer *vl ) const;
/** Add layers which are necessary for the evaluation of the expression function 'getFeature( layer, attributeField, value)'*/
//! Add layers which are necessary for the evaluation of the expression function 'getFeature( layer, attributField, value)'
void addGetFeatureLayers( const QDomElement& layerElem ) const;
/** Returns the text of the <id> element for a layer element
@return id or a null string in case of error*/
QString layerId( const QDomElement& layerElem ) const;
/** Returns the text of the <id> element for a layer element
@return id or a null string in case of error*/
QString layerShortName( const QDomElement& layerElem ) const;
QgsRectangle projectExtent() const;
int numberOfLayers() const;
@ -117,5 +117,6 @@ class QgsServerProjectParser
void serviceCapabilities( QDomElement& parentElement, QDomDocument& doc, const QString& service, bool sia2045 = false ) const;
QStringList customLayerOrder() const;
};

View File

@ -112,7 +112,7 @@ class QgsWmsConfigParser
virtual void setScaleDenominator( double denom ) = 0;
virtual void addExternalGMLData( const QString& layerName, QDomDocument* gmlDoc ) = 0;
virtual QList< QPair< QString, QgsDatumTransformStore::Entry > > layerCoordinateTransforms() const = 0;
// virtual QList< QPair< QString, QgsDatumTransformStore::Entry > > layerCoordinateTransforms() const = 0;
virtual int nLayers() const = 0;

View File

@ -63,7 +63,7 @@ class QgsWmsProjectParser : public QgsWmsConfigParser
void setScaleDenominator( double ) /*override*/;
void addExternalGMLData( const QString&, QDomDocument* ) /*override*/ ;
QList< QPair< QString, QgsDatumTransformStore::Entry > > layerCoordinateTransforms() const /*override*/ ;
// QList< QPair< QString, QgsDatumTransformStore::Entry > > layerCoordinateTransforms() const /*override*/ ;
/** Fills a layer and a style list. The two list have the same number of entries and the style and the layer at a position belong together (similar to the HTTP parameters 'Layers' and 'Styles'. Returns 0 in case of success*/
int layersAndStyles( QStringList& layers, QStringList& styles ) const /*override*/ ;

View File

@ -1,5 +1,4 @@
%Module(name=qgis._server,
version=0,
keyword_arguments="Optional")

View File

@ -1,39 +0,0 @@
SET (QGIS_SIP_HELPER_SRCS
qgissiphelper.cpp
)
SET (QGIS_SIP_HELPER_HDRS
qgissiphelper.h
)
INCLUDE_DIRECTORIES(SYSTEM
${PYTHON_INCLUDE_PATH}
${SIP_INCLUDE_DIR}
${Qt5Core_INCLUDE_DIRS}
${Qt5Xml_INCLUDE_DIRS}
${Qt5Gui_INCLUDE_DIRS}
${Qt5Widgets_INCLUDE_DIRS}
${Qt5PrintSupport_INCLUDE_DIRS}
)
INCLUDE_DIRECTORIES(
${CMAKE_BINARY_DIR}/python/core
${CMAKE_BINARY_DIR}/src/core
../../src/core
../../src/core/auth
../../src/core/pal
../../src/core/composer
../../src/core/diagram
../../src/core/effects
../../src/core/dxf
../../src/core/geometry
../../src/core/gps
../../src/core/layertree
../../src/core/raster
../../src/core/symbology-ng
.
)
ADD_LIBRARY(qgis_sip_helpers OBJECT ${QGIS_SIP_HELPER_SRCS} ${QGIS_SIP_HELPER_HDRS})
ADD_DEPENDENCIES(qgis_sip_helpers generate_sip_qgis._core_cpp_files)
SET_TARGET_PROPERTIES(qgis_sip_helpers PROPERTIES POSITION_INDEPENDENT_CODE TRUE)

View File

@ -1,48 +0,0 @@
/***************************************************************************
qgissiphelper.cpp
-------------------
begin : Wed, May 11 2016
copyright : (C) 2016 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include "qgissiphelper.h"
#include "sipAPI_core.h"
#include <sip.h>
#include <QVariant>
#include <Python.h>
bool null_from_qvariant_converter( const QVariant *varp, PyObject **objp )
{
static bool sWatchDog = false;
if ( sWatchDog )
return false;
// If we deal with a NULL QVariant (and it's not a QByteArray which properly
// maps NULL values)
// If there are more cases like QByteArray, we should consider using a whitelist
// instead of a blacklist.
if ( varp->isNull() && varp->type() != QVariant::ByteArray )
{
sWatchDog = true;
PyObject* vartype = sipConvertFromEnum( varp->type(), sipType_QVariant_Type );
*objp = PyObject_Call(( PyObject * )sipTypeAsPyTypeObject( sipType_QVariant ), PyTuple_Pack( 1, vartype ), nullptr );
sWatchDog = false;
return true;
}
else
{
return false;
}
}

View File

@ -1,24 +0,0 @@
/***************************************************************************
qgissiphelper.h
-------------------
begin : Wed, May 11 2016
copyright : (C) 2016 by Matthias Kuhn
email : matthias@opengis.ch
***************************************************************************/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
#include <Python.h>
class QVariant;
typedef bool ( *FromQVariantConverterFn )( const QVariant *, PyObject ** );
bool null_from_qvariant_converter( const QVariant *, PyObject ** );

View File

@ -1,6 +1,8 @@
@echo off
set PYUIC4=%1
set PYUIC=%1
set PATH=%2;%PATH%
set PYTHONPATH=%3;%PYTHONPATH%
set PYTHON=%4
echo PATH:%PATH%
echo PYTHONPATH:%PYTHONPATH%
%PYTHON% %~dp0\pyuic-wrapper.py %5 %6 %7 %8 %9

View File

@ -15,7 +15,7 @@
###########################################################################
PYUIC4=$1
PYUIC=$1
LD_LIBRARY_PATH=$2:$LD_LIBRARY_PATH
PYTHONPATH=$3:$PYTHONPATH
PYTHON=$4

View File

@ -9,7 +9,7 @@ for file in $*; do
tempfile=$(mktemp ${f}XXXX --suffix=.h)
# Remove comments
sed 's/a/aA/g;s/__/aB/g;s/#/aC/g' "src/$d/$f.h" | gcc -P -E $arg - | sed 's/aC/#/g;s/aB/__/g;s/aA/a/g' > $tempfile
sed 's/a/aA/g;s/__/aB/g;s/#/aC/g' "src/$d/$f.h" | cpp -E $arg - | sed 's/aC/#/g;s/aB/__/g;s/aA/a/g' > $tempfile
# Remove override keyword
sed -i 's/ override;/;/g' $tempfile

View File

@ -183,7 +183,10 @@ GENERATE_EXPORT_HEADER(
qgis_analysis
BASE_NAME ANALYSIS
EXPORT_FILE_NAME qgis_analysis.h
)
)
IF(MSVC)
SET_TARGET_PROPERTIES(qgis_analysis PROPERTIES LINK_FLAGS "/FORCE:MULTIPLE")
ENDIF(MSVC)
SET(QGIS_ANALYSIS_HDRS ${QGIS_ANALYSIS_HDRS} ${CMAKE_CURRENT_BINARY_DIR}/qgis_analysis.h)

View File

@ -601,8 +601,6 @@ TARGET_LINK_LIBRARIES(qgis_app
${QT_QTSQL_LIBRARY}
${QT_QTUITOOLS_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
${QWTPOLAR_LIBRARY}
${GDAL_LIBRARY}
qgis_core
@ -632,11 +630,7 @@ if(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
SET_TARGET_PROPERTIES(qgis_app PROPERTIES STATIC_LIBRARY_FLAGS "/machine:x64")
ENDIF(MSVC AND CMAKE_SIZEOF_VOID_P EQUAL 8)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME}
#should only be needed for win
${QT_QTMAIN_LIBRARY}
qgis_app
)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} qgis_app)
IF (ANDROID)
TARGET_LINK_LIBRARIES(${QGIS_APP_NAME} log)

View File

@ -83,7 +83,6 @@ TARGET_LINK_LIBRARIES(qbrowser
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
${QT_QTMAIN_LIBRARY}
${SQLITE3_LIBRARY}
)

View File

@ -1017,7 +1017,6 @@ IF (QT_MOBILITY_LOCATION_FOUND)
ENDIF (QT_MOBILITY_LOCATION_FOUND)
TARGET_LINK_LIBRARIES(qgis_core
${QT_QTMAIN_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}

View File

@ -20,9 +20,10 @@
#include "qgis_core.h"
#include "qgspainteffect.h"
#include "qgssymbol.h"
#include "qgscolorramp.h"
#include <QPainter>
class QgsColorRamp;
/** \ingroup core
* \class QgsGlowEffect

View File

@ -2228,6 +2228,9 @@ bool QgsCoordinateReferenceSystem::syncDatumTransform( const QString& dbPath )
v.clear();
if ( CSLCount( values ) == 0 )
break;
if ( CSLCount( values ) < n )
{
qWarning( "Only %d columns", CSLCount( values ) );

View File

@ -54,7 +54,7 @@ class CORE_EXPORT QgsDatumTransformStore
void writeXml( QDomNode& parentNode, QDomDocument& theDoc ) const;
struct Entry
struct CORE_EXPORT Entry
{
QString srcAuthId;
QString destAuthId;

View File

@ -33,7 +33,7 @@
* @note added in QGIS 3.0
*/
class QgsExpressionContextGenerator
class CORE_EXPORT QgsExpressionContextGenerator
{
public:

View File

@ -220,7 +220,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob& job )
QTime t;
t.start();
QgsDebugMsgLevel( QString( "job %1 start (layer %2)" ).arg( reinterpret_cast< ulong >( &job ), 0, 16 ).arg( job.layerId ), 2 );
QgsDebugMsgLevel( QString( "job %1 start (layer %2)" ).arg( reinterpret_cast< quint64 >( &job ), 0, 16 ).arg( job.layerId ), 2 );
try
{
@ -242,7 +242,7 @@ void QgsMapRendererParallelJob::renderLayerStatic( LayerRenderJob& job )
}
job.renderingTime = t.elapsed();
QgsDebugMsgLevel( QString( "job %1 end [%2 ms] (layer %3)" ).arg( reinterpret_cast< ulong >( &job ), 0, 16 ).arg( job.renderingTime ).arg( job.layerId ), 2 );
QgsDebugMsgLevel( QString( "job %1 end [%2 ms] (layer %3)" ).arg( reinterpret_cast< quint64 >( &job ), 0, 16 ).arg( job.renderingTime ).arg( job.layerId ), 2 );
}

View File

@ -465,7 +465,6 @@ void QgsMapThemeCollection::layerStyleRenamed( const QString& oldName, const QSt
emit mapThemesChanged();
}
QHash<QgsMapLayer*, QgsMapThemeCollection::MapThemeLayerRecord> QgsMapThemeCollection::MapThemeRecord::validLayerRecords() const
{
QHash<QgsMapLayer*, MapThemeLayerRecord> validSet;

View File

@ -54,7 +54,7 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
* Individual record of a visible layer in a map theme record.
* @note Added in QGIS 3.0
*/
class MapThemeLayerRecord
class CORE_EXPORT MapThemeLayerRecord
{
public:
//! Initialize layer record with a map layer - it will be stored as a weak pointer
@ -93,7 +93,7 @@ class CORE_EXPORT QgsMapThemeCollection : public QObject
*
* @note Added in QGIS 3.0, Previously called PresetRecord
*/
class MapThemeRecord
class CORE_EXPORT MapThemeRecord
{
public:

View File

@ -19,6 +19,8 @@
#include "qgsproperty_p.h"
#include "qgsexpression.h"
#include "qgsexpressioncontext.h"
#include "qgscolorramp.h"
#include <QVariant>
#include <QHash>
#include <QString>
@ -28,7 +30,6 @@
#include <QColor>
class QgsPropertyTransformer;
class QgsColorRamp;
/**
* \ingroup core

View File

@ -36,7 +36,7 @@ class QgsVectorLayerFeatureIterator;
* Partial snapshot of vector layer's state (only the members necessary for access to features)
* @note not available in Python bindings
*/
class QgsVectorLayerFeatureSource : public QgsAbstractFeatureSource
class CORE_EXPORT QgsVectorLayerFeatureSource : public QgsAbstractFeatureSource
{
public:

View File

@ -62,7 +62,7 @@ QgsRasterBlock::QgsRasterBlock( Qgis::DataType theDataType, int theWidth, int th
QgsRasterBlock::~QgsRasterBlock()
{
QgsDebugMsgLevel( QString( "mData = %1" ).arg( reinterpret_cast< ulong >( mData ) ), 4 );
QgsDebugMsgLevel( QString( "mData = %1" ).arg( reinterpret_cast< quint64 >( mData ) ), 4 );
qgsFree( mData );
delete mImage;
qgsFree( mNoDataBitmap );
@ -116,7 +116,7 @@ bool QgsRasterBlock::reset( Qgis::DataType theDataType, int theWidth, int theHei
mWidth = theWidth;
mHeight = theHeight;
QgsDebugMsgLevel( QString( "mWidth= %1 mHeight = %2 mDataType = %3 mData = %4 mImage = %5" ).arg( mWidth ).arg( mHeight ).arg( mDataType )
.arg( reinterpret_cast< ulong >( mData ) ).arg( reinterpret_cast< ulong >( mImage ) ), 4 );
.arg( reinterpret_cast< quint64 >( mData ) ).arg( reinterpret_cast< quint64 >( mImage ) ), 4 );
return true;
}
@ -149,7 +149,7 @@ Qgis::DataType QgsRasterBlock::dataType( QImage::Format theFormat )
bool QgsRasterBlock::isEmpty() const
{
QgsDebugMsgLevel( QString( "mWidth= %1 mHeight = %2 mDataType = %3 mData = %4 mImage = %5" ).arg( mWidth ).arg( mHeight ).arg( mDataType )
.arg( reinterpret_cast< ulong >( mData ) ).arg( reinterpret_cast< ulong >( mImage ) ), 4 );
.arg( reinterpret_cast< quint64 >( mData ) ).arg( reinterpret_cast< quint64 >( mImage ) ), 4 );
if ( mWidth == 0 || mHeight == 0 ||
( typeIsNumeric( mDataType ) && !mData ) ||
( typeIsColor( mDataType ) && !mImage ) )

View File

@ -19,11 +19,11 @@
#include "qgssymbol.h"
#include "qgsrenderer.h"
#include "qgsexpression.h"
#include "qgscolorramp.h"
#include <QHash>
#include <QScopedPointer>
class QgsColorRamp;
class QgsVectorLayer;
/** \ingroup core

View File

@ -27,10 +27,10 @@
#include "qgssymbol.h"
#include "qgis.h"
#include "qgsmapunitscale.h"
#include "qgscolorramp.h"
class QgsExpression;
class QgsSymbolLayer;
class QgsColorRamp;
typedef QMap<QString, QString> QgsStringMap;
typedef QMap<QString, QgsSymbol* > QgsSymbolMap;

View File

@ -22,6 +22,17 @@ QgsRangeConfigDlg::QgsRangeConfigDlg( QgsVectorLayer* vl, int fieldIdx, QWidget
{
setupUi( this );
minimumSpinBox->setMinimum( std::numeric_limits<int>::min() );
minimumSpinBox->setMaximum( std::numeric_limits<int>::max() );
minimumSpinBox->setValue( std::numeric_limits<int>::min() );
maximumSpinBox->setMinimum( std::numeric_limits<int>::min() );
maximumSpinBox->setMaximum( std::numeric_limits<int>::max() );
maximumSpinBox->setValue( std::numeric_limits<int>::max() );
stepSpinBox->setMaximum( std::numeric_limits<int>::max() );
stepSpinBox->setValue( 1 );
QString text;
switch ( vl->fields().at( fieldIdx ).type() )

View File

@ -44,7 +44,7 @@ class GUI_EXPORT QgsActionMenu : public QMenu
AttributeAction //!< Custom actions (manually defined in layer properties)
};
struct ActionData
struct GUI_EXPORT ActionData
{
ActionData();
ActionData( const QgsAction& action, QgsFeatureId featureId, QgsMapLayer* mapLayer );

View File

@ -1482,7 +1482,7 @@ void QgsAttributeForm::initPython()
QString form = QStringLiteral( "%1 = sip.wrapinstance( %2, qgis.gui.QgsAttributeForm )" )
.arg( mPyFormVarName )
.arg(( unsigned long ) this );
.arg(( quint64 ) this );
QgsPythonRunner::run( form );

View File

@ -33,7 +33,7 @@ QgsAttributeFormLegacyInterface::QgsAttributeFormLegacyInterface( const QString&
QString initLayer = QStringLiteral( "%1 = sip.wrapinstance( %2, qgis.core.QgsVectorLayer )" )
.arg( mPyLayerVarName )
.arg(( unsigned long ) form->layer() );
.arg(( quint64 ) form->layer() );
QgsPythonRunner::run( initLayer );
}
@ -61,7 +61,7 @@ void QgsAttributeFormLegacyInterface::featureChanged()
QString pyFeatureVarName = QStringLiteral( "_qgis_feature_%1" ).arg( dt.toString( QStringLiteral( "yyyyMMddhhmmsszzz" ) ) );
QString initFeature = QStringLiteral( "%1 = sip.wrapinstance( %2, qgis.core.QgsFeature )" )
.arg( pyFeatureVarName )
.arg(( unsigned long ) & form()->feature() );
.arg(( quint64 ) & form()->feature() );
QgsPythonRunner::run( initFeature );

View File

@ -80,7 +80,6 @@ class GUI_EXPORT QgsMapCanvas : public QGraphicsView
//! Constructor
QgsMapCanvas( QWidget * parent = nullptr );
~QgsMapCanvas();
//! Returns the magnification factor

View File

@ -39,13 +39,11 @@ class GUI_EXPORT QgsMapToolTouch : public QgsMapTool
void activate() override;
void deactivate() override;
virtual void canvasMoveEvent( QgsMapMouseEvent* e ) override;
virtual void canvasReleaseEvent( QgsMapMouseEvent* e ) override;
virtual void canvasDoubleClickEvent( QgsMapMouseEvent* e ) override;
virtual void canvasMoveEvent( QgsMapMouseEvent *e ) override;
virtual void canvasReleaseEvent( QgsMapMouseEvent *e ) override;
virtual void canvasDoubleClickEvent( QgsMapMouseEvent *e ) override;
virtual Flags flags() const override { return QgsMapTool::Transient | QgsMapTool::AllowZoomRect; }
bool gestureEvent( QGestureEvent *event ) override;
bool gestureEvent( QGestureEvent *e ) override;
private:

View File

@ -119,6 +119,8 @@ class GUI_EXPORT QgsTreeWidgetItem : public QTreeWidgetItem
virtual bool operator<( const QTreeWidgetItem &other ) const override;
bool operator>=( const QTreeWidgetItem &other ) const { return !( *this < other ); }
private:
enum ItemDataRole

View File

@ -37,7 +37,7 @@ class SymbolLayerItem;
/** \ingroup gui
* \class QgsLayerPropertiesWidget
*/
class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, protected QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
class GUI_EXPORT QgsLayerPropertiesWidget : public QgsPanelWidget, public QgsExpressionContextGenerator, private Ui::LayerPropertiesWidget
{
Q_OBJECT

View File

@ -70,7 +70,6 @@ TARGET_LINK_LIBRARIES(qgis_help
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
${QT_QTMAIN_LIBRARY}
${SQLITE3_LIBRARY}
)

View File

@ -352,7 +352,7 @@ bool QgsDb2FeatureIterator::fetchFeature( QgsFeature& feature )
if ( mSource->isSpatial() )
{
QByteArray ar = record.value( mSource->mGeometryColName ).toByteArray();
size_t wkb_size = ar.size();
int wkb_size = ar.size();
if ( 0 < wkb_size )
{
unsigned char* db2data = new unsigned char[wkb_size + 1]; // allocate persistent storage

View File

@ -38,6 +38,7 @@ ADD_LIBRARY(delimitedtextprovider MODULE ${DTEXT_SRCS} ${DTEXT_MOC_SRCS})
TARGET_LINK_LIBRARIES(delimitedtextprovider
qgis_core
qgis_gui
)
########################################################

View File

@ -39,7 +39,7 @@
#include <grass/raster.h>
#include <grass/display.h>
#ifdef _MSC_VER
#if defined(_MSC_VER) && _MSC_VER < 1900
#include <float.h>
#define INFINITY (DBL_MAX+DBL_MAX)
#define NAN (INFINITY-INFINITY)

View File

@ -432,14 +432,14 @@ bool QgsGrass::init( void )
QString msysBin = QCoreApplication::applicationDirPath() + "/msys/bin/";
if ( QFileInfo( msysBin ).isDir() )
{
mGrassModulesPaths << shortPath( QCoreApplication::applicationDirPath() + "/msys/bin/" );
sGrassModulesPaths << shortPath( QCoreApplication::applicationDirPath() + "/msys/bin/" );
}
#endif
//QString p = getenv( "PATH" );
//path.append( sep + p );
QgsDebugMsg( "mGrassModulesPaths = " + sGrassModulesPaths.join( "," ) );
QgsDebugMsg( "sGrassModulesPaths = " + sGrassModulesPaths.join( "," ) );
//putEnv( "PATH", path );
// TODO: move where it is required for QProcess
@ -2961,7 +2961,7 @@ void QgsGrass::vectDestroyMapStruct( struct Map_info *map )
// TODO: replace by Vect_destroy_map_struct once it appears in GRASS
// TODO: until switch to hypothetical Vect_destroy_map_struct verify that Vect_destroy_map_struct cannot
// call G_fatal_error, otherwise check and remove use of vectDestroyMapStruct from G_CATCH blocks
QgsDebugMsg( QString( "free map = %1" ).arg(( long )map ) );
QgsDebugMsg( QString( "free map = %1" ).arg(( quint64 )map ) );
qgsFree( map );
map = 0;
}

View File

@ -682,7 +682,7 @@ QgsAbstractGeometry * QgsGrassVectorMap::areaGeometry( int id )
QgsPolygonV2 * polygon = new QgsPolygonV2();
struct line_pnts *points = Vect_new_line_struct();
QgsDebugMsgLevel( QString( "points= %1" ).arg(( long )points ), 3 );
QgsDebugMsgLevel( QString( "points= %1" ).arg(( quint64 )points ), 3 );
// Vect_get_area_points and Vect_get_isle_pointsis using static variable -> lock
// TODO: Faster to lock the whole feature iterator? Maybe only for areas?
QgsGrass::lock();

View File

@ -2101,8 +2101,8 @@ QString createFilters( const QString& type )
{
sDatabaseDrivers += QObject::tr( "ESRI Personal GeoDatabase" ) + ",PGeo;";
#ifdef Q_OS_WIN
myFileFilters += createFileFilter_( QObject::tr( "ESRI Personal GeoDatabase" ), "*.mdb" );
myExtensions << "mdb";
sFileFilters += createFileFilter_( QObject::tr( "ESRI Personal GeoDatabase" ), "*.mdb" );
sExtensions << "mdb";
#endif
}
else if ( driverName.startsWith( QLatin1String( "SDE" ) ) )

View File

@ -62,7 +62,7 @@ template <typename T> class QVector;
class QSqlCachedResultPrivate;
class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult
class /* Q_SQL_EXPORT */ QSqlCachedResult: public QSqlResult
{
public:
virtual ~QSqlCachedResult() {}

View File

@ -62,7 +62,7 @@ template <typename T> class QVector;
class QSqlCachedResultPrivate;
class Q_SQL_EXPORT QSqlCachedResult: public QSqlResult
class /* Q_SQL_EXPORT */ QSqlCachedResult: public QSqlResult
{
public:
virtual ~QSqlCachedResult() {}

View File

@ -118,7 +118,7 @@ void QgsTileScaleWidget::showTileScale( QMainWindow *mainWindow )
}
QgsMapCanvas *canvas = mainWindow->findChild<QgsMapCanvas *>( QStringLiteral( "theMapCanvas" ) );
QgsDebugMsg( QString( "canvas:%1 [%2]" ).arg(( ulong ) canvas, 0, 16 ).arg( canvas ? canvas->objectName() : "" ) );
QgsDebugMsg( QString( "canvas:%1 [%2]" ).arg(( quint64 ) canvas, 0, 16 ).arg( canvas ? canvas->objectName() : "" ) );
if ( !canvas )
{
QgsDebugMsg( "map canvas theMapCanvas not found" );

View File

@ -74,7 +74,7 @@ bool QgsPythonUtilsImpl::checkSystemImports()
#ifdef Q_OS_WIN
runString( "oldhome=None" );
runString( "if os.environ.has_key('HOME'): oldhome=os.environ['HOME']\n" );
runString( "if 'HOME' in os.environ: oldhome=os.environ['HOME']\n" );
runString( "os.environ['HOME']=os.environ['USERPROFILE']\n" );
#endif
@ -238,7 +238,7 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
return;
}
// initialize 'iface' object
runString( "qgis.utils.initInterface(" + QString::number(( unsigned long ) interface ) + ')' );
runString( "qgis.utils.initInterface(" + QString::number(( quint64 ) interface ) + ')' );
if ( !checkQgisUser() )
{
exitPython();
@ -268,7 +268,7 @@ void QgsPythonUtilsImpl::initServerPython( QgsServerInterface* interface )
}
// This is the other main difference with initInterface() for desktop plugins
runString( "qgis.utils.initServerInterface(" + QString::number(( unsigned long ) interface ) + ')' );
runString( "qgis.utils.initServerInterface(" + QString::number(( quint64 ) interface ) + ')' );
doCustomImports();
finish();

View File

@ -11,7 +11,7 @@ IF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
ENDIF (CMAKE_BUILD_TYPE MATCHES Debug OR CMAKE_BUILD_TYPE MATCHES RelWithDebInfo)
IF (ENABLE_TESTS)
ADD_DEFINITIONS(-DENABLE_MS_TESTS=1)
ADD_DEFINITIONS(-DENABLE_MS_TESTS=1)
ENDIF (ENABLE_TESTS)
ADD_SUBDIRECTORY(services)
@ -19,8 +19,7 @@ ADD_SUBDIRECTORY(services)
########################################################
# Files
SET ( qgis_mapserv_SRCS
qgis_map_serv.cpp
SET(qgis_mapserv_SRCS
qgscapabilitiescache.cpp
qgsconfigcache.cpp
qgsrequesthandler.cpp
@ -55,40 +54,19 @@ SET ( qgis_mapserv_SRCS
qgsserverinterface.cpp
qgsserverinterfaceimpl.cpp
qgsfilterrestorer.cpp
#----------------------------
)
IF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
SET (qgis_mapserv_SRCS ${qgis_mapserv_SRCS}
qgsftptransaction.cpp
)
ENDIF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
# SET (qgis_mapserv_UIS
# none used
# )
SET (qgis_mapserv_MOC_HDRS
qgscapabilitiescache.h
qgsconfigcache.h
# qgshttptransaction.h
# qgshttptransaction.h
# qgsftptransaction.cpp
qgsmslayercache.h
qgsserverlogger.h
qgsserversettings.h
)
IF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
SET (qgis_mapserv_MOC_HDRS ${qgis_mapserv_MOC_HDRS}
qgsftptransaction.h
)
ENDIF("${Qt5Network_VERSION}" VERSION_LESS "5.0.0")
SET (qgis_mapserv_RCCS
# not used
#qgis_mapserv.qrc
)
#############################################################
# qgis_server library
@ -96,14 +74,13 @@ SET (qgis_mapserv_RCCS
SET(qgis_mapserv_MOC_HDRS ${qgis_mapserv_MOC_HDRS})
IF (WITH_SERVER_PLUGINS)
SET(qgis_mapserv_SRCS ${qgis_mapserv_SRCS}
SET(qgis_mapserv_SRCS ${qgis_mapserv_SRCS}
qgsserverplugins.cpp
qgsserverfilter.cpp
qgsaccesscontrolfilter.cpp
qgsaccesscontrol.cpp
)
)
ENDIF (WITH_SERVER_PLUGINS)
QT5_WRAP_CPP(qgis_mapserv_MOC_SRCS ${qgis_mapserv_MOC_HDRS})
@ -114,77 +91,6 @@ ELSE(MSVC)
SET_SOURCE_FILES_PROPERTIES(${qgis_mapserv_MOC_SRCS} PROPERTIES COMPILE_FLAGS "-Wno-deprecated-declarations" )
ENDIF(MSVC)
ADD_LIBRARY(qgis_server SHARED ${qgis_mapserv_SRCS} ${qgis_mapserv_MOC_SRCS} ${qgis_mapserv_HDRS} ${qgis_mapserv_MOC_HDRS})
GENERATE_EXPORT_HEADER(
qgis_server
BASE_NAME SERVER
EXPORT_FILE_NAME qgis_server.h
)
#generate unversioned libs for android
IF (NOT ANDROID)
SET_TARGET_PROPERTIES(qgis_server PROPERTIES
VERSION ${COMPLETE_VERSION}
SOVERSION ${COMPLETE_VERSION}
)
ENDIF (NOT ANDROID)
TARGET_LINK_LIBRARIES(qgis_server
qgis_core
qgis_gui
qgis_analysis
${PROJ_LIBRARY}
${FCGI_LIBRARY}
${POSTGRES_LIBRARY}
${GDAL_LIBRARY}
${QCA_LIBRARY}
)
IF (WITH_BINDINGS)
TARGET_LINK_LIBRARIES(qgis_server
qgispython
)
ENDIF(WITH_BINDINGS)
IF (APPLE)
SET_TARGET_PROPERTIES(qgis_server PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF (APPLE)
# install
INSTALL(TARGETS qgis_server
RUNTIME DESTINATION ${QGIS_BIN_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR}
ARCHIVE DESTINATION ${QGIS_LIB_DIR}
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR}
PUBLIC_HEADER DESTINATION ${QGIS_INCLUDE_DIR})
INCLUDE_DIRECTORIES(
../python
)
# end qgis_server library
QT5_WRAP_UI (qgis_mapserv_UIS_H ${qgis_mapserv_UIS})
QT5_ADD_RESOURCES(qgis_mapserv_RCC_SRCS ${qgis_mapserv_RCCS})
# add test resources, e.g. standard test font
SET(qgis_mapserv_TESTRCCS ../../tests/testdata/testdata.qrc)
QT5_ADD_RESOURCES(qgis_mapserv_TESTRCC_SRCS ${qgis_mapserv_TESTRCCS})
ADD_EXECUTABLE(qgis_mapserv.fcgi
${qgis_mapserv_SRCS}
${qgis_mapserv_MOC_SRCS}
${qgis_mapserv_RCC_SRCS}
${qgis_mapserv_UIS_H}
${qgis_mapserv_TESTRCC_SRCS}
)
INCLUDE_DIRECTORIES(SYSTEM
${GDAL_INCLUDE_DIR}
${FCGI_INCLUDE_DIR}
@ -219,10 +125,27 @@ INCLUDE_DIRECTORIES(
../gui/editorwidgets/core
../analysis/interpolation
../plugins/diagram_overlay
../python
.
)
TARGET_LINK_LIBRARIES(qgis_mapserv.fcgi
ADD_LIBRARY(qgis_server SHARED ${qgis_mapserv_SRCS} ${qgis_mapserv_MOC_SRCS} ${qgis_mapserv_HDRS} ${qgis_mapserv_MOC_HDRS})
GENERATE_EXPORT_HEADER(
qgis_server
BASE_NAME SERVER
EXPORT_FILE_NAME qgis_server.h
)
#generate unversioned libs for android
IF (NOT ANDROID)
SET_TARGET_PROPERTIES(qgis_server PROPERTIES
VERSION ${COMPLETE_VERSION}
SOVERSION ${COMPLETE_VERSION}
)
ENDIF (NOT ANDROID)
TARGET_LINK_LIBRARIES(qgis_server
qgis_core
qgis_gui
qgis_analysis
@ -233,6 +156,35 @@ TARGET_LINK_LIBRARIES(qgis_mapserv.fcgi
${QCA_LIBRARY}
)
IF (WITH_BINDINGS)
TARGET_LINK_LIBRARIES(qgis_server qgispython)
ENDIF(WITH_BINDINGS)
IF (APPLE)
SET_TARGET_PROPERTIES(qgis_server PROPERTIES BUILD_WITH_INSTALL_RPATH TRUE)
ENDIF (APPLE)
# install
INSTALL(TARGETS qgis_server
RUNTIME DESTINATION ${QGIS_BIN_DIR}
LIBRARY DESTINATION ${QGIS_LIB_DIR}
ARCHIVE DESTINATION ${QGIS_LIB_DIR}
FRAMEWORK DESTINATION ${QGIS_FW_SUBDIR}
PUBLIC_HEADER DESTINATION ${QGIS_INCLUDE_DIR}
)
# end qgis_server library
# add test resources, e.g. standard test font
SET(qgis_mapserv_TESTRCCS ../../tests/testdata/testdata.qrc)
QT5_ADD_RESOURCES(qgis_mapserv_TESTRCC_SRCS ${qgis_mapserv_TESTRCCS})
ADD_EXECUTABLE(qgis_mapserv.fcgi qgis_map_serv.cpp ${qgis_mapserv_TESTRCC_SRCS})
TARGET_LINK_LIBRARIES(qgis_mapserv.fcgi qgis_server)
########################################################
# Install
@ -241,10 +193,10 @@ INSTALL(CODE "MESSAGE(\"Installing server...\")")
INSTALL(TARGETS
qgis_mapserv.fcgi
DESTINATION ${QGIS_CGIBIN_DIR}
)
)
INSTALL(FILES
admin.sld
wms_metadata.xml
schemaExtension.xsd
DESTINATION ${QGIS_CGIBIN_DIR}
)
)

View File

@ -24,12 +24,13 @@
#include <QFileSystemWatcher>
#include <QMap>
#include <QObject>
#include "qgis_server.h"
#include "qgswmsconfigparser.h"
#include "qgswfsprojectparser.h"
#include "qgswcsprojectparser.h"
class QgsServerProjectParser;
class QgsWCSProjectParser;
class QgsWfsProjectParser;
class QgsWmsConfigParser;
class QgsAccessControl;
class QDomDocument;

View File

@ -29,7 +29,7 @@
* QgsFcgiServerResponse
* Class defining fcgi response
*/
class QgsFcgiServerResponse: public QgsServerResponse
class SERVER_EXPORT QgsFcgiServerResponse: public QgsServerResponse
{
public:
@ -76,7 +76,7 @@ class QgsFcgiServerResponse: public QgsServerResponse
* QgsFcgiServerResquest
* Class defining fcgi request
*/
class QgsFcgiServerRequest: public QgsServerRequest
class SERVER_EXPORT QgsFcgiServerRequest: public QgsServerRequest
{
public:
QgsFcgiServerRequest();

View File

@ -27,7 +27,7 @@
// Initialize static members
QgsPythonUtils* QgsServerPlugins::sPythonUtils;
QgsPythonUtils *QgsServerPlugins::sPythonUtils;
QgsServerPlugins::QgsServerPlugins()
@ -45,7 +45,6 @@ QStringList &QgsServerPlugins::serverPlugins()
// This code is mainly borrowed from QGIS desktop Python plugin initialization
bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
{
QString pythonlibName( QStringLiteral( "qgispython" ) );
#if defined(Q_OS_MAC) || defined(Q_OS_LINUX)
pythonlibName.prepend( QgsApplication::libraryPath() );
@ -95,11 +94,9 @@ bool QgsServerPlugins::initPlugins( QgsServerInterface *interface )
//Init plugins: loads a list of installed plugins and filter them
//for "server" metadata
QListIterator<QString> plugins( sPythonUtils->pluginList() );
bool atLeastOneEnabled = false;
while ( plugins.hasNext() )
Q_FOREACH ( const QString &pluginName, sPythonUtils->pluginList() )
{
QString pluginName = plugins.next();
QString pluginService = sPythonUtils->getPluginMetadata( pluginName, QStringLiteral( "server" ) );
if ( pluginService == QLatin1String( "True" ) )
{

View File

@ -20,7 +20,6 @@
#include "qgsrequesthandler.h"
#include "qgsserverinterface.h"
#include "qgis_server.h"
// This is needed by SIP otherwise it doesn't find QgsPythonUtils header
class QgsPythonUtils;

View File

@ -21,10 +21,10 @@
#include "qgsmessagelog.h"
#include "qgsserverexception.h"
//! constructor
QgsServerResponse::QgsServerResponse()
{
}
@ -92,4 +92,3 @@ void QgsServerResponse::write( const QgsServerException& ex )
write( ba );
}

View File

@ -31,7 +31,7 @@
* currently supported for configuration.
* @note added in QGIS 3.0
*/
class QgsServerSettingsEnv : public QObject
class SERVER_EXPORT QgsServerSettingsEnv : public QObject
{
Q_OBJECT

View File

@ -17,9 +17,9 @@
* *
***************************************************************************/
#include "qgsservice.h"
//! Constructor
QgsService::QgsService()
{

View File

@ -23,7 +23,6 @@
#include "qgsserverrequest.h"
#include "qgsserverresponse.h"
#include "qgis_server.h"
class QgsProject;

View File

@ -17,10 +17,9 @@
* *
***************************************************************************/
#include "qgsservicemodule.h"
//! Constructor
QgsServiceModule::QgsServiceModule()
{

View File

@ -25,6 +25,7 @@
#include <algorithm>
#include <functional>
namespace
{
@ -82,7 +83,6 @@ namespace
QgsServiceRegistry::QgsServiceRegistry()
{
}
QgsServiceRegistry::~QgsServiceRegistry()

View File

@ -24,6 +24,7 @@
#include "qgsaccesscontrol.h"
#include "qgslogger.h"
QgsWfsProjectParser::QgsWfsProjectParser(
const QString& filePath
, const QgsAccessControl* ac

View File

@ -15,6 +15,8 @@
* *
***************************************************************************/
#include "qgis_server.h"
#include "qgswmsconfigparser.h"
#include "qgsmaplayer.h"
#include "qgsproject.h"
@ -36,9 +38,9 @@
#include "qgsvectordataprovider.h"
#include "qgsvectorlayer.h"
QgsWmsConfigParser::QgsWmsConfigParser()
{
}
QgsComposition* QgsWmsConfigParser::createPrintComposition( const QString& composerTemplate, const QgsMapSettings& mapSettings, const QMap< QString, QString >& parameterMap, QStringList& highlightLayers ) const

View File

@ -92,15 +92,6 @@
</item>
<item row="0" column="1">
<widget class="QSpinBox" name="minimumSpinBox">
<property name="minimum">
<number>2147483648</number>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
<property name="value">
<number>2147483648</number>
</property>
</widget>
</item>
<item row="1" column="0">
@ -112,15 +103,6 @@
</item>
<item row="1" column="1">
<widget class="QSpinBox" name="maximumSpinBox">
<property name="minimum">
<number>2147483648</number>
</property>
<property name="maximum">
<number>2147483647</number>
</property>
<property name="value">
<number>2147483647</number>
</property>
</widget>
</item>
<item row="2" column="0">
@ -132,12 +114,6 @@
</item>
<item row="2" column="1">
<widget class="QSpinBox" name="stepSpinBox">
<property name="maximum">
<number>2147483647</number>
</property>
<property name="value">
<number>1</number>
</property>
</widget>
</item>
</layout>

View File

@ -37,7 +37,6 @@ TARGET_LINK_LIBRARIES(qgis_bench
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
${QT_QTMAIN_LIBRARY}
${QT_QTTEST_LIBRARY}
)

View File

@ -345,7 +345,7 @@ int main( int argc, char *argv[] )
}
else
{
myFileList.append( QDir::toNativeSeparators( QFileInfo( QFile::decodeName( argv[i] ) ).absoluteFilePath() ) );
sFileList.append( QDir::toNativeSeparators( QFileInfo( QFile::decodeName( argv[i] ) ).absoluteFilePath() ) );
}
}
#endif // Q_OS_WIN

View File

@ -106,7 +106,6 @@ MACRO (ADD_QGIS_TEST testname testsrc)
${QT_QTTEST_LIBRARY}
${QT_QTNETWORK_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
${QT_QTMAIN_LIBRARY}
${PROJ_LIBRARY}
${GEOS_LIBRARY}
${GDAL_LIBRARY}

View File

@ -135,7 +135,6 @@ IF(UNIX AND NOT ANDROID AND CMAKE_BUILD_TYPE MATCHES Debug)
${QT_QTSVG_LIBRARY}
${QT_QTXML_LIBRARY}
${QT_QTWEBKIT_LIBRARY}
${QT_QTMAIN_LIBRARY}
${QT_QTSCRIPT_LIBRARY}
qgis_core
)

View File

@ -1,5 +1,3 @@
ADD_DEFINITIONS("-DGRASS_EXPORT=${DLLIMPORT} -DGRASS_LIB_EXPORT=${DLLIMPORT}")
INCLUDE_DIRECTORIES(
${CMAKE_SOURCE_DIR}/src/providers/grass
)