Skip to content
Permalink
Browse files
fix another cmake <2.8 issue (followup to f3d5387)
  • Loading branch information
jef-n committed Aug 9, 2011
1 parent 1f1dd7d commit 8c9ed1880b610e7261bc7d166eb8bbf6e07d12db
Showing with 10 additions and 4 deletions.
  1. +1 −1 cmake/PythonMacros.cmake
  2. +9 −3 python/CMakeLists.txt
@@ -7,7 +7,7 @@
#
# This file defines the following macros:
#
# PYTHON_INSTALL (SOURCE_FILE DESINATION_DIR)
# PYTHON_INSTALL (SOURCE_FILE DESTINATION_DIR)
# Install the SOURCE_FILE, which is a Python .py file, into the
# destination directory during install. The file will be byte compiled
# and both the .py file and .pyc file will be installed.
@@ -16,8 +16,6 @@ ENDIF (WITH_INTERNAL_SPATIALITE)

SET (CMAKE_RUNTIME_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
SET (CMAKE_LIBRARY_OUTPUT_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY})
file(COPY __init__.py utils.py console.py DESTINATION ${QGIS_PYTHON_OUTPUT_DIRECTORY})


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


SET (QGIS_PYTHON_DIR ${PYTHON_SITE_PACKAGES_DIR}/qgis)

ADD_CUSTOM_TARGET(compile_python_files ALL)

FOREACH(file __init__.py utils.py console.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}
)
ENDFOREACH(file)

PYTHON_INSTALL(__init__.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(utils.py ${QGIS_PYTHON_DIR})
PYTHON_INSTALL(console.py ${QGIS_PYTHON_DIR})

0 comments on commit 8c9ed18

Please sign in to comment.