Skip to content

Commit

Permalink
remove tons of pyuic4, pyrcc4 generated files and create them when bu…
Browse files Browse the repository at this point in the history
…ilding (apply #1877)

git-svn-id: http://svn.osgeo.org/qgis/trunk@11401 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Aug 16, 2009
1 parent 2ed443d commit 95ca955
Show file tree
Hide file tree
Showing 70 changed files with 134 additions and 14,618 deletions.
49 changes: 49 additions & 0 deletions cmake/Python.cmake
Expand Up @@ -7,6 +7,55 @@
FIND_PACKAGE(PythonLibs) # MapServer export tool
FIND_PACKAGE(PythonInterp) # test for sip and PyQt4

FIND_PROGRAM(PYUIC4_PROGRAM pyuic4)

IF(${PYUIC4_PROGRAM} STREQUAL "PYUIC4_PROGRAM-NOTFOUND")
MESSAGE(ERROR "pyuic4 is required")
ENDIF(${PYUIC4_PROGRAM} STREQUAL "PYUIC4_PROGRAM-NOTFOUND")

# Adapted from QT4_WRAP_UI
MACRO(PYQT4_WRAP_UI outfiles )
FOREACH(it ${ARGN})
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/ui_${outfile}.py)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYUIC4_PROGRAM} ${infile} -o ${outfile}
MAIN_DEPENDENCY ${infile}
)
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH(it)
ENDMACRO(PYQT4_WRAP_UI)

FIND_PROGRAM(PYRCC4_PROGRAM pyrcc4)

# Adapted from QT4_ADD_RESOURCES
MACRO (PYQT4_ADD_RESOURCES outfiles )
FOREACH (it ${ARGN})
GET_FILENAME_COMPONENT(outfile ${it} NAME_WE)
GET_FILENAME_COMPONENT(infile ${it} ABSOLUTE)
GET_FILENAME_COMPONENT(rc_path ${infile} PATH)
SET(outfile ${CMAKE_CURRENT_BINARY_DIR}/${outfile}_rc.py)
# parse file for dependencies
# all files are absolute paths or relative to the location of the qrc file
FILE(READ "${infile}" _RC_FILE_CONTENTS)
STRING(REGEX MATCHALL "<file[^<]+" _RC_FILES "${_RC_FILE_CONTENTS}")
SET(_RC_DEPENDS)
FOREACH(_RC_FILE ${_RC_FILES})
STRING(REGEX REPLACE "^<file[^>]*>" "" _RC_FILE "${_RC_FILE}")
STRING(REGEX MATCH "^/|([A-Za-z]:/)" _ABS_PATH_INDICATOR "${_RC_FILE}")
IF(NOT _ABS_PATH_INDICATOR)
SET(_RC_FILE "${rc_path}/${_RC_FILE}")
ENDIF(NOT _ABS_PATH_INDICATOR)
SET(_RC_DEPENDS ${_RC_DEPENDS} "${_RC_FILE}")
ENDFOREACH(_RC_FILE)
ADD_CUSTOM_COMMAND(OUTPUT ${outfile}
COMMAND ${PYRCC4_PROGRAM} -name ${outfile} -o ${outfile} ${infile}
MAIN_DEPENDENCY ${infile}
DEPENDS ${_RC_DEPENDS})
SET(${outfiles} ${${outfiles}} ${outfile})
ENDFOREACH (it)
ENDMACRO (PYQT4_ADD_RESOURCES)

MACRO (TRY_RUN_PYTHON RESULT CMD)
IF (PYTHONINTERP_FOUND)
Expand Down
23 changes: 10 additions & 13 deletions python/plugins/fTools/CMakeLists.txt
@@ -1,16 +1,13 @@
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
# file or the ui change
SET(INSTALLER_FILES
__init__.py
frmAbout.py
ftools_help.xsl
resources.qrc
frmAbout.ui
fTools.py
doAbout.py
ftools_help.xml
resources.py
)
FILE(GLOB INSTALLER_FILES *.py)
SET(INSTALLER_FILES ${INSTALLER_FILES} ftools_help.xsl ftools_help.xml)

FILE(GLOB UI_FILES *.ui)
PYQT4_WRAP_UI(PYUI_FILES ${UI_FILES})
PYQT4_ADD_RESOURCES(PYRC_FILES resources.qrc)
ADD_CUSTOM_TARGET(ftools ALL DEPENDS ${PYUI_FILES} ${PYRC_FILES})

SET(INSTALLER_FILES ${INSTALLER_FILES} ${PYUI_FILES} ${PYRC_FILES})

INSTALL(FILES ${INSTALLER_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/fTools)

SUBDIRS(tools icons)
4 changes: 2 additions & 2 deletions python/plugins/fTools/doAbout.py
Expand Up @@ -19,8 +19,8 @@

from qgis.core import *
import webbrowser, os
from frmAbout import Ui_Dialog
import resources
from ui_frmAbout import Ui_Dialog
import resources_rc
currentPath = os.path.dirname(__file__)

class Dialog(QDialog, Ui_Dialog):
Expand Down
3 changes: 1 addition & 2 deletions python/plugins/fTools/fTools.py
Expand Up @@ -32,9 +32,8 @@

from PyQt4.QtCore import *
from PyQt4.QtGui import *
import resources
from qgis.core import *
import resources
import resources_rc
import os.path, sys
# Set up current path, so that we know where to look for mudules
currentPath = os.path.dirname( __file__ )
Expand Down
92 changes: 0 additions & 92 deletions python/plugins/fTools/frmAbout.py

This file was deleted.

49 changes: 1 addition & 48 deletions python/plugins/fTools/icons/gis/CMakeLists.txt
@@ -1,49 +1,2 @@
#TODO: Need to configure cmake to run pyrcc4 and pyuic4 as required when the resource
# file or the ui change
SET(ICON_FILES
analysis.png
geometry.png
sampling.png
basic_statistics.png
geoprocessing.png
select_location.png
buffer.png
help.png
simplify.png
centroids.png
intersections.png
single_to_multi.png
check_geometry.png
intersect.png
split_layer.png
clip.png
join_attributes.png
sub_selection.png
convex_hull.png
join_location.png
sum_lines.png
define_projection.png
management.png
sum_points.png
difference.png
matrix.png
sym_difference.png
dissolve.png
mean.png
to_lines.png
export_geometry.png
multi_to_single.png
union.png
export_projection.png
neighbour.png
unique.png
extract_nodes.png
random_points.png
vector_grid.png
random_selection.png
ftools_logo.png
regular_points.png
delaunay.png
layer_extent.png
)
FILE(GLOB ICON_FILES *.png)
INSTALL(FILES ${ICON_FILES} DESTINATION ${QGIS_DATA_DIR}/python/plugins/fTools/icons/gis)
Binary file removed python/plugins/fTools/icons/gis/nodes.png
Binary file not shown.

0 comments on commit 95ca955

Please sign in to comment.