From 033190e5b88938e77876bf67e5d349077a72ed02 Mon Sep 17 00:00:00 2001
From: Guilhem Saurel <guilhem.saurel@laas.fr>
Date: Mon, 13 Aug 2018 14:34:10 +0200
Subject: [PATCH] [CMake] remove custom_cmake/python.cmake, fix #33

---
 CMakeLists.txt            |  1 -
 custom_cmake/python.cmake | 87 ---------------------------------------
 src/CMakeLists.txt        |  2 +-
 3 files changed, 1 insertion(+), 89 deletions(-)
 delete mode 100644 custom_cmake/python.cmake

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 58ec984..e8d653e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,7 +20,6 @@ INCLUDE(cmake/boost.cmake)
 INCLUDE(cmake/eigen.cmake)
 INCLUDE(cmake/lapack.cmake)
 INCLUDE(cmake/cpack.cmake)
-INCLUDE(custom_cmake/python.cmake)
 INCLUDE(cmake/python.cmake)
 
 SET(PROJECT_NAME sot-dynamic-pinocchio)
diff --git a/custom_cmake/python.cmake b/custom_cmake/python.cmake
deleted file mode 100644
index 2c6ed4f..0000000
--- a/custom_cmake/python.cmake
+++ /dev/null
@@ -1,87 +0,0 @@
-# Copyright (C) 2008-2016 LAAS-CNRS, JRL AIST-CNRS.
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-
-#
-# SOT_DYNAMIC_PYTHON_MODULE SUBMODULENAME LIBRARYNAME TARGETNAME
-# ---------------------------
-#
-# Add a python submodule to dynamic_graph
-#
-#  SUBMODULENAME : the name of the submodule (can be foo/bar),
-#
-#  LIBRARYNAME   : library to link the submodule with.
-#
-#  TARGETNAME    : name of the target: should be different for several
-#                  calls to the macro.
-#
-#  NOTICE : Before calling this macro, set variable NEW_ENTITY_CLASS as
-#           the list of new Entity types that you want to be bound.
-#           Entity class name should match the name referencing the type
-#           in the factory.
-#
-MACRO(SOT_DYNAMIC_PYTHON_MODULE SUBMODULENAME LIBRARYNAME TARGETNAME)
-  FINDPYTHON()
-  
-  SET(PYTHON_MODULE ${TARGETNAME})
-  
-  ADD_LIBRARY(${PYTHON_MODULE}
-    MODULE
-    ${PROJECT_SOURCE_DIR}/src/python-module-py.cpp)
-  #${PROJECT_SOURCE_DIR}/src/sot-dynamic-py.cpp)
-  
-  FILE(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/src/dynamic_graph/${SUBMODULENAME})
-  SET_TARGET_PROPERTIES(${PYTHON_MODULE}
-    PROPERTIES PREFIX ""
-    OUTPUT_NAME dynamic_graph/${SUBMODULENAME}/wrap
-    )
-  
-  TARGET_LINK_LIBRARIES(${PYTHON_MODULE} "-Wl,--no-as-needed")
-  TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${LIBRARYNAME} ${PYTHON_LIBRARY})
-  TARGET_LINK_LIBRARIES(${PYTHON_MODULE} ${Boost_LIBRARIES})
-  TARGET_LINK_LIBRARIES(${PYTHON_MODULE} pinocchio)
-  TARGET_LINK_LIBRARIES(${PYTHON_MODULE} eigenpy)
-
-  PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} dynamic-graph)
-  PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} pinocchio)
-  PKG_CONFIG_USE_DEPENDENCY(${PYTHON_MODULE} eigenpy)
-  
-  INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-  
-  #
-  # Installation
-  #
-  SET(PYTHON_INSTALL_DIR ${PYTHON_SITELIB}/dynamic_graph/${SUBMODULENAME})
-
-  INSTALL(TARGETS ${PYTHON_MODULE}
-    DESTINATION
-    ${PYTHON_INSTALL_DIR})
-
-  SET(ENTITY_CLASS_LIST "")
-  FOREACH (ENTITY ${NEW_ENTITY_CLASS})
-    SET(ENTITY_CLASS_LIST "${ENTITY_CLASS_LIST}${ENTITY}('')\n")
-  ENDFOREACH(ENTITY ${NEW_ENTITY_CLASS})
-
-  CONFIGURE_FILE(
-    ${PROJECT_SOURCE_DIR}/cmake/dynamic_graph/submodule/__init__.py.cmake
-    ${PROJECT_BINARY_DIR}/src/dynamic_graph/${SUBMODULENAME}/__init__.py
-    )
-
-  INSTALL(
-    FILES ${PROJECT_BINARY_DIR}/src/dynamic_graph/${SUBMODULENAME}/__init__.py
-    DESTINATION ${PYTHON_INSTALL_DIR}
-    )
-
-ENDMACRO(DYNAMIC_GRAPH_PYTHON_MODULE SUBMODULENAME)
\ No newline at end of file
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index e396cba..3c29c10 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -52,7 +52,7 @@ FOREACH(lib ${plugins})
   # build python submodule
   STRING(REPLACE - _ PYTHON_LIBRARY_NAME ${lib})
 
-  SOT_DYNAMIC_PYTHON_MODULE("sot/dynamics_pinocchio/${PYTHON_LIBRARY_NAME}"
+  DYNAMIC_GRAPH_PYTHON_MODULE("sot/dynamics_pinocchio/${PYTHON_LIBRARY_NAME}"
     ${libname}
     sot-dynamic-pinocchio-${PYTHON_LIBRARY_NAME}-wrap
     )
-- 
GitLab