Skip to content
Permalink
Browse files

Merge pull request #3803 from dakcarto/qt5py3-more-mac-fixes

  • Loading branch information
dakcarto committed Nov 29, 2016
2 parents c147ee2 + 8c8db0e commit fe8dfe1c1c63dbc1c4bc69f4dfd1798cf8d15203
@@ -4,6 +4,34 @@
# Redistribution and use is allowed according to the terms of the BSD license.
# For details see the accompanying COPYING-CMAKE-SCRIPTS file.

# Macro that checks for extra include directories set during GRASS compilation.
# This helps for platforms where GRASS is built against dependencies in
# non-standard locations; like on Mac, where the system gettext is too old and
# GRASS is built off of gettext in /usr/local/opt, or some other custom prefix.
# Such includes may need found again when including some GRASS headers.

MACRO (CHECK_GRASS_EXTRA_INCLUDE_DIRS GRASS_VERSION)
SET(GRASS_EXTRA_INCLUDE_DIRS${GRASS_VERSION} ""
CACHE STRING "Extra includes string used for GRASS${GRASS_VERSION}")

IF(UNIX AND EXISTS ${GRASS_INCLUDE_DIR${GRASS_VERSION}}/Make/Platform.make
AND "${GRASS${GRASS_VERSION}_EXTRA_INCLUDE_DIRS}" STREQUAL "")

FILE(READ ${GRASS_INCLUDE_DIR${GRASS_VERSION}}/Make/Platform.make _platformfile)
STRING(REGEX MATCH "INCLUDE_DIRS *= *[^\n]*" _config_includes "${_platformfile}")
SET(_extra_includes "")
IF(NOT "${_config_includes}" STREQUAL "")
STRING(REGEX REPLACE "INCLUDE_DIRS *= *([^\n]*)" "\\1" _extra_includes "${_config_includes}")
ENDIF()
IF(NOT "${_extra_includes}" STREQUAL "")
SET(GRASS_EXTRA_INCLUDE_DIRS${GRASS_VERSION} ${_extra_includes}
CACHE STRING "Extra includes string used for GRASS${GRASS_VERSION}" FORCE)
ENDIF()
ENDIF()

MARK_AS_ADVANCED (GRASS_EXTRA_INCLUDE_DIRS${GRASS_VERSION})
ENDMACRO (CHECK_GRASS_EXTRA_INCLUDE_DIRS GRASS_VERSION)

# macro that checks for grass installation in specified directory

MACRO (CHECK_GRASS G_PREFIX)
@@ -108,10 +136,12 @@ MACRO (CHECK_GRASS G_PREFIX)
SET(GRASS_FOUND${GRASS_FIND_VERSION} TRUE)
SET(GRASS_FOUND TRUE) # GRASS_FOUND is true if at least one version was found
SET(GRASS_PREFIX${GRASS_CACHE_VERSION} ${G_PREFIX})
CHECK_GRASS_EXTRA_INCLUDE_DIRS(${GRASS_CACHE_VERSION})
IF(GRASS_FIND_VERSION EQUAL 6)
# Set also normal variable with number
SET(GRASS_INCLUDE_DIR${GRASS_FIND_VERSION} ${GRASS_INCLUDE_DIR${GRASS_CACHE_VERSION}})
SET(GRASS_PREFIX${GRASS_FIND_VERSION} ${G_PREFIX})
CHECK_GRASS_EXTRA_INCLUDE_DIRS(${GRASS_FIND_VERSION})
ENDIF(GRASS_FIND_VERSION EQUAL 6)
ENDIF(GRASS_LIBRARIES_FOUND${GRASS_FIND_VERSION})
ENDIF(GRASS_MAJOR_VERSION${GRASS_FIND_VERSION} EQUAL GRASS_FIND_VERSION)
@@ -31,16 +31,15 @@ else(QCA_INCLUDE_DIR AND QCA_LIBRARY)
/usr/local/lib
)

if(APPLE)
if(QCA_LIBRARY AND QCA_LIBRARY MATCHES "qca(2)?-qt5\\.framework")
set(QCA_LIBRARY "${QCA_LIBRARY}" CACHE FILEPATH "QCA framework" FORCE)
set(QCA_INCLUDE_DIR "${QCA_LIBRARY}/Headers" CACHE FILEPATH "QCA framework headers" FORCE)
endif()
endif(APPLE)
set(_qca_fw)
if(QCA_LIBRARY MATCHES "/qca.*\\.framework")
string(REGEX REPLACE "^(.*/qca.*\\.framework).*$" "\\1" _qca_fw "${QCA_LIBRARY}")
endif()

find_path(QCA_INCLUDE_DIR
NAMES QtCrypto
PATHS
"${_qca_fw}/Headers"
${LIB_DIR}/include
"$ENV{LIB_DIR}/include"
$ENV{INCLUDE}
@@ -24,16 +24,14 @@ IF(EXISTS QSCINTILLA_VERSION_STR)
SET(QSCINTILLA_FOUND TRUE)
ELSE(EXISTS QSCINTILLA_VERSION_STR)

FIND_PATH(QSCINTILLA_INCLUDE_DIR
NAMES Qsci/qsciglobal.h
PATHS
${Qt5Core_INCLUDE_DIRS}
"${QT_INCLUDE_DIR}"
/usr/local/include
/usr/include
)

set(QSCINTILLA_LIBRARY_NAMES qscintilla2-qt5 libqt5scintilla2 libqscintilla2-qt5 qt5scintilla2 libqscintilla2-qt5.dylib)
set(QSCINTILLA_LIBRARY_NAMES
qscintilla2-qt5
libqt5scintilla2
libqscintilla2-qt5
qt5scintilla2
libqscintilla2-qt5.dylib
qscintilla2
)

find_library(QSCINTILLA_LIBRARY
NAMES ${QSCINTILLA_LIBRARY_NAMES}
@@ -43,6 +41,21 @@ ELSE(EXISTS QSCINTILLA_VERSION_STR)
/usr/lib
)

set(_qsci_fw)
if(QSCINTILLA_LIBRARY MATCHES "/qscintilla.*\\.framework")
string(REGEX REPLACE "^(.*/qscintilla.*\\.framework).*$" "\\1" _qsci_fw "${QSCINTILLA_LIBRARY}")
endif()

FIND_PATH(QSCINTILLA_INCLUDE_DIR
NAMES Qsci/qsciglobal.h
PATHS
"${_qsci_fw}/Headers"
${Qt5Core_INCLUDE_DIRS}
"${QT_INCLUDE_DIR}"
/usr/local/include
/usr/include
)

IF(QSCINTILLA_LIBRARY AND QSCINTILLA_INCLUDE_DIR)
SET(QSCINTILLA_FOUND TRUE)

@@ -35,7 +35,7 @@ ELSE(EXISTS QSCI_MOD_VERSION_STR)
IF(QSCI_FOUND)
FIND_PATH(QSCI_SIP_DIR
NAMES Qsci/qscimod5.sip
PATHS ${PYQT5_SIP_DIR}
PATHS ${PYQT5_SIP_DIR} ${SIP_DEFAULT_SIP_DIR}
)

IF(NOT QSCI_FIND_QUIETLY)
@@ -12,15 +12,7 @@
#


FIND_PATH(QWT_INCLUDE_DIR NAMES qwt.h PATHS
/usr/include
/usr/local/include
"$ENV{LIB_DIR}/include"
"$ENV{INCLUDE}"
PATH_SUFFIXES qwt-qt4 qwt qwt5 qwt6
)

set(QWT_LIBRARY_NAMES qwt-qt5 qwt6-qt5)
set(QWT_LIBRARY_NAMES qwt-qt5 qwt6-qt5 qwt)

find_library(QWT_LIBRARY
NAMES ${QWT_LIBRARY_NAMES}
@@ -31,6 +23,20 @@ find_library(QWT_LIBRARY
"$ENV{LIB}"
)

set(_qwt_fw)
if(QWT_LIBRARY MATCHES "/qwt.*\\.framework")
string(REGEX REPLACE "^(.*/qwt.*\\.framework).*$" "\\1" _qwt_fw "${QWT_LIBRARY}")
endif()

FIND_PATH(QWT_INCLUDE_DIR NAMES qwt.h PATHS
"${_qwt_fw}/Headers"
/usr/include
/usr/local/include
"$ENV{LIB_DIR}/include"
"$ENV{INCLUDE}"
PATH_SUFFIXES qwt-qt4 qwt qwt5 qwt6
)

IF (QWT_INCLUDE_DIR AND QWT_LIBRARY)
SET(QWT_FOUND TRUE)
ENDIF (QWT_INCLUDE_DIR AND QWT_LIBRARY)
@@ -12,22 +12,27 @@
# QWTPOLAR_INCLUDE_DIR = where to find headers
#


FIND_PATH(QWTPOLAR_INCLUDE_DIR NAMES qwt_polar.h PATHS
/usr/include
/usr/local/include
"$ENV{LIB_DIR}/include"
"$ENV{INCLUDE}"
PATH_SUFFIXES qwtpolar qwt
)

FIND_LIBRARY(QWTPOLAR_LIBRARY NAMES qwtpolar PATHS
/usr/lib
/usr/local/lib
"$ENV{LIB_DIR}/lib"
"$ENV{LIB}/lib"
)

SET(_qwtpolar_fw)
IF (QWTPOLAR_LIBRARY MATCHES "/qwtpolar.*\\.framework")
STRING(REGEX REPLACE "^(.*/qwtpolar.*\\.framework).*$" "\\1" _qwtpolar_fw "${QWTPOLAR_LIBRARY}")
ENDIF ()

FIND_PATH(QWTPOLAR_INCLUDE_DIR NAMES qwt_polar.h PATHS
"${_qwtpolar_fw}/Headers"
/usr/include
/usr/local/include
"$ENV{LIB_DIR}/include"
"$ENV{INCLUDE}"
PATH_SUFFIXES qwtpolar qwt
)

IF (QWTPOLAR_INCLUDE_DIR AND QWTPOLAR_LIBRARY)
SET(QWTPOLAR_FOUND TRUE)
ENDIF (QWTPOLAR_INCLUDE_DIR AND QWTPOLAR_LIBRARY)
@@ -24,6 +24,7 @@
__revision__ = '$Format:%H$'

import os
import codecs
import yaml
from qgis.core import Qgis, QgsWkbTypes
from qgis.PyQt.QtCore import QSettings, QLocale
@@ -35,7 +36,7 @@ def loadShortHelp():
for f in os.listdir(path):
if f.endswith("yaml"):
filename = os.path.join(path, f)
with open(filename) as stream:
with codecs.open(filename, encoding='utf-8') as stream:
h.update(yaml.load(stream))
version = ".".join(Qgis.QGIS_VERSION.split(".")[0:2])
overrideLocale = QSettings().value('locale/overrideFlag', False, bool)
@@ -190,7 +190,7 @@ MACRO(ADD_GRASSPLUGIN GRASS_BUILD_VERSION)
)

SET_TARGET_PROPERTIES(grassplugin${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" ${GRASS_EXTRA_INCLUDE_DIRS${GRASS_BUILD_VERSION}}"
)

IF(MSVC)
@@ -216,7 +216,7 @@ MACRO(ADD_GRASSPLUGIN GRASS_BUILD_VERSION)
ADD_EXECUTABLE(qgis.g.browser${GRASS_BUILD_VERSION} ${GRASS_BROWSER_SRCS})

SET_TARGET_PROPERTIES(qgis.g.browser${GRASS_BUILD_VERSION} PROPERTIES
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\""
COMPILE_FLAGS "-DGRASS_BASE=\\\"${GRASS_PREFIX}\\\" ${GRASS_EXTRA_INCLUDE_DIRS${GRASS_BUILD_VERSION}}"
)

TARGET_LINK_LIBRARIES (qgis.g.browser${GRASS_BUILD_VERSION}

0 comments on commit fe8dfe1

Please sign in to comment.
You can’t perform that action at this time.