Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame^] | 1 | From 3707f467f9a26a7df3d41385023b43c3d08911d2 Mon Sep 17 00:00:00 2001 |
| 2 | From: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> |
| 3 | Date: Tue, 12 Feb 2019 17:46:52 -0800 |
| 4 | Subject: [PATCH][v3] CMakeLists.txt: Use SWIG_SUPPORT_FILES to find the list |
| 5 | of generated files for cmake version 3.12 or higher |
| 6 | |
| 7 | Use SWIG_SUPPORT_FILES to find the list of python files generated by |
| 8 | CMake Swig module and install those files. This should be applicable to |
| 9 | cmake version 3.12 or higher |
| 10 | |
| 11 | Signed-off-by: Manjukumar Matha <manjukumar.harthikote-matha@xilinx.com> |
| 12 | --- |
| 13 | src/CMakeLists.txt | 8 +++++++- |
| 14 | 1 file changed, 7 insertions(+), 1 deletion(-) |
| 15 | |
| 16 | diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt |
| 17 | index e19cda2..b565814 100644 |
| 18 | --- a/src/CMakeLists.txt |
| 19 | +++ b/src/CMakeLists.txt |
| 20 | @@ -337,8 +337,14 @@ macro(_upm_swig_python) |
| 21 | OUTPUT_NAME _pyupm_${libname} |
| 22 | LIBRARY_OUTPUT_DIRECTORY ${CMAKE_CURRENT_PYTHON_BINARY_DIR}) |
| 23 | |
| 24 | + if (CMAKE_VERSION VERSION_LESS "3.12") |
| 25 | + set(support_files ${swig_extra_generated_files}) |
| 26 | + else() |
| 27 | + get_property(support_files TARGET _${python_wrapper_name} PROPERTY SWIG_SUPPORT_FILES) |
| 28 | + endif() |
| 29 | + |
| 30 | # Install .py's to python packages directory/upm |
| 31 | - install (FILES ${swig_extra_generated_files} |
| 32 | + install (FILES ${support_files} |
| 33 | DESTINATION ${PYTHON_PACKAGES_PATH}/upm |
| 34 | COMPONENT ${CMAKE_PROJECT_NAME}-python${PYTHON_VERSION_MAJOR}) |
| 35 | |
| 36 | -- |
| 37 | 2.7.4 |
| 38 | |