Browse Source

change view_pcdmap, change default path.

yuchuli 1 year ago
parent
commit
7dfde83abd
2 changed files with 33 additions and 7 deletions
  1. 23 6
      deploywithfind.sh
  2. 10 1
      src/tool/view_pcdmap/main.cpp

+ 23 - 6
deploywithfind.sh

@@ -1,6 +1,6 @@
 #! /bin/bash
 
-Qtgccdir='/usr/lib/x86_64-linux-gnu/qt5'
+Qtgccdir= '' #'/usr/lib/x86_64-linux-gnu/qt5'
 if [ ${#Qtgccdir} -lt 6 ]; then
   echo "Because not set gcc_64 , so auto find gcc_64 "
   optfiles=`find /opt -name 'gcc_64'` 
@@ -23,6 +23,17 @@ if [ ${#Qtgccdir} -lt 6 ]; then
   fi
 fi
 
+if [ ${#Qtgccdir} -lt 6 ]; then
+  if [ -d '/usr/lib/x86_64-linux-gnu/qt5' ]; then
+    echo " Qt in /usr/lib"
+    Qtgccdir='/usr/lib/x86_64-linux-gnu/qt5'
+    QtPlatformdir=$Qtgccdir/plugins/platforms
+    QtLibDir=/usr/lib/x86_64-linux-gnu/
+  else 
+    echo "please sudo apt install qt"
+  fi
+fi
+
 if [ ${#Qtgccdir} -lt 6 ]; then
    echo -e "\033[31m""  -----not found gccdir: so exit""\033[0m"
    exit 1
@@ -35,25 +46,25 @@ libm.so.*
 libgcc_s.so.*
 #libc.so.*
 #libpthread.so.*
-libGL.so.*
+#libGL.so.*
 libz.so.*
 libc.so.*
 libgthread*
 libglib*
 libexpat*
-libxcb*
+#libxcb*
 #libdl.so.*
 libxshmfence*
 libglapi.so.*
 libXext.so.*
 libXdamage.so.*
 libXfixes.so.*
-libX11*
+#libX11*
 libXxf86vm.so.*
 libdrm.so.*
 libpcre.so.*
-libXau.so.*
-libXdmcp.so.*
+#libXau.so.*
+#libXdmcp.so.*
 )
 
 EXE="$1"
@@ -111,6 +122,12 @@ cd ..
 
 cp -r app $PWD/deploy/
 
+xlib=`ls ./deploy/app/lib/lib*`  
+for fileName in $xlib
+  do
+     patchelf --set-rpath '$ORIGIN' $fileName
+  done
+
 rm -rf app
 
 

+ 10 - 1
src/tool/view_pcdmap/main.cpp

@@ -26,7 +26,16 @@ int  GetOptLong(int argc, char *argv[]) {
     int opt; // getopt_long() 的返回值
     int digit_optind = 0; // 设置短参数类型及是否需要参数
 
-    strncpy(gstr_mapname,"/home/nvidia/map.pcd",255);
+
+    char * strhome = getenv("HOME");
+    std::cout<<" home : "<<strhome<<std::endl;
+
+    if(strnlen(strhome,256)>0)
+    {
+        snprintf(gstr_mapname,256,"%s/map/map.pcd",strhome);
+    }
+    else
+        strncpy(gstr_mapname,"/home/nvidia/map.pcd",255);
     // 如果option_index非空,它指向的变量将记录当前找到参数符合long_opts里的
     // 第几个元素的描述,即是long_opts的下标值
     int option_index = 0;