Skip to content

Commit

Permalink
Windows fixes (#85)
Browse files Browse the repository at this point in the history
* * Making changes to the build scripts for Windows fixes and also
upgrading to 0.7.0 of capnp

* * Beginning to attempt to bring GAMS back into Windows compilability
* Added capnp feature, similar to the one added to MADARA
* Fixed warnings about conversions in several places
* Updated base_build.bat script to be slightly better for windows
building but still requires forcing installation of capnp or other
tools. I may have to give up on .bat scripting and just use perl or
something else here to properly set variables and dictate installation
flow.

* * Fixed template issues in VS 2017
* Fixed some external linking issues involving usage of GAMS_EXPORT
* Fixed OSC linking on Windows
* Only current issue that needs looking into is a set of C4244 warnings involving xutility

* * Forcing using c++ 14 to allow for capnp features

* * Synchronizing recent changes to GAMS windows_fixes. There still appears to be a linking error in clang for gams_controller involving MADARA linking

* * Updated capnp to be a feature so we can disable/enable the compilation on Linux and Windows

* * Updated CI tests to do a capnp optional with clang and g++

* * Updated GAMS CI to only call test_types if capnp is enabled

* * Separating capnp_files format in MPC from the feature of including it

* * Integrated capnp feature into the base_build.sh feature enabling process for building

* * Fixing some issues with the passthrough of capnp feature in the CI

* * Updating CI to include capnp in Android builds, since Java support currently has capnp baked in with no feature enabling

* * Fixed shadow warning in Epsilon.h
* Updated base_build.sh to use latest Eigen and clang 6.0

* * Updating GAMS build scripts to also build capnproto-java, though I'm not entirely sure it's necessary at this point to support the Java and capnp build anymore

* * Updated Multicontroller to no longer fail when resizing after a
default constructor call

* * Added patch file for capnpc-java
* Updated base_build.sh to respect the CC and CXX that is passed to the script as environment variables
* Updated travis.yml to force clang-5.0++

* * Updated Multicontroller to initialize variables in a resize by default. This allows for the creation of appropriate self_ variables within platforms without needing to call init_variables after an init_platform call

* * Fixed capnp types issues in GAMS
* Updated .travis.yml to include types checks on test_any test

* * Attempting to fix issues in Travis CI

* * Updated using_boost for latest boost versions with VS 2017 (required by UE)

* * Added explicit clang-suffix options for base_build.sh
  * Can invoke specific installation and compilation with clang-5, clang-6, clang-8, and clang-9

* * Fixing issue in last commit with special clang instructions to base_build.sh

* * Added support for the clang-SUFFIX build options to also affect all prereqs and not just MADARA and GAMS

* * Fixed issues with clang installation when you haven't set CLANG_SUFFIX or any of the FORCE_CC/CXX options in your bashrc. It should automatically do things now for clang-8 or clang-9

* * Updated base_build.bat to echo a .gams\env.bat that should set variables from command line

* * Added a set environment option to the base_build.bat script (setenv)

* * Updated base_build.bat for both VS2017 and VS2019 to be more seamless in installation process

* * Removing capnp from python and protecting some code with ifdefs for CAPNP

* * Fixed allow_failures issues in Travis CI
* Updated Travis CI config with updated jobs/exclude keywords

* * Removing clang-5 explicit call in Ubuntu Travis CI

* * Reverting change to force cc/c++ compiler clang-5 in ubuntu

* * Removed OSX clang zmq as zmq is no longer building on Mac

* * Adding zmq android build back to allow_failures

* * Added height differentiation and movement to FormationSync

* * Updated FormationSync to use Pose from_container to be more portable

* * Adding brew install for llvm 5, 6, 8 and 9

* * [skip ci]
* Adding Mac build instructions for clang into it's own section

* [skip ci]
* Updating Mac build

* * Updated mac/base_build.sh to attempt to reference the local directory
  instead of the GAMS_ROOT environment variable (which may not be set
  yet)

* * Fixed clang-8, clang-9, etc. support for Mac builds. This is needed to
  help with supporting Unreal Engine on Mac and future build features

* * Changed resize in Multicontroller to allow for only setting swarm.size
  instead of requiring all variables to be initialized in swarm vars
* Added refresh_vars to Multicontroller
* Reduced memory footprint for large swarms substantially in
  Multicontroller

* * Added installation option for opencv on Windows

* * Added opencv installation option for Linux

* * Updated gpc.pl to generate a project that is compilable on Windows

* * Added cmake support for base gams library and gams_controller

* * Windows script is now stable. Installs MADARA and GAMS with cmake
* Updated Cmake to install Boost and MADARA through find_package
* Added configuration and cmake system for GAMS

* * Fixed a scalability issue in gams_controller. The multicontroller was
  creating swarm variables, when it should just init_vars with the id to
  start with for populating self_ variables

* * Updated Windows installation to set PATH appropriately
* Updated MADARA and GAMS installation so linkage

* * Removed warnings in compilation with Cmake and stricter settings on Linux
* Updated CMakeLists.txt to build on Linux

* * Removed versioning from dlls in CMake process

* * Added gams_version
* Fixed incompatibilities between Cmake Windows, Linux, Mac

* * Added feature option for osc since UnrealGAMS is not primary simulator

* * Updated test_utility to properly feature-enable OSC

* * Add default feature of 0 for OSC

* * Adjusting osc feature-enable in base_build.sh for linux/mac

* * Reverted changes to Follow concerning the ReferenceFrame retrieval

* * Implemented initial hive controller

* * Added HiveController sanity checks
* Added test for HiveController
* Added default installs for tests and programs in cmake

* * Updated get_kb and refresh_vars to work with offsets in Hivecontroller

* * Fixed bugs in HiveController
* Added exists function to PlatformFactoryRepository to check if an
  alias is already assigned for a platform factory
* Added more debugging to test_hivecontroller when errors occur

* * Fixed clang warnings in cmake builds

* * Reduced codeowners to 1 user

* Add SCRIMMAGE support to GAMS (#84)

* Added updated base build script which includes scrimmage

* Change from SCRIMMAGE_ROOT to SCRIMMAGE_GIT_ROOT because of collisions in SCRIMMAGE setup.sh

* Copy pasta file for linking

* Added cleanenv option which resets the environment. Fixes a longtime running bug where switching environments will cause the dependencies to be installed in different locations

* Add scrimmage feature

* Added building and linking files for scrimmage

* Small fix

* Starting work for integrating the build of a SCRIMMAGE plugin

* Fixing long standing bug where GAMS re-clones itself disregarding the fact that gams was already cloned and installed on a PC. Now, if the present working directory name is gams, it will not do so

* Upd

* Fix cleanenv

* Fix circular dependency

* Fix plugin path setting to happen after GAMS_ROOT is set

* Add plugin stubs to test if plugin is loading

* Added xml files and fixed using_scrimmage for include paths

* Small bug fixes to build process. Trying to debug missing headers for plugin linking

* Fix ordering in base build

* Numerous changes and SCRIMMAGE_ROOT fixes

* Added fix for endif in GAMSAutonomy

* Fixed build files, temporarily forcing use of c++14 so it compiles.

* Added updated gams.pc

* Added updated base build script which includes scrimmage

* Change from SCRIMMAGE_ROOT to SCRIMMAGE_GIT_ROOT because of collisions in SCRIMMAGE setup.sh

* Merge capnp and scrimmage changes in basebuild

* Added building and linking files for scrimmage

* Small fix

* Starting work for integrating the build of a SCRIMMAGE plugin

* Fix circular dependency

* Fix plugin path setting to happen after GAMS_ROOT is set

* Small bug fixes to build process. Trying to debug missing headers for plugin linking

* Fix ordering in base build

* Numerous changes and SCRIMMAGE_ROOT fixes

* Add path to GAMSAutonomy.xml to scrimmage plugin path

* Add changes so that the plugin loads in. Though missing some variables, but loads in SCRIMMAGE

* Add default variables for car controller plugin?

* Add empty functions, still need to modify controller

* Lots of updates, added in scrimmage, still bugs for linking but mostly works

* Divided plugin and the full gams integration, compiles

* Fix 2 bugs with segfaults in gams_controller

* gams controller can now run a scrimmage instance and control its loops, as well as spawn in agents. more to come

* Fix missing env vars, works after a cleanenv now

* Runs and works tested with 1 agent now.

* Runs with 200 agents

* Change default world to just be a quadrotor base so we can control it with GAMS easy

* Some changes to scrimmage code

* Lots of changes, it runs now, just need to figure out how to get a madara file properly setting a KB through a gams controller

* Update

* Added temporary placement of scrimmage.mf

* Compiles and runs for now. No segfaults. But more coding to do as next position is not set

* Now moves

* Remove accidentally added scrimmage dir, now inside .gitignore

* Hooked up GAMSAutonomy plugin, now we're talking!

* Now moves exactly towards the positions given by GAMS

* Small changes

* Update

* Cleaning up of the GAMS repo with extra files/removal of non essential changes

* Add demo shell scripts

* Revert default world back to working model

* Spawning multiple agents programmatically now

* Now spawns at runtime, pending bugfix on scrimmage side

* Updated with most recent demo code

* Fixed off by 1 bug, agents move accordingly

* Fix multiple frame bugs and touch up some debug lines

* Add orientation function but there's a double orientation set bug atm

* Orientation setup needs to be rethough due to the way the scrimmage sim handles setting orientation

* Added run threaded support for super efficient running

* Update

* Add fixes to the pathing for mission path and plugin path for SCRIMMAGE inside base build

* Add change to prevent GAMS from being pulled from jredmondson master, super annoying when trying to develop

* Fix scrimmage mission path bug

* Add arg to print statement in Multicontroller

* Fix cleanenv params for paths

* Added singleton pattern and support for options for run_simcontrol_threaded and non threaded via KB/CLI scripts

* Added run threaded option as static var

* Fix exception in Follow bug after missed revert causing same bug again

* Update

* Add multiple types and passing of world file via madara mf/kb

* Add fixed wing support to GAMS scrimmage

* Add some function descriptions:

* Added log detailed statements

* Add demo scripts

* set SCRIMMAGE in base_build.sh

* Revert adding double line, already there.

* add $SCRIMMAGE support to testing

* Add #ifdef to SCRIMMAGEBasePlatform.cpp

* Add in #ifdef to SCRIMMAGEBasePlatform.h

* Remove simcontrol pointer in Multicontroller.h

* Remove simcontrol object use from Multicontroller.cpp

* Add auto yes option to PPA for SCRIMMAGE

* * Updated to version 1.3.0
* Adding notes to changes to discuss with Devon about Scrimmage support
* Made sure to add the GAMS_SCRIMMAGE ifdefs in files where appropriate
  to prevent compilation in cmake and any other build system
* Added debug warnings for hive not being set in HiveController

Co-authored-by: TheDash <noobaca2@gmail.com>
  • Loading branch information
jredmondson and UltronDestroyer authored Apr 7, 2020
1 parent 39ef920 commit e09033e
Show file tree
Hide file tree
Showing 111 changed files with 5,732 additions and 744 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @jredmondson @dskyle
* @jredmondson
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ lib*
*.vcxproj.filters
.vscode
capnproto/
*.capnp.cpp

gams.VC.db
gams.sdf
Expand Down Expand Up @@ -47,13 +48,18 @@ test_formation_sync
test_location
test_euler
test_utm
scrimmage

core

bin/*
ACE_TAO/*
MPC/*
madara/
eigen/
oscpack/
install
build

#Ignore maven project files
target/
Expand Down Expand Up @@ -85,3 +91,7 @@ scripts/simulation/unreal/spell/config.yaml
.vs/
Release/
Debug/
*.vcxproj.*

cmake/cpack_options.cmake
src/gams/utility/Version.h
42 changes: 18 additions & 24 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
sudo: required
dist: xenial
group: travis_latest
language: cpp
os:
- linux

branches:
excludes:
exclude:
- gh-pages
- tutorials
- installers
Expand All @@ -16,24 +15,23 @@ compiler:
- gcc

env:
matrix:
jobs:
global:
- MADARA_ROOT=$TRAVIS_BUILD_DIR/madara
- GAMS_ROOT=$TRAVIS_BUILD_DIR
- MPC_ROOT=$TRAVIS_BUILD_DIR/MPC
- EIGEN_ROOT=$TRAVIS_BUILD_DIR/eigen
- CAPNP_ROOT=$TRAVIS_BUILD_DIR/capnproto
- LD_LIBRARY_PATH=$MADARA_ROOT/lib:$GAMS_ROOT/lib:$LD_LIBRARY_PATH:$CAPNP_ROOT/c++/.libs
- LD_LIBRARY_PATH=$MADARA_ROOT/lib:$GAMS_ROOT/lib:$LD_LIBRARY_PATH
- CORES=6
- TESTS="tests"
- GAMS="gams"

matrix:
jobs:

allow_failures:
- env: NAME="OSX 10.13 clang zmq" CLANG="clang" ZMQ="zmq"
- env: NAME="Ubuntu 16.04 android zmq" ANDROID="android" ZMQ="zmq" TESTS="" CLANG="" GAMS=""
- env: NAME="Ubuntu 16.04 android" ANDROID="android" SSL="ssl" TESTS="" CLANG="" GAMS=""
- env: NAME="OSX 10.13 clang-5 zmq" CLANG="clang-5" ZMQ="zmq"
- env: NAME="Ubuntu 16.04 android ssl" ANDROID="android" SSL="ssl"
- env: NAME="Ubuntu 16.04 android zmq" ANDROID="android" ZMQ="zmq"

include:
################MAC#####################
Expand All @@ -56,12 +54,6 @@ matrix:
os: osx
osx_image: xcode9.3

# clang, osx, zeromq
- compiler: clang
env: NAME="OSX 10.13 clang zmq" CLANG="clang" ZMQ="zmq"
os: osx
osx_image: xcode9.3

# clang, osx, simtime
- compiler: clang
env: NAME="OSX 10.13 clang simtime" CLANG="clang" SIMTIME="simtime"
Expand All @@ -72,7 +64,7 @@ matrix:

# clang, linux, no ssl
- compiler: clang
env: NAME="Ubuntu 16.04 clang" CLANG="clang"
env: NAME="Ubuntu 16.04 clang" CLANG="clang" CC=clang-5.0 CXX=clang++-5.0
addons:
apt:
sources:
Expand All @@ -84,7 +76,7 @@ matrix:
# g++, linux, no ssl
- compiler: gcc
os: linux
env: NAME="Ubuntu 16.04 g++" CLANG=""
env: NAME="Ubuntu 16.04 g++"

# g++, linux, ssl
- compiler: gcc
Expand All @@ -95,7 +87,7 @@ matrix:
- ubuntu-toolchain-r-test
packages:
- libssl-dev
env: NAME="Ubuntu 16.04 g++ ssl" CLANG="" SSL="ssl"
env: NAME="Ubuntu 16.04 g++ ssl" SSL="ssl"

# g++, linux, java
- compiler: gcc
Expand All @@ -116,15 +108,16 @@ matrix:
- compiler: gcc
os: linux
env: NAME="Ubuntu 16.04 g++ simtime" SIMTIME="simtime"

# g++, linux, android, zmq
- compiler: gcc
os: linux
env: NAME="Ubuntu 16.04 android zmq" ANDROID="android" ZMQ="zmq" TESTS="" CLANG="" GAMS=""
env: NAME="Ubuntu 16.04 android zmq" ANDROID="android" ZMQ="zmq"

# g++, linux, android, ssl
- compiler: gcc
os: linux
env: NAME="Ubuntu 16.04 android" ANDROID="android" SSL="ssl" TESTS="" CLANG="" GAMS=""
env: NAME="Ubuntu 16.04 android ssl" ANDROID="android" SSL="ssl"

addons:
apt:
Expand All @@ -144,16 +137,18 @@ before_script:
- export
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then export OS=linux; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export OS=mac; export CLANG_SUFFIX=; export JAVA_HOME=$(/usr/libexec/java_home) ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$MADARA_ROOT/lib:$GAMS_ROOT/lib:$VREP_ROOT:$CAPNP_ROOT/c++/.libs ; fi
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$MADARA_ROOT/lib:$GAMS_ROOT/lib:$VREP_ROOT ; fi
- if [[ "$JAVA" == "java" ]]; then echo "TRAVIS_JDK_VERSION=TRAVIS_JDK_VERSION" ; fi
script:
- echo "TRAVIS_BRANCH=$TRAVIS_BRANCH"
- echo "TRAVIS_PULL_REQUEST=$TRAVIS_PULL_REQUEST"
- echo "TRAVIS_BUILD_DIR=$TRAVIS_BUILD_DIR"
- echo ls $TRAVIS_BUILD_DIR
- ls $TRAVIS_BUILD_DIR
- echo $GAMS_ROOT/scripts/$OS/base_build.sh prereqs $CLANG madara $GAMS $TESTS types $SSL $JAVA $ZMQ $PYTHON $ROS $SIMTIME $ANDROID
- $GAMS_ROOT/scripts/$OS/base_build.sh prereqs $CLANG madara $GAMS $TESTS types $SSL $JAVA $ZMQ $PYTHON $ROS $SIMTIME $ANDROID
# need to remove this later. This is just for CI to approve the fix, since it requires to be featured out
- git clone --single-branch --branch windows_fixes https://github.com/jredmondson/madara.git
- echo $GAMS_ROOT/scripts/$OS/base_build.sh prereqs $CLANG madara $GAMS $TESTS $TYPES $SSL $JAVA $ZMQ $PYTHON $ROS $SIMTIME $ANDROID $SCRIMMAGE
- $GAMS_ROOT/scripts/$OS/base_build.sh prereqs $CLANG madara $GAMS $TESTS $TYPES $SSL $JAVA $ZMQ $PYTHON $ROS $SIMTIME $ANDROID $SCRIMMAGE
- if [ ! -z $TESTS ]; then $GAMS_ROOT/bin/test_arguments_parser; fi
- if [ ! -z $TESTS ]; then $GAMS_ROOT/bin/test_auctions; fi
- if [ ! -z $TESTS ]; then $GAMS_ROOT/bin/test_controller_run; fi
Expand All @@ -165,5 +160,4 @@ script:
- if [ ! -z $TESTS ] && [ "$ROS" == "ros" ]; then $GAMS_ROOT/bin/test_ros2gams; fi
- if [ ! -z $TESTS ]; then $GAMS_ROOT/bin/test_utility; fi
- if [ ! -z $TESTS ]; then $GAMS_ROOT/bin/test_variables; fi
- if [ ! -z $TESTS ]; then $GAMS_ROOT/bin/test_types; fi

131 changes: 131 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@

cmake_minimum_required(VERSION 3.10)

# Read VERSION.txt and set GAMS_VERSION variables
file(STRINGS "VERSION.txt" GAMS_VERSION)
string(REPLACE "." ";" VERSION_LIST ${GAMS_VERSION})
list(GET VERSION_LIST 0 GAMS_MAJOR_VERSION)
list(GET VERSION_LIST 1 GAMS_MINOR_VERSION)
list(GET VERSION_LIST 2 GAMS_PATCH_VERSION)

set(MIN_MADARA_VERSION 3.3.0)

# Get helper cmake macros
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
include(gams_macros)

# Define the GAMS project and version
project(GAMS VERSION "${GAMS_VERSION}")

# Provide a lowercase version of project
string(TOLOWER ${PROJECT_NAME} PROJECT_NAME_LOWER)
string(TOUPPER ${PROJECT_NAME} PROJECT_NAME_UPPER)

set(GAMS_CMAKE_DIR ${PROJECT_SOURCE_DIR}/cmake CACHE PATH "Location of CMake scripts")
set(GAMS_INCLUDE_DIR ${PROJECT_SOURCE_DIR}/src CACHE PATH "Location of GAMS source")
set(GAMS_BIN_DIR ${PROJECT_SOURCE_DIR}/bin CACHE PATH "Location of GAMS scripts and binaries")
set(GAMS_LIB_DIR ${PROJECT_SOURCE_DIR}/lib CACHE PATH "Location of GAMS libraries")

########################################
# Package Creation:
include (${GAMS_CMAKE_DIR}/gams_cpack.cmake)
set (CPACK_PACKAGE_VERSION "${GAMS_VERSION}")
set (CPACK_PACKAGE_VERSION_MAJOR "${GAMS_MAJOR_VERSION}")
set (CPACK_PACKAGE_VERSION_MINOR "${GAMS_MINOR_VERSION}")
set (CPACK_PACKAGE_VERSION_PATCH "${GAMS_PATCH_VERSION}")

if (CPACK_GENERATOR)
message(STATUS "Found CPack generators: ${CPACK_GENERATOR}")

configure_file("${GAMS_CMAKE_DIR}/cpack_options.cmake.in" ${GAMS_CPACK_CFG_FILE} @ONLY)
set(CPACK_PROJECT_CONFIG_FILE ${GAMS_CPACK_CFG_FILE})
include (CPack)
endif()

set (CMAKE_INCLUDE_DIRECTORIES_PROJECT_BEFORE ON)


# developer's option to cache PKG_CONFIG_PATH and
# LD_LIBRARY_PATH for local installs
if(PKG_CONFIG_PATH)
set (ENV{PKG_CONFIG_PATH} ${PKG_CONFIG_PATH}:$ENV{PKG_CONFIG_PATH})
endif()
if(LD_LIBRARY_PATH)
set (ENV{LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}:$ENV{LD_LIBRARY_PATH})
endif()

set (INCLUDE_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/gams-${GAMS_VERSION}/gams")
set (LIB_INSTALL_DIR ${CMAKE_INSTALL_LIBDIR})
set (BIN_INSTALL_DIR ${CMAKE_INSTALL_BINDIR})


# specify the C++ standard
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED True)

# disable certain warnings that will occur in VS
if(MSVC)

set(GAMS_INC_INSTALL_DIR "include/gams")
set(GAMS_RUNTIME_INSTALL_DIR "bin")
set(GAMS_LIBRARY_INSTALL_DIR "bin")
set(GAMS_ARCHIVE_INSTALL_DIR "lib")
set(GAMS_FRAMEWORK_INSTALL_DIR "bin")

set(GAMS_CMAKE_CONFIG_INSTALL_DIR "share/gams/cmake")
set(GAMS_ADDITIONAL_FILES_INSTALL_DIR "share/gams")

add_compile_options(/wd4005)
add_compile_options(/wd4251)
add_compile_options(/wd4275)
add_compile_options(/wd4244)
add_compile_options(/wd4297)
add_compile_options(/wd4996)
add_compile_options(/MP)

# make linux/mac compilation stricter
elseif(UNIX)
include(GNUInstallDirs)

set(GAMS_INC_INSTALL_DIR "${CMAKE_INSTALL_INCLUDEDIR}/madara")
set(GAMS_RUNTIME_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}")
set(GAMS_LIBRARY_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(GAMS_ARCHIVE_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")
set(GAMS_FRAMEWORK_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}")

set(GAMS_CMAKE_CONFIG_INSTALL_DIR "${CMAKE_INSTALL_LIBDIR}/gams/cmake")
set(GAMS_ADDITIONAL_FILES_INSTALL_DIR "${CMAKE_INSTALL_DATADIR}/gams")

set(GAMS_RUNTIME_INSTALL_DIR "bin")
set(GAMS_INC_INSTALL_DIR "include/gams") # header filestree

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -pedantic")
endif()

include(cmake/configuration.cmake)

# Build the main library
add_subdirectory(src)
add_subdirectory(src/gams/programs)

# Build tests
if(gams_TESTS)
add_subdirectory(tests)
endif()

if(gams_DOCS)
add_subdirectory(docs)
endif()


set(PKG_NAME ${PROJECT_NAME_UPPER})
set(PKG_LIBRARIES gams)
set(PKG_DEPENDS madara Boost::boost)

# install readme and license
install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.txt" "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" "${CMAKE_CURRENT_SOURCE_DIR}/README.md" DESTINATION ${GAMS_ADDITIONAL_FILES_INSTALL_DIR})

install(EXPORT gamsTargets NAMESPACE gams::
DESTINATION ${GAMS_CMAKE_CONFIG_INSTALL_DIR}
FILE gams-config.cmake)

2 changes: 1 addition & 1 deletion VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.2.3
1.3.0
52 changes: 52 additions & 0 deletions bin/generate_version_include.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
eval '(exit $?0)' && eval 'exec perl -w -S $0 ${1+"$@"}'
& eval 'exec perl -w -S $0 $argv:q'
if 0;

###################################################
# @author James Edmondson <jedmondson@gmail.com>
#
# This perl script is useful for generating a dynamic
# version number for inclusion with C++.
###################################################

my $txt_fname = $ENV{'GAMS_ROOT'} . "/VERSION.txt";
my $h_fname = $ENV{'GAMS_ROOT'} . "/src/gams/utility/Version.h";
my $txt_mdate = (stat $txt_fname)[9];
my $h_mdate = (stat $h_fname)[9];

if ($txt_mdate < $h_mdate) {
exit 0;
}

print "Generating: reading from $txt_fname\n";

open VERSION_FILE, "<", $txt_fname or
die "Unable to open ../VERSION.txt for reading.";
$version = <VERSION_FILE>;
close VERSION_FILE;

chomp ($version);

$git_sha = `git rev-parse HEAD`;
chomp ($git_sha);

print "Generating: generating $h_fname\n";

open OUTPUT_FILE, ">", $h_fname or
die "Unable to open Version.h for writing.";
print OUTPUT_FILE "#pragma once\n\n";
print OUTPUT_FILE "/**\n";
print OUTPUT_FILE " * This file is generated by bin/generate_version_include.pl\n";
print OUTPUT_FILE " **/\n\n";
print OUTPUT_FILE "#include<string>\n\n";
print OUTPUT_FILE "namespace gams\n{\n";
print OUTPUT_FILE " namespace utility\n {\n";
print OUTPUT_FILE " std::string get_version(void)\n";
print OUTPUT_FILE " {\n";
print OUTPUT_FILE " return std::string(\"" . $version . " (" . $git_sha . ")\")\n";
print OUTPUT_FILE " + std::string(\" compiled on \") + __DATE__ + \" at \" + __TIME__;\n";
print OUTPUT_FILE " }\n";
print OUTPUT_FILE " } // end namespace utility\n";
print OUTPUT_FILE "} // end namespace gams\n";
close OUTPUT_FILE;

16 changes: 16 additions & 0 deletions capnp_files.mpb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
feature(capnp) {
Define_Custom (CAPNP) {
command = capnp
commandflags = compile -I $(CAPNP_ROOT)/c++/src -oc++
inputext = .capnp
source_outputext = .capnp.cpp
header_outputext = .capnp.h
generic_outputext = .capnp.bin

postcommand = <%mv%> <%input%>.c++ <%input%>.cpp <%cmdsep%> \
capnp compile -I $(CAPNP_ROOT)/c++/src -o/bin/cat <%input%> <%gt%> <%input%>.bin

keyword capnp_flags = commandflags
}
}

6 changes: 6 additions & 0 deletions capnp_types.mpb
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
feature(capnp,types) : capnp_files {
CAPNP_Files {
src/gams/types
}
}

12 changes: 12 additions & 0 deletions cmake/configuration.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

# Build options for feature-enabled compilation and installation
option(gams_ANDROID "Build with Android support" OFF)
option(gams_DOCS "Run doxygen or javadocs on code" OFF)
option(gams_KARL "Build with KaRL scripting language support (eval/wait)" ON)
option(gams_OSC "Build with OSC support" OFF)
option(gams_PYTHON "Build with python support (via Boost.Python)" OFF)
option(gams_ROS "Build with ROS support" OFF)
option(gams_SIMTIME "Build with support for simulation/virtual time" ON)
option(gams_TESTS "Build tests" OFF)
option(gams_THREADLOCAL "Build with support for threadlocal variables" OFF)
option(gams_XML "Build with XML library support" OFF)
Loading

0 comments on commit e09033e

Please # to comment.