mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
* [cmake] generalize Python output directory in UseTest macro this is helpful in case we set up another python output directory (eg PySide2) * define python output directories to the parent scope * try with target_include_directories * define vars on top level * Update UsePythonTest.cmake * some cleanup * more cleanup * fix uic * fix path for all platforms * fix var
43 lines
992 B
CMake
43 lines
992 B
CMake
set (QGIS_PYQT_DIR ${Python_SITEARCH}/qgis/PyQt)
|
|
|
|
set(PYQT_COMPAT_FILES
|
|
__init__.py
|
|
QtWidgets.py
|
|
QtCore.py
|
|
QtGui.py
|
|
QtPrintSupport.py
|
|
QtWebKit.py
|
|
QtWebKitWidgets.py
|
|
QtNetwork.py
|
|
QtXml.py
|
|
QtSql.py
|
|
QtTest.py
|
|
QtSvg.py
|
|
Qsci.py
|
|
Qt.py
|
|
sip.py
|
|
uic/__init__.py
|
|
uic/pyuic.py
|
|
uic/properties.py
|
|
)
|
|
|
|
add_custom_target(pyqtcompat ALL)
|
|
add_dependencies(pyqtcompat pyutils)
|
|
|
|
set(PYQT_PREFIX PyQt5)
|
|
|
|
foreach(pyfile ${PYQT_COMPAT_FILES})
|
|
get_filename_component(_dir ${pyfile} PATH)
|
|
set(pyfile ${PYQT_PREFIX}/${pyfile})
|
|
add_custom_command(TARGET pyqtcompat
|
|
POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${QGIS_PYTHON_OUTPUT_DIRECTORY}/PyQt/${_dir}
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} ${QGIS_PYTHON_OUTPUT_DIRECTORY}/PyQt/${_dir}
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
DEPENDS ${pyfile}
|
|
)
|
|
install(FILES ${pyfile} DESTINATION "${QGIS_PYQT_DIR}/${_dir}")
|
|
endforeach(pyfile)
|
|
|
|
PY_COMPILE(pyqtcompat "${PYTHON_OUTPUT_DIRECTORY}")
|