From 374a657c0b03762e9cf47edd084736b0a8e7b1d9 Mon Sep 17 00:00:00 2001
From: Francois Keith <keith@lirmm.fr>
Date: Sat, 14 Jul 2012 00:11:00 +0200
Subject: [PATCH] Avoid having hard-coded paths in robotSpecific.py

The file robotSpecific.py still exists,
but it is automatically generated by cmake
please do not modify it / commit it.
Change the .py.cmake instead.
---
 .gitignore                                          |  1 +
 CMakeLists.txt                                      |  8 +++++++-
 python/{robotSpecific.py => robotSpecific.py.cmake} | 10 +++++-----
 3 files changed, 13 insertions(+), 6 deletions(-)
 rename python/{robotSpecific.py => robotSpecific.py.cmake} (95%)

diff --git a/.gitignore b/.gitignore
index 33286c8..b2e3724 100644
--- a/.gitignore
+++ b/.gitignore
@@ -7,3 +7,4 @@
 matlab
 *dat
 release
+python/portability.cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 6fcbafe..d1877f1 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -136,5 +136,11 @@ endforeach(lib)
 ADD_SUBDIRECTORY(src)
 ADD_SUBDIRECTORY(unitTesting)
 
+# Configure some of the python files
+CONFIGURE_FILE(
+   "${CMAKE_CURRENT_SOURCE_DIR}/python/robotSpecific.py.cmake"
+   "${CMAKE_CURRENT_SOURCE_DIR}/python/robotSpecific.py"
+)
+
 SETUP_PROJECT_FINALIZE()
-SETUP_PROJECT_CPACK()
\ No newline at end of file
+SETUP_PROJECT_CPACK()
diff --git a/python/robotSpecific.py b/python/robotSpecific.py.cmake
similarity index 95%
rename from python/robotSpecific.py
rename to python/robotSpecific.py.cmake
index e8231cb..92d0f69 100644
--- a/python/robotSpecific.py
+++ b/python/robotSpecific.py.cmake
@@ -13,10 +13,10 @@ specificitiesName=dict()
 jointRankName=dict()
 postureRange=dict()
 
-pkgDataRootDir['hrp10small'] = "/home/nmansard/compil/poulou/hpp2/share/hrp2-10-small"
-pkgDataRootDir['hrp14small'] = "/home/nmansard/compil/poulou/hpp2/share/hrp2-14"
-pkgDataRootDir['hrp14aug'] = "/home/nmansard/compil/poulou/hpp2/share/hrp2-14-augmented"
-pkgDataRootDir['hrp10aug'] = "/home/nmansard/compil/poulou/hpp2/share/hrp2-10-augmented"
+pkgDataRootDir['hrp10small'] = "@CMAKE_INSTALL_PREFIX@/share/hrp2-10-small"
+pkgDataRootDir['hrp14small'] = "@CMAKE_INSTALL_PREFIX@/share/hrp2-14"
+pkgDataRootDir['hrp14aug'] = "@CMAKE_INSTALL_PREFIX@/hrp2-14-augmented"
+pkgDataRootDir['hrp10aug'] = "@CMAKE_INSTALL_PREFIX@/share/hrp2-10-augmented"
 
 modelName['hrp10small'] = 'HRP2JRLmainsmall.wrl'
 modelName['hrp14small'] = 'HRP2JRLmainsmall.wrl'
@@ -84,7 +84,7 @@ gearRatio['hrp10aug'] = (0,0,0,0,0,0,384.0,240.0,180.0,200.0,180.0,100.0,384.0,2
 
 
 # --- ROMEO -----------------------------------
-pkgDataRootDir['romeo'] = "/home/nmansard/compil/poulou/hpp2/share/romeo_hands"
+pkgDataRootDir['romeo'] = "@CMAKE_INSTALL_PREFIX@/share/romeo_hands"
 
 # Romeo data
 modelName['romeo'] = 'RomeoNoToes.wrl'
-- 
GitLab