Skip to content
Permalink
Browse files

fix internal future install (fixes #14577, take II)

  • Loading branch information
jef-n committed Apr 7, 2016
1 parent 60ada11 commit 589578055366e9771ebc6ae57cb90da808b215b6
Showing with 29 additions and 7 deletions.
  1. +29 −7 python/ext-libs/CMakeLists.txt
@@ -8,37 +8,59 @@ IF (WITH_PYSPATIALITE)
ADD_SUBDIRECTORY(pyspatialite)
ENDIF (WITH_PYSPATIALITE)

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

ADD_CUSTOM_TARGET(py${lib})

FILE(GLOB_RECURSE files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} ${lib}/*)
ADD_CUSTOM_COMMAND(TARGET py${lib}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${lib} "${PYTHON_OUTPUT_DIRECTORY}/${lib}/${dir}"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${lib} "${PYTHON_OUTPUT_DIRECTORY}/${lib}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${files}
)
PY_COMPILE(py${lib} "${PYTHON_OUTPUT_DIRECTORY}/${lib}/${dir}")
PY_COMPILE(py${lib} "${PYTHON_OUTPUT_DIRECTORY}/${lib}")

ADD_DEPENDENCIES(staged-plugins py${lib})
ADD_CUSTOM_COMMAND(TARGET clean-staged-plugins
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_OUTPUT_DIRECTORY}/${lib}/${dir}"
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_OUTPUT_DIRECTORY}/${lib}"
)

ENDIF(WITH_INTERNAL_${ulib})
ENDMACRO(EXT_PYLIB lib)

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

IF(NOT ENABLE_PYTHON3)
EXT_PYLIB(future ..)
SET (WITH_INTERNAL_FUTURE TRUE CACHE BOOL "Determines whether python future should be included")
IF(WITH_INTERNAL_FUTURE)
ADD_CUSTOM_TARGET(pyfuture)

FILE(GLOB items RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/future future/*)

FOREACH(item ${items})
FILE(GLOB_RECURSE files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/future future/*)
ADD_CUSTOM_COMMAND(TARGET pyfuture
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy_directory ${item} "${PYTHON_OUTPUT_DIRECTORY}/"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${files}
)
PY_COMPILE(pyfuture "${PYTHON_OUTPUT_DIRECTORY}/${item}")

ADD_CUSTOM_COMMAND(TARGET clean-staged-plugins
COMMAND ${CMAKE_COMMAND} -E remove_directory "${PYTHON_OUTPUT_DIRECTORY}/${item}"
)
ENDFOREACH(item ${items})

ADD_DEPENDENCIES(staged-plugins pyfuture)
ENDIF(WITH_INTERNAL_FUTURE)
ENDIF(NOT ENABLE_PYTHON3)

SET (WITH_INTERNAL_SIX TRUE CACHE BOOL "Determines whether python six should be included")

0 comments on commit 5895780

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