Skip to content
This repository has been archived by the owner on Feb 21, 2021. It is now read-only.

[issue #879] moved all installations to /opt/jderobot #880

Merged
merged 9 commits into from
Jul 27, 2017
13 changes: 12 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ else()
project (jderobot-only-ice)
endif()

set(CMAKE_INSTALL_PREFIX /opt/jderobot)

cmake_minimum_required(VERSION 2.8)

# build presents
Expand Down Expand Up @@ -138,6 +140,12 @@ STRING(REGEX REPLACE ";" ", " DEPS_DEV "${DEPS_DEV}")
# START RECURSIVE
add_subdirectory (${CMAKE_CURRENT_SOURCE_DIR}/src)

configure_file(
setup.bash.in
setup.bash
@ONLY
)



###################
Expand All @@ -157,6 +165,9 @@ INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/Deps DESTINATION ${CMAKE_INSTALL_P
# Install ROS Launch files
INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/scripts/launch DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot)

# Install setup.bash
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/setup.bash DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should be just ${CMAKE_INSTALL_PREFIX}





Expand Down Expand Up @@ -204,7 +215,7 @@ SET (CPACK_SOURCE_GENERATOR TGZ)
SET (CPACK_SET_DESTDIR ON)
SET (CPACK_DEB_COMPONENT_INSTALL OFF)
SET (CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON)
SET (CPACK_PACKAGING_INSTALL_PREFIX "/usr/local")
SET (CPACK_PACKAGING_INSTALL_PREFIX "${CMAKE_INSTALL_PREFIX}")


# CPack version numbers for release tarball name.
Expand Down
18 changes: 16 additions & 2 deletions Deps/python/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,20 @@
find_package(Python3Interp)
find_package(Python2Interp)

message(${PYTHON3_MODULE_PATH})
if (${PYTHON3INTERP_FOUND})
string(REPLACE "/" ";" PY3_LIST ${PYTHON3_MODULE_PATH})
list(LENGTH PY3_LIST len)
math(EXPR pos ${len}-1)
list(GET PY3_LIST ${pos} py3)
set (JDEROBOT_PYTHON3_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/lib/${py3})
message("${PYTHON3_MODULE_PATH}:${JDEROBOT_PYTHON3_MODULE_PATH}")
endif()

message(${PYTHON2_MODULE_PATH})
if (${PYTHON2INTERP_FOUND})
string(REPLACE "/" ";" PY2_LIST ${PYTHON2_MODULE_PATH})
list(LENGTH PY2_LIST len)
math(EXPR pos ${len}-1)
list(GET PY2_LIST ${pos} py2)
set (JDEROBOT_PYTHON2_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/lib/${py2})
message("${PYTHON2_MODULE_PATH}:${JDEROBOT_PYTHON2_MODULE_PATH}")
endif()
7 changes: 5 additions & 2 deletions cmake/pythonAux.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ macro(usePython ver)
set(PYTHON_VERSION_MINOR ${PYTHON2_VERSION_MINOR})
set(PYTHON_VERSION_PATCH ${PYTHON2_VERSION_PATCH})
set(PYTHON_MODULE_PATH ${PYTHON2_MODULE_PATH})
set(JDEROBOT_PYTHON_MODULE_PATH ${JDEROBOT_PYTHON2_MODULE_PATH})
set(PYTHONINTERP_FOUND TRUE)
elseif(${ver} EQUAL 3 AND ${PYTHON3INTERP_FOUND})
set(PYTHON_EXECUTABLE ${PYTHON3_EXECUTABLE})
Expand All @@ -15,6 +16,7 @@ macro(usePython ver)
set(PYTHON_VERSION_MINOR ${PYTHON3_VERSION_MINOR})
set(PYTHON_VERSION_PATCH ${PYTHON3_VERSION_PATCH})
set(PYTHON_MODULE_PATH ${PYTHON3_MODULE_PATH})
set(JDEROBOT_PYTHON_MODULE_PATH ${JDEROBOT_PYTHON3_MODULE_PATH})
set(PYTHONINTERP_FOUND TRUE)
else(${ver} EQUAL 2 AND ${PYTHON2INTERP_FOUND})
unset(PYTHON_EXECUTABLE)
Expand All @@ -23,6 +25,7 @@ macro(usePython ver)
unset(PYTHON_VERSION_MINOR)
unset(PYTHON_VERSION_PATCH)
unset(PYTHON_MODULE_PATH)
unset(JDEROBOT_PYTHON_MODULE_PATH)
set(PYTHONINTERP_FOUND FALSE)
endif(${ver} EQUAL 2 AND ${PYTHON2INTERP_FOUND})
endmacro()
Expand Down Expand Up @@ -91,15 +94,15 @@ endmacro()
macro (install_python module component)
install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/py2/${module}

DESTINATION ${PYTHON2_MODULE_PATH}
DESTINATION ${JDEROBOT_PYTHON2_MODULE_PATH}

COMPONENT ${component}

)

install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/py3/${module}

DESTINATION ${PYTHON3_MODULE_PATH}
DESTINATION ${JDEROBOT_PYTHON3_MODULE_PATH}

COMPONENT ${component}

Expand Down
4 changes: 2 additions & 2 deletions scripts/cmake/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
pip2 install --upgrade pip
pip2 install zeroc-ice

echo "/usr/local/lib/jderobot/" > /etc/ld.so.conf.d/jderobot.conf
cat /usr/local/share/jderobot/gazebo/gazebo-setup.sh >> ~/.bashrc
echo "/opt/jderobot/lib/jderobot/" > /etc/ld.so.conf.d/jderobot.conf
echo "source /opt/jderobot/setup.bash" >> ~/.bashrc
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
ldconfig
14 changes: 14 additions & 0 deletions setup.bash.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/bin/bash

export PATH=$PATH:@CMAKE_INSTALL_PREFIX@/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:@CMAKE_INSTALL_PREFIX@/lib
export CMAKE_PREFIX_PATH=$CMAKE_PREFIX_PATH:@CMAKE_INSTALL_PREFIX@
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:@CMAKE_INSTALL_PREFIX@/lib/pkgconfig
export PYTHONPATH=$PYTHONPATH:@CMAKE_INSTALL_PREFIX@/lib/python2.7


FILE=@CMAKE_INSTALL_PREFIX@/share/jderobot/gazebo/gazebo-setup.sh
if [ -f $FILE ]; then
source $FILE
fi

10 changes: 9 additions & 1 deletion src/drivers/ardrone_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ if(ARDRONE_ALL_DEPS)

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -w -lIce -lIceUtil")

configure_file(
include/ardrone_server/ardrone_driver.h.in
include/ardrone_server/ardrone_driver.h
@ONLY
)

include_directories(
${INTERFACES_CPP_DIR}
${OpenCV_INCLUDE_DIR}
Expand All @@ -28,7 +34,9 @@ if(ARDRONE_ALL_DEPS)
${ardronelib_LIBRARY_DIRS}
${easyiceconfig_LIBRARY_DIRS})

include_directories(include)
include_directories(include
${CMAKE_CURRENT_BINARY_DIR}/include
)


add_executable(ardrone_server src/ardrone_driver.cpp
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@
class ARDroneDriver;


#include "ardrone_sdk.h"
#include "ardrone_parser.h"
#include <ardrone_server/ardrone_sdk.h>
#include <ardrone_server/ardrone_parser.h>
#include <iostream>
#include <vector>
#include <eigen3/Eigen/Dense>
#include <eigen3/Eigen/Geometry>
#include <Ice/Ice.h>

#include "boost/date_time/posix_time/posix_time.hpp"
#include <boost/date_time/posix_time/posix_time.hpp>

#define _DEG2RAD 0.01745331111
#define _RAD2DEG 57.2957184819
Expand All @@ -40,7 +40,7 @@ class ARDroneDriver;
#define DRIVER_APPNAME "ardrone_server"
#define CAMERA_QUEUE_SIZE (10)
#define NAVDATA_QUEUE_SIZE (25)
#define CONFIG_FILE_PATH "/usr/local/share/jderobot/conf/config/config.xml"
#define CONFIG_FILE_PATH "@CMAKE_INSTALL_PREFIX@/share/jderobot/conf/config/config.xml"
#define CONFIG_FILE_TMP "/tmp"
#define LOOPRATE 30

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ extern "C" {
extern video_decoder_config_t vec;
}

#include "ardrone_driver.h"
#include <ardrone_server/ardrone_driver.h>

#define NB_DRIVER_POST_STAGES 10

Expand Down
2 changes: 1 addition & 1 deletion src/drivers/ardrone_server/include/ardrone_server/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ modified by: Alberto Martín Florido <almartinflorido@gmail.com>
#define _VIDEO_H_

#include "ardrone_sdk.h"
#include "ardrone_driver.h"
#include <ardrone_server/ardrone_driver.h>

// The maximum memory allocation
#define MAX_STREAM_WIDTH 640
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,10 @@ INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/libJderobotInterfaces.so DESTINATION $
# Install python files
FILE(GLOB_RECURSE HEADERS_FILES ${CMAKE_CURRENT_BINARY_DIR}/python/*py)
FOREACH(header ${HEADERS_FILES})
INSTALL(FILES ${header} DESTINATION ${PYTHON_MODULE_PATH}/ COMPONENT core)
INSTALL(FILES ${header} DESTINATION ${JDEROBOT_PYTHON_MODULE_PATH}/ COMPONENT core)
ENDFOREACH(header)

INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/python/jderobot/__init__.py DESTINATION ${PYTHON_MODULE_PATH}/jderobot/ COMPONENT core)
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/python/jderobot/__init__.py DESTINATION ${JDEROBOT_PYTHON_MODULE_PATH}/jderobot/ COMPONENT core)

# Install interfaces headers
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/cpp/jderobot/
Expand Down
2 changes: 1 addition & 1 deletion src/tools/navigatorCamera/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ install(TARGETS navigatorCamera
COMPONENT tools
)

INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/myimage.png DESTINATION /usr/local/share/jderobot/glade/ )
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/myimage.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/glade/ )
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/navigatorCamera.glade DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/glade )
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/navigatorCamera.cfg DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/conf)
24 changes: 23 additions & 1 deletion src/tools/visualStates/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
IF (goocanvasmm_INCLUDE_DIRS)

message("-----------------VisualStates---------------------")

SET( SOURCE_FILES_VISUALSTATES
iceinterface.cpp
point.cpp
Expand Down Expand Up @@ -98,11 +100,31 @@ add_custom_command(TARGET visualStates POST_BUILD

# Install Glade
FILE(GLOB_RECURSE GLADE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/gui/*.glade)
INSTALL (FILES ${GLADE_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/glade)
INSTALL (FILES ${GLADE_FILES} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/glade/visualStates)

# install resources (jderobot logo)
INSTALL (FILES ${CMAKE_CURRENT_SOURCE_DIR}/resources/jderobot.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/resources)


# Install C++ Headers
FILE(GLOB h_files "${CMAKE_CURRENT_SOURCE_DIR}/*.h")
INSTALL(FILES ${h_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/jderobot/visualStates)

FILE(GLOB h_files "${CMAKE_CURRENT_SOURCE_DIR}/popups/*.h")
INSTALL(FILES ${h_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/include/jderobot/visualStates/popups)


# Install Python Files
FILE(GLOB p_files "${CMAKE_CURRENT_SOURCE_DIR}/*.py")
INSTALL(FILES ${p_files} DESTINATION ${CMAKE_INSTALL_PREFIX}/share/jderobot/python/visualStates_py)


install(FILES getinterfaces.sh
DESTINATION ${CMAKE_INSTALL_PREFIX}/bin/
)



ENDIF()


Expand Down
16 changes: 9 additions & 7 deletions src/tools/visualStates/generate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,9 +637,10 @@ void Generate::generateCmake () {
this->fs << std::endl;
this->fs << "pkg_check_modules(GTKMM REQUIRED gtkmm-3.0)" << std::endl;
this->fs << std::endl;
this->fs << "SET( INTERFACES_CPP_DIR /usr/local/include )" << std::endl;
this->fs << "SET( INTERFACES_CPP_DIR /opt/jderobot/include )" << std::endl;
this->fs << "SET( LIBS_DIR /usr/local/lib )" << std::endl;
this->fs << "SET( easyiceconfig_LIBRARIES ${LIBS_DIR}/jderobot/libeasyiceconfig.so)" << std::endl;
this->fs << "SET( JDEROBOT_LIBS_DIR /opt/jderobot/lib )" << std::endl;
this->fs << "SET( easyiceconfig_LIBRARIES ${JDEROBOT_LIBS_DIR}/jderobot/libeasyiceconfig.so)" << std::endl;
this->fs << std::endl;
this->fs << "SET( CMAKE_CXX_FLAGS \"-pthread\" ) # Opciones para el compilador" << std::endl;
this->fs << std::endl;
Expand All @@ -652,10 +653,11 @@ void Generate::generateCmake () {
this->fs << ")" << std::endl;
this->fs << std::endl;
this->fs << "include_directories (" << std::endl;
this->fs << "\t/usr/local/include/jderobot" << std::endl;
this->fs << "\t/opt/jderobot/include/jderobot" << std::endl;
this->fs << "\t${INTERFACES_CPP_DIR}" << std::endl;
this->fs << "\t${easyiceconfig_INCLUDE_DIRS}" << std::endl;
this->fs << "\t${LIBS_DIR}" << std::endl;
this->fs << "\t${JDEROBOT_LIBS_DIR}" << std::endl;
this->fs << "\t${CMAKE_CURRENT_SOURCE_DIR}" << std::endl;
this->fs << "\t${GTKMM_INCLUDE_DIRS}" << std::endl;
this->fs << "\t${goocanvasmm_INCLUDE_DIRS}" << std::endl;
Expand All @@ -673,9 +675,9 @@ void Generate::generateCmake () {
this->fs << "\t${GTKMM_LIBRARIES}" << std::endl;
this->fs << "\t${easyiceconfig_LIBRARIES}" << std::endl;
this->fs << "\t${goocanvasmm_LIBRARIES}" <<std::endl;
this->fs << "\t${LIBS_DIR}/jderobot/libvisualStateslib.so" << std::endl;
this->fs << "\t${LIBS_DIR}/jderobot/libJderobotInterfaces.so" << std::endl;
this->fs << "\t${LIBS_DIR}/jderobot/libjderobotutil.so" << std::endl;
this->fs << "\t${JDEROBOT_LIBS_DIR}/jderobot/libvisualStateslib.so" << std::endl;
this->fs << "\t${JDEROBOT_LIBS_DIR}/jderobot/libJderobotInterfaces.so" << std::endl;
this->fs << "\t${JDEROBOT_LIBS_DIR}/jderobot/libjderobotutil.so" << std::endl;
this->fs << "\tIce" << std::endl;
this->fs << "\tIceUtil" << std::endl;
this->fs << ")" << std::endl;
Expand Down Expand Up @@ -703,7 +705,7 @@ void Generate::generateGenericHeaders_py(){
import Ice\n\
import easyiceconfig as EasyIce\n\
import sys, signal\n\
sys.path.append('/usr/local/share/jderobot/python/visualStates_py')\n\
sys.path.append('/opt/jderobot/share/jderobot/python/visualStates_py')\n\
import traceback, threading, time\n\
from automatagui import AutomataGui, QtGui, GuiSubautomata\n\n";

Expand Down
2 changes: 1 addition & 1 deletion src/tools/visualStates/visualStates.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ VisualStates::VisualStates ( BaseObjectType* cobject, const Glib::RefPtr<Gtk::Bu
// get the logo image
refBuilder->get_widget("jderobotlogo", this->logo);
//TODO: we assume a fixed installation path, we should get the installation path from CMAKE maybe
this->logo->set("/usr/local/share/jderobot/resources/jderobot.png");
this->logo->set("/opt/jderobot/share/jderobot/resources/jderobot.png");

// ASSIGNING SIGNALS
// Of the menu items
Expand Down