From a4067e1f788f2f4bc81b05ac76d5094ddc3bd883 Mon Sep 17 00:00:00 2001
From: jcarpent <jcarpent@laas.fr>
Date: Tue, 16 Jun 2015 15:13:40 +0200
Subject: [PATCH] [CMake] Use default .so extension for python bindings +
 remove useless lines

---
 src/CMakeLists.txt | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 71008eaa6..3837e1ca6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -64,10 +64,7 @@ IF (UNIX )
     ADD_HEADER_GROUP(HEADERS)  
     ADD_SOURCE_GROUP(${PROJECT_NAME}_SOURCES)  
 
-    # Install target libpinocchio.so
-    INSTALL(FILES
-      "${CMAKE_BINARY_DIR}/src/lib${PROJECT_NAME}.so"
-      DESTINATION ${CMAKE_INSTALL_LIBDIR})
+    INSTALL(TARGETS ${PROJECT_NAME} DESTINATION lib)
 ENDIF ( )
 
 # ----------------------------------------------------
@@ -89,6 +86,12 @@ IF(EIGENPY_FOUND)
     PKG_CONFIG_USE_DEPENDENCY(${PYWRAP} lua5.1)
   ENDIF(LUA5_1_FOUND)
   TARGET_LINK_LIBRARIES(${PYWRAP} ${Boost_LIBRARIES} ${PROJECT_NAME})
+
+  IF(APPLE)
+    # We need to change the extension for python bindings
+    SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES SUFFIX ".so")
+  ENDIF(APPLE)
+
   SET_TARGET_PROPERTIES(${PYWRAP} PROPERTIES
     LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib/python/${PROJECT_NAME}")
   IF(URDFDOM_FOUND)
-- 
GitLab