Skip to content

Commit

Permalink
Disable builtin pyyaml package with python 3
Browse files Browse the repository at this point in the history
It's not compatible
  • Loading branch information
m-kuhn committed Aug 16, 2016
1 parent 112df2f commit 282f406
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions python/ext-libs/CMakeLists.txt
Expand Up @@ -8,9 +8,9 @@ IF (WITH_PYSPATIALITE)
ADD_SUBDIRECTORY(pyspatialite)
ENDIF (WITH_PYSPATIALITE)

MACRO(EXT_PYLIB lib)
MACRO(EXT_PYLIB lib enable_by_default)
STRING(TOUPPER ${lib} ulib)
SET (WITH_INTERNAL_${ulib} TRUE CACHE BOOL "Determines whether python ${lib} should be included")
SET (WITH_INTERNAL_${ulib} ${enable_by_default} CACHE BOOL "Determines whether python ${lib} should be included")
IF(WITH_INTERNAL_${ulib})
INSTALL(DIRECTORY ${lib} DESTINATION "${QGIS_PYTHON_DIR}")

Expand All @@ -33,8 +33,16 @@ MACRO(EXT_PYLIB lib)
ENDIF(WITH_INTERNAL_${ulib})
ENDMACRO(EXT_PYLIB lib)

FOREACH(pkg httplib2 jinja2 markupsafe owslib pygments dateutil pytz yaml nose2 requests)
EXT_PYLIB(${pkg})
# Our yaml package is not compatible with python 3
# Fallback to system package by default
IF(PYTHON_VER VERSION_LESS 3)
EXT_PYLIB(yaml TRUE)
ELSEIF(PYTHON_VER VERSION_LESS 3)
EXT_PYLIB(yaml FALSE)
ENDIF(PYTHON_VER VERSION_LESS 3)

FOREACH(pkg httplib2 jinja2 markupsafe owslib pygments dateutil pytz nose2 requests)
EXT_PYLIB(${pkg} TRUE)
ENDFOREACH(pkg)

IF(NOT ENABLE_PYTHON3)
Expand Down

0 comments on commit 282f406

Please sign in to comment.