finishing up FRCSim installer

adds build of gz_msgs on end-user computer
This means we don't need to provide different zips for different
versions of ubuntu.
The problem was that gazebo on 14.04 comes with protobuf 2.5 but gazebo on 15.10 comes with 2.6
added a few other fixes to the install script as well

also fix dependency between simluation publishing and libwpilibcsim
building

Change-Id: I57d5a26ed7795bc61a25402e2986c6023d1d78ac
This commit is contained in:
Peter_Mitrano
2015-12-28 01:50:35 -05:00
parent 17b363f3b4
commit acc7fbbf01
6 changed files with 50 additions and 33 deletions

View File

@@ -5,7 +5,7 @@ publishing {
publications {
simulation(MavenPublication) {
artifact zip
groupId 'simulation'
groupId 'edu.wpi.first.wpilib.simulation'
artifactId 'simulation'
version '1.0.0'
}

View File

@@ -121,7 +121,7 @@ function install-eclipse {
fi
tar -xf /tmp/eclipse.tar.gz -C /opt
ln -s /opt/eclipse/eclipse /usr/bin/eclipse
ln -fs /opt/eclipse/eclipse /usr/bin/eclipse
}
function install-desktops {
@@ -143,7 +143,7 @@ function install-toolchain {
add-apt-repository ppa:openjdk-r/ppa -y
add-apt-repository ppa:ubuntu-toolchain-r/test -y
apt-get update
apt-get install libprotoc-dev libprotobuf-dev protobuf-compiler g++-4.9 openjdk-8-jdk -y
apt-get install cmake libprotoc-dev libprotobuf-dev protobuf-compiler g++-4.9 openjdk-8-jdk -y
ln -fs /usr/bin/g++-4.9 /usr/bin/g++
}
@@ -154,7 +154,9 @@ function install-models {
install-fail
fi
unzip /tmp/models.zip -d ~/wpilib/simulation
unzip /tmp/models.zip -d /tmp
mv /tmp/frcsim-gazebo-models/models ~/wpilib/simulation/models
mv /tmp/frcsim-gazebo-models/worlds ~/wpilib/simulation/worlds
}
function install-frcsim {
@@ -196,6 +198,8 @@ function install-frcsim {
install-desktops
install-models
sudo chown -R $USER:$USER ~/wpilib
# Done
echo "Installation Finished!!"
}

View File

@@ -1,6 +1,25 @@
cmake_minimum_required(VERSION 2.8)
Cmake_minimum_required(VERSION 2.8)
project(gz_msgs)
#copied from GazeboUtils.cmake
macro (APPEND_TO_CACHED_STRING _string _cacheDesc)
FOREACH (newItem ${ARGN})
SET (${_string} "${${_string}} ${newItem}" CACHE INTERNAL ${_cacheDesc} FORCE)
ENDFOREACH (newItem ${ARGN})
endmacro (APPEND_TO_CACHED_STRING)
find_package(Protobuf REQUIRED)
if (NOT PROTOBUF_FOUND)
MESSAGE ("Missing: Google Protobuf (libprotobuf-dev)")
endif()
if (NOT PROTOBUF_PROTOC_EXECUTABLE)
MESSAGE ( "Missing: Google Protobuf Compiler (protobuf-compiler)")
endif()
if (NOT PROTOBUF_PROTOC_LIBRARY)
MESSAGE ("Missing: Google Protobuf Compiler Library (libprotoc-dev)")
endif()
#list all proto files used
get_filename_component(PROTO_DIR src/main/proto ABSOLUTE)
set(msgs
@@ -62,10 +81,9 @@ else()
endif()
target_link_libraries(${PROJECT_NAME} ${PROTOBUF_LIBRARIES})
set_target_properties(${PROJECT_NAME}
PROPERTIES
INSTALL_RPATH "${ENV_HOME}/wpilib/simulation/lib"
LIBRARY_OUTPUT_DIRECTORY ${SIMULATION_INSTALL_DIR}/lib)
set_target_properties(${PROJECT_NAME} PROPERTIES INSTALL_RPATH "$ENV{HOME}/wpilib/simulation/lib")
file(COPY "${GZ_MSGS_INCLUDE_DIR}/simulation"
DESTINATION "${CMAKE_BINARY_DIR}/install/simulation/include")
install(TARGETS ${PROJECT_NAME}
DESTINATION "$ENV{HOME}/wpilib/simulation/lib")
install(DIRECTORY "${GZ_MSGS_INCLUDE_DIR}/simulation"
DESTINATION "$ENV{HOME}/wpilib/simulation/include")

View File

@@ -1,6 +1,19 @@
Building gz_msgs
================
Currently uses cmake.
This is build as a part of the whole cmake project.
see top level building.md for detail
gz_msgs currently uses cmake, is built on the end-users computer.
This allows us to support various versions of protobuf (2.5 on Ubuntu 14.04, 2.6 on Ubuntu 15.10)
To build, run the following commands in the ~/wpilib/simulation/gz_msgs directory.
If that directory doesn't exist, it means you haven't installed correctly.
If you're a developer for wpilib, you will need to unzip the simulation.zip file you published into ~/releases.
If you are a student using FRCSim, you should have downloaded that zip when you installed frcsim.
mkdir build
cd build
cmake ..
make
make install
If you are installing FRCSim with the script, then this *should* have be done for you.