From: Jochen Sprickerhof <git@jochen.sprickerhof.de>
Date: Mon, 6 Apr 2020 14:57:04 +0200
Subject: Make Python version variable for pybuild

---
 tf2_py/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tf2_py/CMakeLists.txt b/tf2_py/CMakeLists.txt
index 11ef21b..ba77341 100644
--- a/tf2_py/CMakeLists.txt
+++ b/tf2_py/CMakeLists.txt
@@ -10,7 +10,7 @@ find_package(catkin REQUIRED COMPONENTS rospy tf2)
 # find_package(Boost REQUIRED COMPONENTS system)
 
 
-find_package(PythonLibs 2 REQUIRED)
+find_package(PythonLibs ${PYVER} EXACT REQUIRED)
 include_directories(${PYTHON_INCLUDE_PATH} ${catkin_INCLUDE_DIRS})
 
 ## Uncomment this if the package has a setup.py. This macro ensures
@@ -150,8 +150,8 @@ set_target_properties(tf2_py PROPERTIES
 #   DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
 # )
 
-install(TARGETS tf2_py
-    DESTINATION ${CATKIN_PACKAGE_PYTHON_DESTINATION}
+install(FILES $<TARGET_FILE:tf2_py>
+    DESTINATION lib/python${PYVER}/${PYTHON_PACKAGES_DIR}/${PROJECT_NAME}
 )
 
 #############
