forked from RobotLocomotion/drake
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
drake viewer builds with cmake (on mac, requires export CXX=/usr/bin/…
…g++ instead of clang++ due to what appears to be an eigen-related issue) git-svn-id: https://svn.csail.mit.edu/locomotion/robotlib/trunk@6545 c9849af7-e679-4ec6-a44e-fc146a885bd3
- Loading branch information
russt
committed
Jul 11, 2013
1 parent
ee9b831
commit 612a4bc
Showing
30 changed files
with
1,138 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,3 +82,8 @@ bin | |
drake.jar | ||
*.out | ||
urdf_kin_test | ||
pod-build | ||
lcmtypes/c | ||
lcmtypes/cpp | ||
lcmtypes/java | ||
lcmtypes/python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
cmake_minimum_required(VERSION 2.6.0) | ||
|
||
set(POD_NAME drake) | ||
include(cmake/pods.cmake) | ||
include(cmake/lcmtypes.cmake) | ||
|
||
lcmtypes_build() | ||
|
||
|
||
#add_subdirectory(util) | ||
#add_subdirectory(algorithms) | ||
add_subdirectory(systems) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,93 +1,49 @@ | ||
|
||
# Note: make will automatically delete intermediate files (google "make chains of implicit rules") | ||
|
||
CC = gcc | ||
CXX = g++ | ||
PKG_CONFIG_PATH := ${PKG_CONFIG_PATH}:$(shell pwd)/thirdParty | ||
|
||
LCMFILES = $(shell find . -iname "*.lcm" | tr "\n" " " | sed "s|\./||g") | ||
SUBDIRS:=$(shell grep -v "^\#" tobuild.txt) | ||
|
||
LCM_CFILES = $(LCMFILES:%.lcm=%.c) | ||
LCM_CFLAGS = $(shell pkg-config --cflags lcm) | ||
LCM_LDFLAGS = $(shell pkg-config --libs lcm) | ||
EIGEN_CFLAGS = $(shell pkg-config --cflags eigen3) | ||
|
||
#CFILES = $(LCM_CFILES) | ||
LCM_JAVAFILES = $(LCMFILES:%.lcm=%.java) | ||
OTHER_JAVAFILES = util/MyLCMTypeDatabase.java util/MessageMonitor.java util/CoordinateFrameData.java util/LCMCoder.java util/Transform.java | ||
JAVAFILES = $(LCM_JAVAFILES) $(OTHER_JAVAFILES) | ||
|
||
OBJFILES = $(LCM_CFILES:%.c=%.o) | ||
CLASSFILES = $(JAVAFILES:%.java=%.class) | ||
EXTRACLASSFILES = util/MyLCMTypeDatabase*MyClassVisitor.class | ||
|
||
MATLAB = $(shell which matlab) | ||
|
||
all: matlab_config java c | ||
@for subdir in $(SUBDIRS); do \ | ||
echo "\n-------------------------------------------"; \ | ||
echo "-- $$subdir"; \ | ||
echo "-------------------------------------------"; \ | ||
$(MAKE) -C $$subdir all || exit 2; \ | ||
done | ||
|
||
debug: CXX += -g | ||
debug: CC += -g | ||
debug: matlab_config java c | ||
@for subdir in $(SUBDIRS); do \ | ||
echo "\n-------------------------------------------"; \ | ||
echo "-- $$subdir"; \ | ||
echo "-------------------------------------------"; \ | ||
$(MAKE) -C $$subdir debug || exit 2; \ | ||
done | ||
|
||
doxygen : | ||
doxygen doc/Doxyfile | ||
|
||
java : drake.jar | ||
|
||
c : drake.a | ||
|
||
matlab_config : util/drake_config.mat .matlabroot | ||
|
||
util/drake_config.mat .matlabroot : configure.m | ||
matlab -nosplash -nodesktop -r "configure;exit"; | ||
# todo: consider using configure(struct('autoconfig',true)) | ||
|
||
drake.jar : $(CLASSFILES) | ||
cd ..; jar -cf drake/drake.jar $(CLASSFILES:%=drake/%) $(EXTRACLASSFILES:%=drake/%) | ||
|
||
drake.a : $(OBJFILES) | ||
ar rc $@ $^ | ||
|
||
.INTERMEDIATE : $(OBJFILES) $(CLASSFILES) | ||
.PRECIOUS : $(LCMFILES) $(OTHER_JAVAFILES) | ||
|
||
util/LCMCoder.class : util/LCMCoder.java util/CoordinateFrameData.class | ||
javac $< -cp $(CLASSPATH):$(shell pwd)/../ | ||
|
||
%.class : %.java | ||
javac $< | ||
|
||
%.o : %.c | ||
$(CC) -c -I include/ $< -o $@ $(LCM_CFLAGS) $(EIGEN_CFLAGS) | ||
|
||
%.c : %.lcm | ||
@if grep -i package $< ; then echo "\n *** ERROR: $< has a package specified. Don't do that. *** \n"; exit 1; fi | ||
lcm-gen -c --c-cpath="$(shell echo $< | sed "s|/[A-Za-z0-9_]*\.lcm|/|")" --c-hpath="include/" $< | ||
|
||
%.java : %.lcm | ||
@if grep -i package $< ; then echo "\n *** ERROR: $< has a package specified. Don't do that. *** \n"; exit 1; fi | ||
lcm-gen -j --jdefaultpkg="drake.$(shell echo $< | sed "s|/[A-Za-z0-9._]*\.lcm||g" | tr "/" ".")" --jpath=".." $< | ||
|
||
clean : | ||
-rm -f drake.jar drake.a $(LIBS) $(LCM_HFILES) $(LCM_CFILES) $(OBJFILES) $(LCM_JAVAFILES) $(CLASSFILES) $(EXTRACLASSFILES) | ||
-rm -rf doc/DoxygenMatlab/html | ||
@for subdir in $(SUBDIRS); do \ | ||
echo "\n-------------------------------------------"; \ | ||
echo "-- $$subdir"; \ | ||
echo "-------------------------------------------"; \ | ||
$(MAKE) -C $$subdir clean; \ | ||
done | ||
|
||
# Default pod makefile distributed with pods version: 12.11.14 | ||
|
||
default_target: all | ||
|
||
# Default to a less-verbose build. If you want all the gory compiler output, | ||
# run "make VERBOSE=1" | ||
$(VERBOSE).SILENT: | ||
|
||
# Figure out where to build the software. | ||
# Use BUILD_PREFIX if it was passed in. | ||
# If not, search up to four parent directories for a 'build' directory. | ||
# Otherwise, use ./build. | ||
ifeq "$(BUILD_PREFIX)" "" | ||
BUILD_PREFIX:=$(shell for pfx in ./ .. ../.. ../../.. ../../../..; do d=`pwd`/$$pfx/build;\ | ||
if [ -d $$d ]; then echo $$d; exit 0; fi; done; echo `pwd`/build) | ||
endif | ||
# create the build directory if needed, and normalize its path name | ||
BUILD_PREFIX:=$(shell mkdir -p $(BUILD_PREFIX) && cd $(BUILD_PREFIX) && echo `pwd`) | ||
|
||
# Default to a release build. If you want to enable debugging flags, run | ||
# "make BUILD_TYPE=Debug" | ||
ifeq "$(BUILD_TYPE)" "" | ||
BUILD_TYPE="Release" | ||
endif | ||
|
||
all: pod-build/Makefile | ||
$(MAKE) -C pod-build all install | ||
|
||
pod-build/Makefile: | ||
$(MAKE) configure | ||
|
||
.PHONY: configure | ||
configure: | ||
@echo "\nBUILD_PREFIX: $(BUILD_PREFIX)\n\n" | ||
|
||
# create the temporary build directory if needed | ||
@mkdir -p pod-build | ||
|
||
# run CMake to generate and configure the build scripts | ||
@cd pod-build && cmake -DCMAKE_INSTALL_PREFIX=$(BUILD_PREFIX) \ | ||
-DCMAKE_BUILD_TYPE=$(BUILD_TYPE) .. | ||
|
||
clean: | ||
-if [ -e pod-build/install_manifest.txt ]; then rm -f `cat pod-build/install_manifest.txt`; fi | ||
-if [ -d pod-build ]; then $(MAKE) -C pod-build clean; rm -rf pod-build; fi | ||
|
||
# other (custom) targets are passed through to the cmake-generated Makefile | ||
%:: | ||
$(MAKE) -C pod-build $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
|
||
# Note: make will automatically delete intermediate files (google "make chains of implicit rules") | ||
|
||
CC = gcc | ||
CXX = g++ | ||
PKG_CONFIG_PATH := ${PKG_CONFIG_PATH}:$(shell pwd)/thirdParty | ||
|
||
LCMFILES = $(shell find . -iname "*.lcm" | tr "\n" " " | sed "s|\./||g") | ||
SUBDIRS:=$(shell grep -v "^\#" tobuild.txt) | ||
|
||
LCM_CFILES = $(LCMFILES:%.lcm=%.c) | ||
LCM_CFLAGS = $(shell pkg-config --cflags lcm) | ||
LCM_LDFLAGS = $(shell pkg-config --libs lcm) | ||
EIGEN_CFLAGS = $(shell pkg-config --cflags eigen3) | ||
|
||
#CFILES = $(LCM_CFILES) | ||
LCM_JAVAFILES = $(LCMFILES:%.lcm=%.java) | ||
OTHER_JAVAFILES = util/MyLCMTypeDatabase.java util/MessageMonitor.java util/CoordinateFrameData.java util/LCMCoder.java util/Transform.java | ||
JAVAFILES = $(LCM_JAVAFILES) $(OTHER_JAVAFILES) | ||
|
||
OBJFILES = $(LCM_CFILES:%.c=%.o) | ||
CLASSFILES = $(JAVAFILES:%.java=%.class) | ||
EXTRACLASSFILES = util/MyLCMTypeDatabase*MyClassVisitor.class | ||
|
||
MATLAB = $(shell which matlab) | ||
|
||
all: matlab_config java c | ||
@for subdir in $(SUBDIRS); do \ | ||
echo "\n-------------------------------------------"; \ | ||
echo "-- $$subdir"; \ | ||
echo "-------------------------------------------"; \ | ||
$(MAKE) -C $$subdir all || exit 2; \ | ||
done | ||
|
||
debug: CXX += -g | ||
debug: CC += -g | ||
debug: matlab_config java c | ||
@for subdir in $(SUBDIRS); do \ | ||
echo "\n-------------------------------------------"; \ | ||
echo "-- $$subdir"; \ | ||
echo "-------------------------------------------"; \ | ||
$(MAKE) -C $$subdir debug || exit 2; \ | ||
done | ||
|
||
doxygen : | ||
doxygen doc/Doxyfile | ||
|
||
java : drake.jar | ||
|
||
c : drake.a | ||
|
||
matlab_config : util/drake_config.mat .matlabroot | ||
|
||
util/drake_config.mat .matlabroot : configure.m | ||
matlab -nosplash -nodesktop -r "configure;exit"; | ||
# todo: consider using configure(struct('autoconfig',true)) | ||
|
||
drake.jar : $(CLASSFILES) | ||
cd ..; jar -cf drake/drake.jar $(CLASSFILES:%=drake/%) $(EXTRACLASSFILES:%=drake/%) | ||
|
||
drake.a : $(OBJFILES) | ||
ar rc $@ $^ | ||
|
||
.INTERMEDIATE : $(OBJFILES) $(CLASSFILES) | ||
.PRECIOUS : $(LCMFILES) $(OTHER_JAVAFILES) | ||
|
||
util/LCMCoder.class : util/LCMCoder.java util/CoordinateFrameData.class | ||
javac $< -cp $(CLASSPATH):$(shell pwd)/../ | ||
|
||
%.class : %.java | ||
javac $< | ||
|
||
%.o : %.c | ||
$(CC) -c -I include/ $< -o $@ $(LCM_CFLAGS) $(EIGEN_CFLAGS) | ||
|
||
%.c : %.lcm | ||
@if grep -i package $< ; then echo "\n *** ERROR: $< has a package specified. Don't do that. *** \n"; exit 1; fi | ||
lcm-gen -c --c-cpath="$(shell echo $< | sed "s|/[A-Za-z0-9_]*\.lcm|/|")" --c-hpath="include/" $< | ||
|
||
%.java : %.lcm | ||
@if grep -i package $< ; then echo "\n *** ERROR: $< has a package specified. Don't do that. *** \n"; exit 1; fi | ||
lcm-gen -j --jdefaultpkg="drake.$(shell echo $< | sed "s|/[A-Za-z0-9._]*\.lcm||g" | tr "/" ".")" --jpath=".." $< | ||
|
||
clean : | ||
-rm -f drake.jar drake.a $(LIBS) $(LCM_HFILES) $(LCM_CFILES) $(OBJFILES) $(LCM_JAVAFILES) $(CLASSFILES) $(EXTRACLASSFILES) | ||
-rm -rf doc/DoxygenMatlab/html | ||
@for subdir in $(SUBDIRS); do \ | ||
echo "\n-------------------------------------------"; \ | ||
echo "-- $$subdir"; \ | ||
echo "-------------------------------------------"; \ | ||
$(MAKE) -C $$subdir clean; \ | ||
done | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
cmake_minimum_required(VERSION 2.6.0) | ||
|
||
|
File renamed without changes.
Oops, something went wrong.