Skip to content

Commit 282f406

Browse files
committed
Disable builtin pyyaml package with python 3
It's not compatible
1 parent 112df2f commit 282f406

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

python/ext-libs/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ IF (WITH_PYSPATIALITE)
88
ADD_SUBDIRECTORY(pyspatialite)
99
ENDIF (WITH_PYSPATIALITE)
1010

11-
MACRO(EXT_PYLIB lib)
11+
MACRO(EXT_PYLIB lib enable_by_default)
1212
STRING(TOUPPER ${lib} ulib)
13-
SET (WITH_INTERNAL_${ulib} TRUE CACHE BOOL "Determines whether python ${lib} should be included")
13+
SET (WITH_INTERNAL_${ulib} ${enable_by_default} CACHE BOOL "Determines whether python ${lib} should be included")
1414
IF(WITH_INTERNAL_${ulib})
1515
INSTALL(DIRECTORY ${lib} DESTINATION "${QGIS_PYTHON_DIR}")
1616

@@ -33,8 +33,16 @@ MACRO(EXT_PYLIB lib)
3333
ENDIF(WITH_INTERNAL_${ulib})
3434
ENDMACRO(EXT_PYLIB lib)
3535

36-
FOREACH(pkg httplib2 jinja2 markupsafe owslib pygments dateutil pytz yaml nose2 requests)
37-
EXT_PYLIB(${pkg})
36+
# Our yaml package is not compatible with python 3
37+
# Fallback to system package by default
38+
IF(PYTHON_VER VERSION_LESS 3)
39+
EXT_PYLIB(yaml TRUE)
40+
ELSEIF(PYTHON_VER VERSION_LESS 3)
41+
EXT_PYLIB(yaml FALSE)
42+
ENDIF(PYTHON_VER VERSION_LESS 3)
43+
44+
FOREACH(pkg httplib2 jinja2 markupsafe owslib pygments dateutil pytz nose2 requests)
45+
EXT_PYLIB(${pkg} TRUE)
3846
ENDFOREACH(pkg)
3947

4048
IF(NOT ENABLE_PYTHON3)

0 commit comments

Comments
 (0)