Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
SyllogismRXS committed Aug 2, 2017
0 parents commit a5af55e
Show file tree
Hide file tree
Showing 621 changed files with 727,206 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
include/scrimmage/proto/*.py
include/scrimmage/proto/*.pb.*
build
.gdbinit
Makefile
gdb.txt
gdb_monitor.log
.temp_mission*
*.pyc
.*.xml
*.npy
.debug_location
*.*~
*.*#
*.so
id_rsa*
.ycm_extra_conf.py
callgrind*
*toolchain.cmake*
release
debug
*.swo
*.pb.h
*.pb.cc
*egg-info*
grpc.patch
py_bindings
82 changes: 82 additions & 0 deletions 3rd-party/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
cmake_minimum_required (VERSION 3.5)

project (scrimmage-deps)

set(PATCH_DIR "${CMAKE_SOURCE_DIR}/patches")
set(SETUP_DIR "${CMAKE_SOURCE_DIR}/setup")
set(PATCH_SCRIPT "${SETUP_DIR}/apply-patch.sh")

if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX $ENV{HOME}/.local CACHE PATH "Change default install path." FORCE)
endif()

set(SCRIMMAGE_LOCAL_CONFIG_DIR "$ENV{HOME}/.scrimmage")
set(SCRIMMAGE_ENV_DIR "${SCRIMMAGE_LOCAL_CONFIG_DIR}/env")
file(MAKE_DIRECTORY ${SCRIMMAGE_ENV_DIR})
configure_file(${CMAKE_SOURCE_DIR}/cmake/Modules/setenv.in
"${SCRIMMAGE_ENV_DIR}/${PROJECT_NAME}-setenv" @ONLY)
execute_process(COMMAND bash "-c" "${SETUP_DIR}/edit-config.sh ${SCRIMMAGE_LOCAL_CONFIG_DIR} ${PROJECT_NAME}" OUTPUT_VARIABLE result)

include(ExternalProject)

ExternalProject_Add (
jsbsim
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
GIT_REPOSITORY "git://git.code.sf.net/p/jsbsim/code"
GIT_TAG "36de9ac63c959cef5d7b2c56fb49c1a57fd46369"
PATCH_COMMAND ${PATCH_SCRIPT} ${PATCH_DIR}/jsbsim.patch
UPDATE_COMMAND ${SETUP_DIR}/install-aircraft.sh "${CMAKE_CURRENT_BINARY_DIR}/src/jsbsim"
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
)

########################################################
# Download and build protobuf
########################################################
set(PROTOBUF_CMAKE_MODULE_DIR ${CMAKE_INSTALL_PREFIX}/share/cmake/protobuf/)
set(PROTOBUF_VERSION v3.3.0)
ExternalProject_Add (
protobuf
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
GIT_REPOSITORY "https://github.com/google/protobuf.git"
GIT_TAG ${Protobuf_VERSION}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ./autogen.sh COMMAND ./configure --prefix=${CMAKE_INSTALL_PREFIX}
PATCH_COMMAND ""
UPDATE_COMMAND ""
INSTALL_COMMAND make install
)

#set(CMAKE_PREFIX_PATH $ENV{HOME}/.local/)

configure_file(${PATCH_DIR}/grpc.patch.in ${PATCH_DIR}/grpc.patch)

########################################################
# Download and build grpc
########################################################
set(GRPC_VERSION v1.2.1)
ExternalProject_Add (
grpc
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
BUILD_IN_SOURCE 1
CONFIGURE_COMMAND ""
BUILD_COMMAND make HAS_SYSTEM_PROTOBUF=true PROTOC=${CMAKE_INSTALL_PREFIX}/bin/protoc
DEPENDS protobuf
GIT_REPOSITORY "https://github.com/grpc/grpc"
GIT_TAG ${GRPC_VERSION}
UPDATE_COMMAND ""
PATCH_COMMAND ${PATCH_SCRIPT} ${PATCH_DIR}/grpc.patch
INSTALL_COMMAND make install prefix=${CMAKE_INSTALL_PREFIX}
# CMAKE_ARGS
# -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
# -DCMAKE_PREFIX_PATH=${CMAKE_INSTALL_PREFIX}
# -DgRPC_PROTOBUF_PROVIDER="package"
# -DgRPC_SSL_PROVIDER="package"
)

ExternalProject_Add(
pybind11
GIT_REPOSITORY https://github.com/pybind/pybind11.git
GIT_TAG 13d8cd2cc7566de34d724f428ea7a6b6448d6a0c
PREFIX ${CMAKE_CURRENT_BINARY_DIR}
CMAKE_ARGS -DPYBIND11_TEST:BOOL=OFF -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
)
7 changes: 7 additions & 0 deletions 3rd-party/cmake/Modules/setenv.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
######################################################
# DO NOT EDIT. Generated by:
# @CMAKE_SOURCE_DIR@/CMakeLists.txt
######################################################
export LD_LIBRARY_PATH=@CMAKE_INSTALL_PREFIX@/lib:${LD_LIBRARY_PATH}
export JSBSIM_ROOT=@CMAKE_BINARY_DIR@/src/jsbsim

22 changes: 22 additions & 0 deletions 3rd-party/patches/grpc.patch.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
commit f9f39281f4c51f8a85dcb84946e9b6728f1ad079
Author: Kevin DeMarco <[email protected]>
Date: Wed Sep 14 15:34:53 2016 -0400

Include local build's include, library path, and load library path

diff --git a/Makefile b/Makefile
index eb0e216..23aefd9 100644
--- a/Makefile
+++ b/Makefile
@@ -373,6 +373,11 @@ endif
INCLUDES = . include $(GENDIR)
LDFLAGS += -Llibs/$(CONFIG)

+# Patch for inclusion of local protobuf installation
+INCLUDES += ${CMAKE_INSTALL_PREFIX}/include
+LDFLAGS += -L${CMAKE_INSTALL_PREFIX}/lib
+LD_LIBRARY_PATH = ${CMAKE_INSTALL_PREFIX}/lib
+
ifeq ($(SYSTEM),Darwin)
ifneq ($(wildcard /usr/local/ssl/include),)
INCLUDES += /usr/local/ssl/include
70 changes: 70 additions & 0 deletions 3rd-party/patches/jsbsim.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
commit aaa75f97b7e37b4749be75853a26651513663c75
Author: Kevin DeMarco <[email protected]>
Date: Tue Oct 4 11:59:39 2016 -0400

GTRI patch for SCRIMMAGE

diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 7336db9..f747299 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -117,6 +117,10 @@ install(TARGETS libJSBSim LIBRARY DESTINATION lib
add_executable(JSBSim JSBSim.cpp)
target_link_libraries(JSBSim libJSBSim)

-install(TARGETS JSBSim RUNTIME DESTINATION bin)
+option(INSTALL_JSBSIM_EXEC "INSTALL_JSBSIM_EXEC" OFF)
+if (INSTALL_JSBSIM_EXEC)
+ install(TARGETS JSBSim RUNTIME DESTINATION bin)
+endif()
+
install(FILES ${HEADERS} DESTINATION include/JSBSim)

diff --git a/src/FGFDMExec.cpp b/src/FGFDMExec.cpp
index 8552a51..23e6f30 100644
--- a/src/FGFDMExec.cpp
+++ b/src/FGFDMExec.cpp
@@ -209,7 +209,7 @@ FGFDMExec::~FGFDMExec()

PropertyCatalog.clear();

- SetGroundCallback(0);
+ //SetGroundCallback(0);

if (FDMctr > 0) (*FDMctr)--;

diff --git a/src/simgear/props/props.hxx b/src/simgear/props/props.hxx
index b3ce4fb..c7cfee7 100644
--- a/src/simgear/props/props.hxx
+++ b/src/simgear/props/props.hxx
@@ -31,29 +31,7 @@
# define SG_WARN 1
# define SG_LOG(type, level, message) (type) ? (std::cerr <<message << endl) : (std::cout <<message << endl)
#endif
-namespace boost {
- template <bool B, class T = void>
- struct enable_if_c {
- typedef T type;
- };
-
- template <class T>
- struct enable_if_c<false, T> {};
-
- template <class Cond, class T = void>
- struct enable_if : public enable_if_c<Cond::value, T> {};
-
- template <bool B, class T = void>
- struct disable_if_c {
- typedef T type;
- };
-
- template <class T>
- struct disable_if_c<true, T> {};
-
- template <class Cond, class T = void>
- struct disable_if : public disable_if_c<Cond::value, T> {};
-}
+#include <boost/utility/enable_if.hpp>
#else
# include <boost/utility.hpp>
# include <boost/type_traits/is_enum.hpp>
58 changes: 58 additions & 0 deletions 3rd-party/setup/apply-patch.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/sh
# ---------------------------------------------------------------------------
# @section LICENSE
#
# Copyright (c) 2016 Georgia Tech Research Institute (GTRI)
# All Rights Reserved
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# ---------------------------------------------------------------------------
# @file filename.ext
# @author Kevin DeMarco <[email protected]>
# @author Eric Squires <[email protected]>
# @version 1.0
# ---------------------------------------------------------------------------
# @brief A brief description.
#
# @section DESCRIPTION
# A long description.
# ---------------------------------------------------------------------------

#branch_name="$(git symbolic-ref HEAD 2>/dev/null)" ||
#branch_name="(unnamed branch)" # detached HEAD
#branch_name=${branch_name##refs/heads/}
#
## $1 - original-branch
## $2 - patch-file.patch
#
#echo "==========> BRANCH NAME: $branch_name"
#if [ $branch_name = $1 ]; then
# echo "APPLY!"
# git checkout -b gtri-patch
# git apply $(readlink -f "$2")
# git commit -a -m "GTRI patch"
#fi

# How to create a git patch:
# 1.) Make changes in git repository
# 2.) git add <thechanges>
# 3.) git commit -m "patch message"
# 4.) git show HEAD > my.patch

PATCH_FILE=$(readlink -f "$1")

# Only apply the patch if it hasn't been applied yet
git apply --check $PATCH_FILE > /dev/null 2>&1
STATUS=$?
if [ $STATUS -eq 0 ]; then
git apply $PATCH_FILE
fi
44 changes: 44 additions & 0 deletions 3rd-party/setup/edit-config.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/bin/bash
# ---------------------------------------------------------------------------
# @section LICENSE
#
# Copyright (c) 2016 Georgia Tech Research Institute (GTRI)
# All Rights Reserved
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
# ---------------------------------------------------------------------------
# @file filename.ext
# @author Kevin DeMarco <[email protected]>
# @author Eric Squires <[email protected]>
# @version 1.0
# ---------------------------------------------------------------------------
# @brief A brief description.
#
# @section DESCRIPTION
# A long description.
# ---------------------------------------------------------------------------
function write_source_line {
if [ -e "$1" ]; then
SOURCE_LINE="source $(readlink -f $2)"
grep "$SOURCE_LINE" "$1" > /dev/null 2>&1
if [ $? != 0 ]; then
echo $SOURCE_LINE >> $1
fi
fi
}

# The output directory is the first argument
SCRIMMAGE_LOCAL_CONFIG_DIR=$(readlink -f "$1")
PROJECT_NAME="$2"

touch ${SCRIMMAGE_LOCAL_CONFIG_DIR}/setup.bash
write_source_line "${SCRIMMAGE_LOCAL_CONFIG_DIR}/setup.bash" "${SCRIMMAGE_LOCAL_CONFIG_DIR}/env/${PROJECT_NAME}-setenv"
Loading

0 comments on commit a5af55e

Please sign in to comment.