Skip to content

Commit

Permalink
Merge branch 'packaging/osgdart' into packaging/components
Browse files Browse the repository at this point in the history
Conflicts:
	CMakeLists.txt
	appveyor.yml
	ci/script_linux.sh
	ci/script_osx.sh
	dart/gui/osg/examples/CMakeLists.txt
	tutorials/CMakeLists.txt
  • Loading branch information
jslee02 committed Mar 29, 2016
2 parents b259145 + f56dd2e commit 63a697c
Show file tree
Hide file tree
Showing 34 changed files with 151 additions and 130 deletions.
72 changes: 54 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ if(MSVC)
else()
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
endif()
option(DART_BUILD_EXAMPLES "Build examples" ON)
option(DART_BUILD_TUTORIALS "Build tutorials" ON)
option(DART_BUILD_UNITTESTS "Build unit tests" ON)
option(DART_COVERALLS "Turn on coveralls support" OFF)
option(DART_COVERALLS_UPLOAD "Upload the generated coveralls json" ON)

Expand Down Expand Up @@ -223,9 +220,6 @@ message(STATUS "Build type : ${CMAKE_BUILD_TYPE}")
message(STATUS "BUILD_SHARED_LIBS: ${BUILD_SHARED_LIBS}")
message(STATUS "ENABLE_OPENMP : ${ENABLE_OPENMP}")
message(STATUS "Build osgDart : ${DART_BUILD_OSGDART}")
message(STATUS "Build examples : ${DART_BUILD_EXAMPLES}")
message(STATUS "Build tutorials : ${DART_BUILD_TUTORIALS}")
message(STATUS "Build unit tests : ${DART_BUILD_UNITTESTS}")
message(STATUS "Install path : ${CMAKE_INSTALL_PREFIX}")
message(STATUS "CXX_FLAGS : ${CMAKE_CXX_FLAGS}")
if(${CMAKE_BUILD_TYPE_UPPERCASE} STREQUAL "RELEASE")
Expand Down Expand Up @@ -274,25 +268,67 @@ install(FILES ${PC_CONFIG_OUT} DESTINATION lib/pkgconfig)
# Install a Catkin 'package.xml' file. This is required by REP-136.
install(FILES package.xml DESTINATION share/${PROJECT_NAME})

#===============================================================================
# Helper Functions
#===============================================================================

set_property(GLOBAL PROPERTY DART_EXAMPLES)
set_property(GLOBAL PROPERTY DART_TUTORIALS)
set_property(GLOBAL PROPERTY DART_UNITTESTS)

function(dart_add_example target_name)
set_property(GLOBAL APPEND PROPERTY DART_EXAMPLES "${target_name}")
endfunction(dart_add_example)

function(dart_add_tutorial target_name)
set_property(GLOBAL APPEND PROPERTY DART_TUTORIALS "${target_name}")
endfunction(dart_add_tutorial)

function(dart_add_unittest target_name)
set_property(GLOBAL APPEND PROPERTY DART_UNITTESTS "${target_name}")
endfunction(dart_add_unittest)

#===============================================================================
# Add sub-directories
#===============================================================================

add_subdirectory(dart)
add_subdirectory(apps EXCLUDE_FROM_ALL)
add_subdirectory(tutorials EXCLUDE_FROM_ALL)

# Unit tests
if(DART_BUILD_UNITTESTS)
enable_testing()
add_subdirectory(unittests)
endif(DART_BUILD_UNITTESTS)
# Add a "tutorials" target to build tutorials.
get_property(tutorials GLOBAL PROPERTY DART_TUTORIALS)
add_custom_target(tutorials DEPENDS ${tutorials})

# Examples
if(DART_BUILD_EXAMPLES)
add_subdirectory(apps)
endif(DART_BUILD_EXAMPLES)
message(STATUS "")
message(STATUS "[ Tutorials ]")
foreach(tutorial ${tutorials})
message(STATUS "Adding tutorial: ${tutorial}")
endforeach(tutorial ${tutorials})

if(DART_BUILD_TUTORIALS)
add_subdirectory(tutorials)
endif()
# Add an "examples" target to build examples.
get_property(examples GLOBAL PROPERTY DART_EXAMPLES)
add_custom_target(examples DEPENDS ${examples})

message(STATUS "")
message(STATUS "[ Examples ]")

foreach(example ${examples})
message(STATUS "Adding example: ${example}")
endforeach(example ${examples})

# Add a "tests" target to build unit tests.
enable_testing()
add_subdirectory(unittests EXCLUDE_FROM_ALL)

get_property(unittests GLOBAL PROPERTY DART_UNITTESTS)
add_custom_target(tests DEPENDS ${unittests})

message(STATUS "")
message(STATUS "[ Unit Tests ]")
foreach(unittest ${unittests})
message(STATUS "Adding test: ${unittest}")
endforeach(unittest ${unittests})

#===============================================================================
# Export targets
Expand Down
13 changes: 1 addition & 12 deletions apps/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
# A list of applications
set_property(DIRECTORY PROPERTY FOLDER Apps)

message(STATUS "")
message(STATUS "[ Applications ]")

# Automatically identify all directories in the apps folder
file(GLOB children RELATIVE ${CMAKE_CURRENT_LIST_DIR} "*")
set(directories "")
foreach(child ${children})
if(IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${child}")
if(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${child}/CMakeLists.txt")
message(STATUS "Adding application: " ${child})
list(APPEND directories ${child})
endif(EXISTS "${CMAKE_CURRENT_LIST_DIR}/${child}/CMakeLists.txt")
endif(IS_DIRECTORY "${CMAKE_CURRENT_LIST_DIR}/${child}")
Expand All @@ -19,12 +15,5 @@ endforeach(child)
# List of all the subdirectories to include
foreach(APPDIR ${directories})
add_subdirectory(${APPDIR})
if(WIN32)
if(TARGET ${APPTARGET})
set_target_properties(${APPTARGET} PROPERTIES FOLDER Apps
#EXCLUDE_FROM_DEFAULT_BUILD ON
)
set_target_properties(${APPTARGET} PROPERTIES STATIC_LIBRARY_FLAGS_RELEASE "/LTCG")
endif(TARGET ${APPTARGET})
endif(WIN32)
dart_add_example(${APPDIR})
endforeach(APPDIR)
4 changes: 1 addition & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ environment:
MSVC_DEFAULT_OPTIONS: ON
BOOST_ROOT: C:\Libraries\boost_1_59_0
BOOST_LIBRARYDIR: C:\Libraries\boost_1_59_0\lib32-msvc-14.0
BUILD_EXAMPLES: OFF # don't build examples to not exceed allowed build time (40 min)
BUILD_TUTORIALS: OFF # don't build tutorials to not exceed allowed build time (40 min)

# build configuration, i.e. Debug, Release, etc.
configuration:
Expand Down Expand Up @@ -52,7 +50,7 @@ before_build:
# We generate project files for Visual Studio 12 because the boost binaries installed on the test server are for Visual Studio 12.
- cmd: if "%platform%"=="Win32" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015
- cmd: if "%platform%"=="x64" set CMAKE_GENERATOR_NAME=Visual Studio 14 2015 Win64
- cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DDART_BUILD_EXAMPLES="%BUILD_EXAMPLES%" -DDART_BUILD_TUTORIALS="%BUILD_TUTORIALS%" -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" ..
- cmd: cmake -G "%CMAKE_GENERATOR_NAME%" -DCMAKE_BUILD_TYPE=%configuration% -DBOOST_ROOT="%BOOST_ROOT%" -DBOOST_LIBRARYDIR="%BOOST_LIBRARYDIR%" -DBoost_USE_STATIC_LIBS="ON" -Durdfdom_DIR="%urdfdom_DIR%" -Durdfdom_headers_DIR="%urdfdom_headers_DIR%" -DDART_MSVC_DEFAULT_OPTIONS="%MSVC_DEFAULT_OPTIONS%" ..

build: off
#build:
Expand Down
1 change: 1 addition & 0 deletions ci/before_install_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ libfcl-dev
freeglut3-dev
libxi-dev
libxmu-dev
libbullet-dev
libflann-dev
libnlopt-dev
coinor-libipopt-dev
Expand Down
3 changes: 1 addition & 2 deletions ci/script_linux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
make
if [ $COVERALLS = ON ]; then make coveralls; fi
sudo ldconfig --verbose # So the test executeables can detect libtinyxml2
make test

make all tutorials examples tests test
2 changes: 1 addition & 1 deletion ci/script_osx.sh
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
make
make test
make all tutorials examples tests test
3 changes: 2 additions & 1 deletion dart/dynamics/detail/MultiDofJointProperties.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ class MultiDofJointAddon final :
MultiDofJointAddon(const MultiDofJointAddon&) = delete;

MultiDofJointAddon(common::AddonManager* mgr,
const typename MultiDofJointAddon::PropertiesData& properties);
const typename MultiDofJointAddon::PropertiesData& properties =
typename MultiDofJointAddon::PropertiesData());

constexpr static size_t NumDofs = DOF;
using Vector = Eigen::Matrix<double, DOF, 1>;
Expand Down
4 changes: 1 addition & 3 deletions dart/gui/osg/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/osg.h
)

if(${DART_BUILD_EXAMPLES})
add_subdirectory(examples)
endif(${DART_BUILD_EXAMPLES})
add_subdirectory(examples EXCLUDE_FROM_ALL)

install(
FILES ${hdrs} ${CMAKE_CURRENT_BINARY_DIR}/osg.h
Expand Down
8 changes: 4 additions & 4 deletions dart/gui/osg/DefaultEventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_DEFAULTEVENTHANDLER_H
#define OSGDART_DEFAULTEVENTHANDLER_H
#ifndef DART_GUI_OSG_DEFAULTEVENTHANDLER_H
#define DART_GUI_OSG_DEFAULTEVENTHANDLER_H

#include <vector>
#include <array>
Expand Down Expand Up @@ -199,7 +199,7 @@ class DefaultEventHandler : public ::osgGA::GUIEventHandler,
virtual void handleDestructionNotification(
const dart::common::Subject* _subject) override;

/// osgDart::Viewer that this event handler is tied to
/// dart::gui::osg::Viewer that this event handler is tied to
Viewer* mViewer;

/// Set of MouseEventHandlers that are tied to this DefaultEventHandler
Expand Down Expand Up @@ -236,4 +236,4 @@ class DefaultEventHandler : public ::osgGA::GUIEventHandler,
} // namespace gui
} // namespace dart

#endif // OSGDART_DEFAULTEVENTHANDLER_H
#endif // DART_GUI_OSG_DEFAULTEVENTHANDLER_H
8 changes: 4 additions & 4 deletions dart/gui/osg/DragAndDrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_DRAGANDDROP_H
#define OSGDART_DRAGANDDROP_H
#ifndef DART_GUI_OSG_DRAGANDDROP_H
#define DART_GUI_OSG_DRAGANDDROP_H

#include <functional>

Expand All @@ -59,7 +59,7 @@ class Viewer;
class InteractiveFrame;

/// DragAndDrop is a class that facilitates enabling various kinds of dart
/// Entities to be dragged and dropped in an osgDart environment
/// Entities to be dragged and dropped in an dart::gui::osg environment
class DragAndDrop : public dart::common::Subject,
public dart::common::Observer
{
Expand Down Expand Up @@ -364,4 +364,4 @@ class BodyNodeDnD : public DragAndDrop
} // namespace gui
} // namespace dart

#endif // OSGDART_DRAGANDDROP_H
#endif // DART_GUI_OSG_DRAGANDDROP_H
6 changes: 3 additions & 3 deletions dart/gui/osg/InteractiveFrame.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_INTERACTIVEFRAME_H
#define OSGDART_INTERACTIVEFRAME_H
#ifndef DART_GUI_OSG_INTERACTIVEFRAME_H
#define DART_GUI_OSG_INTERACTIVEFRAME_H

#include "dart/dynamics/SimpleFrame.h"

Expand Down Expand Up @@ -171,4 +171,4 @@ typedef std::shared_ptr<InteractiveFrame> InteractiveFramePtr;
} // namespace gui
} // namespace dart

#endif // OSGDART_INTERACTIVEFRAME_H
#endif // DART_GUI_OSG_INTERACTIVEFRAME_H
6 changes: 3 additions & 3 deletions dart/gui/osg/MouseEventHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_MOUSEEVENTHANDLER_H
#define OSGDART_MOUSEEVENTHANDLER_H
#ifndef DART_GUI_OSG_MOUSEEVENTHANDLER_H
#define DART_GUI_OSG_MOUSEEVENTHANDLER_H

#include "dart/common/Subject.h"
#include "dart/common/Observer.h"
Expand Down Expand Up @@ -77,4 +77,4 @@ class MouseEventHandler : public virtual dart::common::Subject,
} // namespace gui
} // namespace dart

#endif // OSGDART_MOUSEEVENTHANDLER_H
#endif // DART_GUI_OSG_MOUSEEVENTHANDLER_H
6 changes: 3 additions & 3 deletions dart/gui/osg/ShapeFrameNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ void ShapeFrameNode::refreshShapeNode(
static void warnAboutUnsuccessfulCast(const std::string& shapeType,
const std::string& entityName)
{
dtwarn << "[osgDart::EntityNode::createShapeNode] A Shape in '" << entityName
<< "' claimed to be a '" << shapeType << "' but it failed to be "
<< "dynamically cast to that type. "
dtwarn << "[dart::gui::osg::EntityNode::createShapeNode] A Shape in '"
<< entityName << "' claimed to be a '" << shapeType
<< "' but it failed to be dynamically cast to that type. "
<< "It will not be added to the OSG tree, "
<< "and therefore will not be rendered\n";
}
Expand Down
6 changes: 3 additions & 3 deletions dart/gui/osg/ShapeFrameNode.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_SHAPEFRAMENODE_H
#define OSGDART_SHAPEFRAMENODE_H
#ifndef DART_GUI_OSG_SHAPEFRAMENODE_H
#define DART_GUI_OSG_SHAPEFRAMENODE_H

#include <map>
#include <memory>
Expand Down Expand Up @@ -117,4 +117,4 @@ class ShapeFrameNode : public ::osg::MatrixTransform
} // namespace gui
} // namespace dart

#endif // OSGDART_SHAPEFRAMENODE_H
#endif // DART_GUI_OSG_SHAPEFRAMENODE_H
6 changes: 3 additions & 3 deletions dart/gui/osg/SupportPolygonVisual.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_SUPPORTPOLYGONVISUAL_H
#define OSGDART_SUPPORTPOLYGONVISUAL_H
#ifndef DART_GUI_OSG_SUPPORTPOLYGONVISUAL_H
#define DART_GUI_OSG_SUPPORTPOLYGONVISUAL_H

#include <osg/Geode>

Expand Down Expand Up @@ -202,4 +202,4 @@ class SupportPolygonVisual : public ViewerAttachment
} // namespace gui
} // namespace dart

#endif // OSGDART_SUPPORTPOLYGONVISUAL_H
#endif // DART_GUI_OSG_SUPPORTPOLYGONVISUAL_H
8 changes: 4 additions & 4 deletions dart/gui/osg/TrackballManipulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_TRACKBALLMANIPULATOR_H
#define OSGDART_TRACKBALLMANIPULATOR_H
#ifndef DART_GUI_OSG_TRACKBALLMANIPULATOR_H
#define DART_GUI_OSG_TRACKBALLMANIPULATOR_H

#include <osgGA/OrbitManipulator>

Expand Down Expand Up @@ -77,11 +77,11 @@ class OSGGA_EXPORT TrackballManipulator : public ::osgGA::OrbitManipulator
const double dy) override;

DART_META_Object( dart-gui-osg, TrackballManipulator )
// TODO(MXG): Consider applying the META macros to every osgDart Node
// TODO(MXG): Consider applying the META macros to every dart::gui::osg Node
};

} // namespace osg
} // namespace gui
} // namespace dart

#endif // OSGDART_TRACKBALLMANIPULATOR_H
#endif // DART_GUI_OSG_TRACKBALLMANIPULATOR_H
6 changes: 3 additions & 3 deletions dart/gui/osg/Utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

#ifndef OSGDART_UTILS_H
#define OSGDART_UTILS_H
#ifndef DART_GUI_OSG_UTILS_H
#define DART_GUI_OSG_UTILS_H

#include <Eigen/Geometry>

Expand Down Expand Up @@ -90,4 +90,4 @@ inline Eigen::Vector4d osgToEigVec4(const ::osg::Vec4d& vec)
return Eigen::Vector4d(vec[0], vec[1], vec[2], vec[3]);
}

#endif // OSGDART_UTILS_H
#endif // DART_GUI_OSG_UTILS_H
Loading

0 comments on commit 63a697c

Please sign in to comment.