Skip to content
Permalink
Browse files

Additional fix for # 5879, handle .ui files for python utilities

- Built off of pull request 299 by Salvatore Larosa
  • Loading branch information
dakcarto committed Oct 25, 2012
1 parent e31fb3c commit 1a092f92ca8e541d6c60cbb648ff87c57bbb405a
Showing with 25 additions and 27 deletions.
  1. +25 −27 python/CMakeLists.txt
@@ -139,33 +139,31 @@ IF(WITH_QSCIAPI)
INSTALL(FILES ${QGIS_PYTHON_API_FILE} DESTINATION "${QGIS_DATA_DIR}/python/qsci_apis")
ENDIF(WITH_QSCIAPI)

ADD_CUSTOM_TARGET(compile_python_files ALL)

ADD_SUBDIRECTORY(console_help)

ADD_CUSTOM_COMMAND(TARGET compile_python_files
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${QGIS_PYTHON_OUTPUT_DIRECTORY}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
# PyQGIS console and plugin utilities
# files to copy to staging or install
SET(PY_FILES
__init__.py
console.py
console_sci.py
console_help.py
console_settings.py
utils.py
)

FILE(GLOB UI_FILES *.ui)
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES})
ADD_CUSTOM_TARGET(console ALL DEPENDS ${PYUI_FILES})
INSTALL(FILES ${PYUI_FILES} DESTINATION ${QGIS_PYTHON_DIR})

FOREACH(file __init__.py utils.py console.py console_sci.py console_help.py console_settings.py)
ADD_CUSTOM_COMMAND(TARGET compile_python_files
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${QGIS_PYTHON_OUTPUT_DIRECTORY}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${file}
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES}) # returns absolute paths
ADD_CUSTOM_TARGET(pyutils ALL DEPENDS ${PYUI_FILES})

# stage to output to make available when QGIS is run from build directory
FOREACH(pyfile ${PY_FILES} ${PYUI_FILES})
ADD_CUSTOM_COMMAND(TARGET pyutils
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}"
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
)
ENDFOREACH(file)

PYTHON_INSTALL(__init__.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(utils.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_sci.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_help.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console_settings.py ${QGIS_PYTHON_DIR})
ENDFOREACH(pyfile)

INSTALL(FILES ${PY_FILES} ${PYUI_FILES} DESTINATION "${QGIS_PYTHON_DIR}")

ADD_SUBDIRECTORY(console_help)

0 comments on commit 1a092f9

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