From 2db15c60a22b9f14719118c52d1eacffc0c0dcd3 Mon Sep 17 00:00:00 2001
From: Cyrille Berger <cyrille.berger@liu.se>
Date: Fri, 17 Mar 2023 13:12:55 +0100
Subject: [PATCH] clean up, don't link to sip module directly

---
 CMakeLists.txt             | 2 +-
 python/CMakeLists.txt      | 2 +-
 src/python_interpreter.cpp | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index a89c965..cdbaa0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -41,7 +41,7 @@ add_library(air_navigation SHARED
         src/python_controller.cpp
         src/python_interpreter.cpp)
 target_compile_definitions(air_navigation PUBLIC "PLUGINLIB__DISABLE_BOOST_FUNCTIONS")
-target_link_libraries(air_navigation ${PYTHON_LIBRARY}  ${CMAKE_CURRENT_BINARY_DIR}/python/air_navigation_.so)
+target_link_libraries(air_navigation ${PYTHON_LIBRARY}  )
 ament_target_dependencies(air_navigation
   ${dependencies}
 )
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index c93b4e8..bd84e6c 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -20,7 +20,7 @@ set(PYTHON_SITE_PACKAGES_INSTALL_DIR ${CMAKE_INSTALL_PREFIX}/lib/python${PYTHON_
 file(GLOB_RECURSE AIR_NAVIGATION_SIP_FILES *.sip)
 
 set(SIP_EXTRA_FILES_DEPEND ${AIR_NAVIGATION_SIP_FILES})
-add_sip_python_module(air_navigation_ ./air_navigation/mod.sip)
+add_sip_python_module(air_navigation_ ./air_navigation/mod.sip air_navigation)
 
 install(FILES
     air_navigation/__init__.py
diff --git a/src/python_interpreter.cpp b/src/python_interpreter.cpp
index 53ea9bb..8df356e 100644
--- a/src/python_interpreter.cpp
+++ b/src/python_interpreter.cpp
@@ -1,7 +1,7 @@
 #include <air_navigation/python_interpreter.h>
 
 #include <Python.h>
-#include <python/air_navigation/sipAPIair_navigation_.h>
+#include <sip.h>
 
 #include <rclcpp/rclcpp.hpp>
 #include <dlfcn.h>
@@ -75,7 +75,7 @@ py_interface::Controller* python_interpreter::create_controller(const std::strin
       int state;
       const sipTypeDef *td = get_sip_api()->api_find_type("air_navigation::py_interface::Controller");
       py_interface::Controller* controller = reinterpret_cast<py_interface::Controller*>(get_sip_api()->api_convert_to_type(pValue, td, NULL, SIP_NOT_NONE, &state, &isErr));
-      sipTransferTo(pValue, Py_None);
+      get_sip_api()->api_transfer_to(pValue, Py_None);
       release_lock();
       return controller;
     } else {
-- 
GitLab