Skip to content

Commit

Permalink
put test_data_dir.py into build directory (don't use install directory
Browse files Browse the repository at this point in the history
prior to install)
  • Loading branch information
jef-n committed Oct 15, 2023
1 parent 5f7e06b commit 3dac2dc
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions python/testing/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ set(PY_FILES
file (MAKE_DIRECTORY ${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing)
install(FILES ${PY_FILES} DESTINATION "${QGIS_PYTHON_DIR}/testing")

configure_file("${CMAKE_CURRENT_SOURCE_DIR}/test_data_dir.py.in" "${QGIS_PYTHON_DIR}/testing/test_data_dir.py")
configure_file("${CMAKE_CURRENT_SOURCE_DIR}/test_data_dir.py.in" "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing/test_data_dir.py")

add_custom_target(pytesting ALL)
# stage to output to make available when QGIS is run from build directory
Expand All @@ -24,10 +24,4 @@ foreach(pyfile ${PY_FILES})
PY_COMPILE(pyutils "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing/${pyfile}")
endforeach(pyfile)

add_custom_command(TARGET pytesting
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "testing/test_data_dir.py" "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing/test_data_dir.py"
WORKING_DIRECTORY ${QGIS_PYTHON_DIR}
DEPENDS ${pyfile}
)
PY_COMPILE(pyutils "${QGIS_PYTHON_OUTPUT_DIRECTORY}/testing/test_data_dir.py")

1 comment on commit 3dac2dc

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jef-n !

Please sign in to comment.