Skip to content
Permalink
Browse files

Add ability to run plugin installer from build directory

- Update targets to new coding standard of using hyphens
- Add console and plugin installer to WITH_PY_COMPILE target
  • Loading branch information
dakcarto authored and NathanW2 committed Jun 5, 2013
1 parent 55fd57e commit e6706f4938a8d2adad56a80f60413418b08a4ccb
Showing with 20 additions and 3 deletions.
  1. +4 −2 python/CMakeLists.txt
  2. +16 −1 python/pyplugin_installer/CMakeLists.txt
@@ -131,7 +131,7 @@ IF(WITH_QSCIAPI)
FILE(WRITE "${QGIS_PYTHON_API_FILE}" "")

# run update/concatenate command after last python module is built (currently python_module_qgis_gui)
ADD_CUSTOM_COMMAND(TARGET python_module_qgis_gui
ADD_CUSTOM_COMMAND(TARGET python-module-qgis-gui
POST_BUILD
COMMAND "${CMAKE_COMMAND}" -P "${CMAKE_SOURCE_DIR}/cmake/QsciAPI.cmake"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
@@ -161,8 +161,10 @@ ENDFOREACH(pyfile)

# Byte-compile staged PyQGIS utilities
IF(WITH_PY_COMPILE)
ADD_CUSTOM_TARGET(pycompile_pyutils ALL
ADD_CUSTOM_TARGET(pycompile-pyutils ALL
COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY}/qgis"
COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY}/console"
COMMAND ${PYTHON_EXECUTABLE} -m compileall -q "${PYTHON_OUTPUT_DIRECTORY}/pyplugin_installer"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
COMMENT "Byte-compiling staged PyQGIS utility modules..."
DEPENDS pyutils
@@ -21,6 +21,21 @@ PYQT4_WRAP_UI(PYUI_FILES
qgsplugininstalleroldreposbase.ui
)

ADD_CUSTOM_TARGET(pyplugin_installer ALL DEPENDS ${PYUI_FILES})
ADD_CUSTOM_TARGET(pyplugin-installer ALL DEPENDS ${PYUI_FILES})

ADD_CUSTOM_COMMAND(TARGET pyplugin-installer
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E make_directory ${PYTHON_OUTPUT_DIRECTORY}/pyplugin_installer
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

FOREACH(pyfile ${PY_PLUGININSTALLER_FILES} ${PYUI_FILES})
ADD_CUSTOM_COMMAND(TARGET pyplugin-installer
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} ${PYTHON_OUTPUT_DIRECTORY}/pyplugin_installer
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
DEPENDS ${pyfile}
)
ENDFOREACH(pyfile)

INSTALL(FILES ${PY_PLUGININSTALLER_FILES} ${PYUI_FILES} DESTINATION "${QGIS_PLUGININSTALLER_DIR}")

0 comments on commit e6706f4

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