Skip to content

Commit

Permalink
Add ability to run plugin installer from build directory
Browse files Browse the repository at this point in the history
- 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 e6706f4
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
6 changes: 4 additions & 2 deletions python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down Expand Up @@ -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
Expand Down
17 changes: 16 additions & 1 deletion python/pyplugin_installer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.