Add forgotten Qextserialport patch

This commit is contained in:
Volker Fröhlich 2012-11-08 01:07:45 +01:00
parent 14f808f149
commit 26e6e12e13

View File

@ -0,0 +1,236 @@
diff -Nur qgis-1.8.0/cmake/FindQextserialport.cmake qgis-1.8.0-qextserialport/cmake/FindQextserialport.cmake
--- qgis-1.8.0/cmake/FindQextserialport.cmake 1970-01-01 01:00:00.000000000 +0100
+++ qgis-1.8.0-qextserialport/cmake/FindQextserialport.cmake 2012-11-02 20:40:57.854520284 +0100
@@ -0,0 +1,43 @@
+# Find Qextserialport
+# ~~~~~~~~
+# Copyright (c) 2011, Jürgen E. Fischer <jef at norbit.de>
+#
+# Redistribution and use is allowed according to the terms of the BSD license.
+# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
+#
+# Once run this will define:
+#
+# QEXTSERIALPORT_FOUND = system has Qextserialport lib
+# QEXTSERIALPORT_LIBRARY = full path to the Qextserialport library
+# QEXTSERIALPORT_INCLUDE_DIR = where to find headers
+#
+
+
+FIND_PATH(QEXTSERIALPORT_INCLUDE_DIR NAMES qextserialport.h PATHS
+ /usr/include
+ /usr/local/include
+ "$ENV{LIB_DIR}/include"
+ "$ENV{INCLUDE}"
+ PATH_SUFFIXES QtExtSerialPort
+ )
+
+FIND_LIBRARY(QEXTSERIALPORT_LIBRARY NAMES qextserialport-1.2 PATHS
+ /usr/lib
+ /usr/local/lib
+ "$ENV{LIB_DIR}/lib"
+ "$ENV{LIB}/lib"
+ )
+
+IF (QEXTSERIALPORT_INCLUDE_DIR AND QEXTSERIALPORT_LIBRARY)
+ SET(QEXTSERIALPORT_FOUND TRUE)
+ENDIF (QEXTSERIALPORT_INCLUDE_DIR AND QEXTSERIALPORT_LIBRARY)
+
+IF (QEXTSERIALPORT_FOUND)
+ IF (NOT QEXTSERIALPORT_FIND_QUIETLY)
+ MESSAGE(STATUS "Found Qextserialport: ${QEXTSERIALPORT_LIBRARY}")
+ ENDIF (NOT QEXTSERIALPORT_FIND_QUIETLY)
+ELSE (QEXTSERIALPORT_FOUND)
+ IF (QEXTSERIALPORT_FIND_REQUIRED)
+ MESSAGE(FATAL_ERROR "Could not find Qextserialport")
+ ENDIF (QEXTSERIALPORT_FIND_REQUIRED)
+ENDIF (QEXTSERIALPORT_FOUND)
diff -Nur qgis-1.8.0/CMakeLists.txt qgis-1.8.0-qextserialport/CMakeLists.txt
--- qgis-1.8.0/CMakeLists.txt 2012-06-12 21:28:18.000000000 +0200
+++ qgis-1.8.0-qextserialport/CMakeLists.txt 2012-11-02 21:04:28.013021635 +0100
@@ -55,6 +55,8 @@
SET (WITH_INTERNAL_QWTPOLAR TRUE CACHE BOOL "Use internal build of QwtPolar")
+SET (WITH_INTERNAL_QEXTSERIALPORT TRUE CACHE BOOL "Use internal build of Qextserialport")
+
SET (WITH_SPATIALITE TRUE CACHE BOOL "Determines whether SPATIALITE support should be built")
IF (WITH_SPATIALITE)
SET (WITH_INTERNAL_SPATIALITE FALSE CACHE BOOL "Determines whether SPATIALITE support should be built internally")
@@ -174,6 +176,10 @@
FIND_PACKAGE(QwtPolar REQUIRED)
ENDIF(NOT WITH_INTERNAL_QWTPOLAR)
+IF (NOT WITH_INTERNAL_QEXTSERIALPORT)
+ FIND_PACKAGE(Qextserialport REQUIRED)
+ENDIF(NOT WITH_INTERNAL_QEXTSERIALPORT)
+
IF (NOT WITH_INTERNAL_SPATIALITE)
FIND_PACKAGE(Sqlite3)
IF (NOT SQLITE3_FOUND)
diff -Nur qgis-1.8.0/python/CMakeLists.txt qgis-1.8.0-qextserialport/python/CMakeLists.txt
--- qgis-1.8.0/python/CMakeLists.txt 2012-06-12 21:28:18.000000000 +0200
+++ qgis-1.8.0-qextserialport/python/CMakeLists.txt 2012-11-02 20:49:38.101851101 +0100
@@ -14,6 +14,16 @@
)
ENDIF (WITH_INTERNAL_SPATIALITE)
+IF (WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(
+ ../src/core/gps/qextserialport
+ )
+ELSE (WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(
+ ${QEXTSERIALPORT_INCLUDE_DIR}
+ )
+ENDIF (WITH_INTERNAL_QEXTSERIALPORT)
+
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
@@ -31,7 +41,6 @@
../src/core
../src/core/composer
../src/core/gps
- ../src/core/gps/qextserialport
../src/core/raster
../src/core/renderer
../src/core/symbology
diff -Nur qgis-1.8.0/src/app/CMakeLists.txt qgis-1.8.0-qextserialport/src/app/CMakeLists.txt
--- qgis-1.8.0/src/app/CMakeLists.txt 2012-06-12 21:28:18.000000000 +0200
+++ qgis-1.8.0-qextserialport/src/app/CMakeLists.txt 2012-11-02 22:29:40.327221781 +0100
@@ -394,7 +394,7 @@
${QT_QTUITOOLS_INCLUDE_DIR}
../analysis/raster
../core
- ../core/gps ../core/gps/qextserialport
+ ../core/gps
../core/composer ../core/raster ../core/renderer ../core/symbology ../core/symbology-ng
../gui ../gui/symbology-ng ../gui/attributetable
../plugins
@@ -402,6 +402,17 @@
gps
)
+IF (WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(
+ ../core/gps/qextserialport
+ )
+ELSE (WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(
+ ${QEXTSERIALPORT_INCLUDE_DIR}
+ )
+ENDIF (WITH_INTERNAL_QEXTSERIALPORT)
+
+
IF (ANDROID)
INCLUDE_DIRECTORIES(${ANDROID_NDK_TOOLCHAIN_ROOT}/sysroot/usr/include)
ENDIF (ANDROID)
diff -Nur qgis-1.8.0/src/core/CMakeLists.txt qgis-1.8.0-qextserialport/src/core/CMakeLists.txt
--- qgis-1.8.0/src/core/CMakeLists.txt 2012-06-12 21:28:18.000000000 +0200
+++ qgis-1.8.0-qextserialport/src/core/CMakeLists.txt 2012-11-02 22:21:00.757952769 +0100
@@ -5,9 +5,6 @@
SET(QGIS_CORE_SRCS
- gps/qextserialport/qextserialport.cpp
- gps/qextserialport/qextserialenumerator.cpp
-
gps/qgsgpsconnection.cpp
gps/qgsgpsconnectionregistry.cpp
gps/qgsnmeaconnection.cpp
@@ -184,10 +181,14 @@
)
ADD_DEFINITIONS(-D_TTY_WIN_)
ELSE(WIN32)
- SET(QGIS_CORE_SRCS
- ${QGIS_CORE_SRCS}
- gps/qextserialport/posix_qextserialport.cpp
- )
+ IF (WITH_INTERNAL_QEXTSERIALPORT)
+ SET(QGIS_CORE_SRCS
+ ${QGIS_CORE_SRCS}
+ gps/qextserialport/qextserialport.cpp
+ gps/qextserialport/qextserialenumerator.cpp
+ gps/qextserialport/posix_qextserialport.cpp
+ )
+ ENDIF (WITH_INTERNAL_QEXTSERIALPORT)
ADD_DEFINITIONS(-D_TTY_POSIX_)
ENDIF(WIN32)
@@ -198,6 +199,7 @@
)
ENDIF (QT_MOBILITY_LOCATION_FOUND)
+
IF (WITH_INTERNAL_SPATIALITE)
IF (WIN32 OR APPLE OR ANDROID)
INCLUDE_DIRECTORIES(${ICONV_INCLUDE_DIR})
@@ -277,10 +279,15 @@
gps/qgsgpsdetector.h
gps/qgsnmeaconnection.h
gps/qgsgpsdconnection.h
- gps/qextserialport/qextserialport.h
- gps/qextserialport/qextserialenumerator.h
)
+IF (WITH_INTERNAL_QEXTSERIALPORT)
+ SET(QGIS_CORE_MOC_HDRS
+ ${QGIS_CORE_MOC_HDRS}
+ gps/qextserialport/qextserialport.h
+ gps/qextserialport/qextserialenumerator.h
+ )
+ENDIF (WITH_INTERNAL_QEXTSERIALPORT)
IF (QT_MOBILITY_LOCATION_FOUND)
SET(QGIS_CORE_MOC_HDRS
@@ -435,6 +442,10 @@
INCLUDE_DIRECTORIES(${SQLITE3_INCLUDE_DIR})
ENDIF (NOT WITH_INTERNAL_SPATIALITE)
+IF (NOT WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(${QEXTSERIALPORT_INCLUDE_DIR})
+ENDIF (NOT WITH_INTERNAL_QEXTSERIALPORT)
+
IF (WIN32)
IF (MSVC)
ADD_DEFINITIONS("-DCORE_EXPORT=__declspec(dllexport)")
@@ -503,6 +514,10 @@
${SPATIALINDEX_LIBRARY}
)
+IF (NOT WITH_INTERNAL_QEXTSERIALPORT)
+ TARGET_LINK_LIBRARIES(qgis_core ${QEXTSERIALPORT_LIBRARY})
+ENDIF (NOT WITH_INTERNAL_QEXTSERIALPORT)
+
IF (WITH_INTERNAL_SPATIALITE)
IF (WIN32 OR APPLE)
TARGET_LINK_LIBRARIES(qgis_core ${ICONV_LIBRARY})
diff -Nur qgis-1.8.0/src/plugins/gps_importer/CMakeLists.txt qgis-1.8.0-qextserialport/src/plugins/gps_importer/CMakeLists.txt
--- qgis-1.8.0/src/plugins/gps_importer/CMakeLists.txt 2012-06-12 21:28:18.000000000 +0200
+++ qgis-1.8.0-qextserialport/src/plugins/gps_importer/CMakeLists.txt 2012-11-02 20:50:24.924541164 +0100
@@ -37,13 +37,23 @@
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
- ../../core ../../core/gps ../../core/gps/qextserialport
+ ../../core ../../core/gps
../../gui
..
${EXPAT_INCLUDE_DIR}
)
+IF (WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(
+ ../../core/gps/qextserialport
+ )
+ELSE (WITH_INTERNAL_QEXTSERIALPORT)
+ INCLUDE_DIRECTORIES(
+ ${QEXTSERIALPORT_INCLUDE_DIR}
+ )
+ENDIF (WITH_INTERNAL_QEXTSERIALPORT)
+
TARGET_LINK_LIBRARIES(gpsimporterplugin
qgis_core
qgis_gui