mirror of
https://github.com/qgis/QGIS.git
synced 2025-02-24 00:47:57 -05:00
* [cmake] generalize Python output directory in UseTest macro this is helpful in case we set up another python output directory (eg PySide2) * define python output directories to the parent scope * try with target_include_directories * define vars on top level * Update UsePythonTest.cmake * some cleanup * more cleanup * fix uic * fix path for all platforms * fix var
24 lines
751 B
CMake
24 lines
751 B
CMake
# See ../CMakeLists.txt for info on staged-plugins* and clean-staged-plugins targets
|
|
|
|
set(QGIS_PYTHON_DIR ${Python_SITEARCH}/qgis)
|
|
|
|
set(PY_FILES
|
|
__init__.py
|
|
mocked.py
|
|
)
|
|
|
|
file (MAKE_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing)
|
|
install(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}/testing")
|
|
|
|
add_custom_target(pytesting ALL)
|
|
# stage to output to make available when QGIS is run from build directory
|
|
foreach(pyfile ${PY_FILES})
|
|
add_custom_command(TARGET pytesting
|
|
POST_BUILD
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${pyfile} "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing"
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
|
DEPENDS ${pyfile}
|
|
)
|
|
PY_COMPILE(pyutils "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing/${pyfile}")
|
|
endforeach(pyfile)
|