diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3a2d47a84ccebbede75086477dd1fcb48519dfe0..58ec984274df0f941493a8942ac823da9cb7c02c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,6 +20,8 @@ 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)
 
@@ -71,6 +73,7 @@ PKG_CONFIG_APPEND_LIBS(${LIBRARY_NAME})
 # Search for dependencies.
 # Boost
 SET(BOOST_COMPONENTS filesystem system unit_test_framework python)
+FINDPYTHON()
 SEARCH_FOR_BOOST()
 SEARCH_FOR_EIGEN()
 
diff --git a/python/CMakeLists.txt b/python/CMakeLists.txt
index b865ecfc1554c85b3e9193c87ac5d22d6cbc895c..d0d241b0449dc8726b4ebda2b91c2e6f5f8fd3b3 100644
--- a/python/CMakeLists.txt
+++ b/python/CMakeLists.txt
@@ -1,6 +1,3 @@
-INCLUDE(../cmake/python.cmake)
-FINDPYTHON()
-
 INSTALL(
   FILES kine_romeo.py kine_romeo_small.py
   DESTINATION ${PYTHON_SITELIB}/dynamic_graph/tutorial
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index c93eaf63876380623703ab6887b76378751eafe7..e396cba188972be34cf777e181df3687ad130fdc 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -14,8 +14,6 @@
 # received a copy of the GNU Lesser General Public License along with
 # sot-dynamic-pinocchio. If not, see <http://www.gnu.org/licenses/>.
 
-INCLUDE(../custom_cmake/python.cmake)
-INCLUDE(../cmake/python.cmake)
 LINK_DIRECTORIES(${Boost_LIBRARY_DIRS})
 
 # Verbosity level
@@ -81,4 +79,4 @@ INSTALL(FILES
   ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/tools.py
   ${CMAKE_CURRENT_SOURCE_DIR}/dynamic_graph/sot/dynamics_pinocchio/parser.py
   DESTINATION ${PYTHON_SITELIB}/dynamic_graph/sot/dynamics_pinocchio
-  )
\ No newline at end of file
+  )
diff --git a/unitTesting/CMakeLists.txt b/unitTesting/CMakeLists.txt
index 132599bce0254631551100bae2f5987709d398ae..108cd54e300642cb58df64b90feebcdf06028a81 100644
--- a/unitTesting/CMakeLists.txt
+++ b/unitTesting/CMakeLists.txt
@@ -12,7 +12,6 @@
 # General Lesser Public License for more details.  You should have
 # received a copy of the GNU Lesser General Public License along with
 # sot-dynamic-pinocchio. If not, see <http://www.gnu.org/licenses/>.
-INCLUDE(../cmake/python.cmake)
 
 ADD_DEFINITIONS(-DDEBUG=2)
 
@@ -50,8 +49,6 @@ ADD_DEFINITIONS(-DBOOST_TEST_DYN_LINK -DBOOST_TEST_MAIN)
 #SET(sampleinitconfig
 #  ${JRL_DYNAMICS_PKGDATAROOTDIR}/jrl-dynamics/examples/data/sampleInitConfig.dat)
 
-FINDPYTHON()
-
 LIST(APPEND LOGGING_WATCHED_VARIABLES samplespec sampleljr)
 
 FOREACH(test ${tests})
@@ -60,7 +57,7 @@ FOREACH(test ${tests})
     ${test}.cpp)
   MESSAGE("PYTHON_INCLUDE_PATH: ${PYTHON_INCLUDE_PATH}")
   INCLUDE_DIRECTORIES(${PYTHON_INCLUDE_PATH})
-  
+
   TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME}
     dp-zmpreffromcom
     dp-force-compensation
@@ -77,7 +74,7 @@ FOREACH(test ${tests})
   PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} sot-core)
   PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph)
   PKG_CONFIG_USE_DEPENDENCY(${EXECUTABLE_NAME} dynamic-graph-python)
-  
+
   IF(${test}_plugins_dependencies)
     ADD_DEPENDENCIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
     TARGET_LINK_LIBRARIES(${EXECUTABLE_NAME} "${${test}_plugins_dependencies}")
@@ -89,7 +86,7 @@ FOREACH(test ${tests})
 
   IF (UNIX)
     SET(EXTRA_LD_LIBRARY_PATH $ENV{LD_LIBRARY_PATH})
-    SET_PROPERTY(TEST ${test} PROPERTY 
+    SET_PROPERTY(TEST ${test} PROPERTY
       ENVIRONMENT "LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}:${CMAKE_BINARY_DIR}/src:${BOOST_ROOT}/lib:${EXTRA_LD_LIBRARY_PATH}")
   ENDIF(UNIX)