Skip to content

Commit 8c9ed18

Browse files
committedAug 9, 2011
fix another cmake <2.8 issue (followup to f3d5387)
1 parent 1f1dd7d commit 8c9ed18

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed
 

‎cmake/PythonMacros.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#
88
# This file defines the following macros:
99
#
10-
# PYTHON_INSTALL (SOURCE_FILE DESINATION_DIR)
10+
# PYTHON_INSTALL (SOURCE_FILE DESTINATION_DIR)
1111
# Install the SOURCE_FILE, which is a Python .py file, into the
1212
# destination directory during install. The file will be byte compiled
1313
# and both the .py file and .pyc file will be installed.

‎python/CMakeLists.txt

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ ENDIF (WITH_INTERNAL_SPATIALITE)
1616

1717
SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
1818
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
19-
file(COPY __init__.py utils.py console.py DESTINATION ${QGIS_PYTHON_OUTPUT_DIRECTORY})
20-
2119

2220
INCLUDE_DIRECTORIES(
2321
${PYTHON_INCLUDE_PATH}
@@ -90,11 +88,19 @@ FILE(GLOB sip_files_analysis analysis/*.sip)
9088
SET(SIP_EXTRA_FILES_DEPEND ${sip_files_core} ${sip_files_analysis})
9189
ADD_SIP_PYTHON_MODULE(qgis.analysis analysis/analysis.sip qgis_core qgis_analysis)
9290

93-
9491
SET (QGIS_PYTHON_DIR ${PYTHON_SITE_PACKAGES_DIR}/qgis)
9592

9693
ADD_CUSTOM_TARGET(compile_python_files ALL)
9794

95+
FOREACH(file __init__.py utils.py console.py)
96+
ADD_CUSTOM_COMMAND(TARGET compile_python_files
97+
POST_BUILD
98+
COMMAND ${CMAKE_COMMAND} -E copy ${file} ${QGIS_PYTHON_OUTPUT_DIRECTORY}
99+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
100+
DEPENDS ${file}
101+
)
102+
ENDFOREACH(file)
103+
98104
PYTHON_INSTALL(__init__.py ${QGIS_PYTHON_DIR})
99105
PYTHON_INSTALL(utils.py ${QGIS_PYTHON_DIR})
100106
PYTHON_INSTALL(console.py ${QGIS_PYTHON_DIR})

0 commit comments

Comments
 (0)
Please sign in to comment.