Commit 4557d55b authored by Thomas Moulard's avatar Thomas Moulard
Browse files

Switch from Autotools to CMake.

Remove build-aux submodule and replace it by cmake submodule.
Add basic CMakeLists.txt root file and empty CMakeLists.txt
files in subdirectories.
parent a77c4ca2
INSTALL
Makefile.in
_build*
aclocal.m4
autom4te.cache/
config.h.in
config.h.in~
configure
doc/Makefile.in
src/Makefile.in
tests/Makefile.in
tests/testsuite
tests/corba-tests/testsuite
+committed/
,*
testsuite.log
*.pyc
.version
.tarball-version
[submodule "build-aux"]
path = build-aux
url = roboptim:build-aux
[submodule "cmake"]
path = cmake
url = git://github.com/thomas-moulard/cmake.git
# Copyright (C) 2010 Florent Lamiraux, Thomas Moulard, JRL, CNRS/AIST.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Requires at least CMake 2.6 to configure the package.
CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
INCLUDE(cmake/base.cmake)
SET(PROJECT_NAME hpp-util)
SET(PROJECT_VERSION 0.2)
SETUP_PROJECT()
ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(doc)
ADD_SUBDIRECTORY(tests)
SETUP_PROJECT_FINALIZE()
include $(top_srcdir)/build-aux/init.mk
# Search for autoconf macros in build-aux.
ACLOCAL_AMFLAGS = -I build-aux
SUBDIRS = \
include \
src \
tests \
doc
# Provide bootstrap with the generated package.
EXTRA_DIST += bootstrap \
build-aux/bootstrap
# Nothing to do in this directory.
all:
# Include various rules...
include $(top_srcdir)/build-aux/doc-recursive.mk
include $(top_srcdir)/build-aux/libtool.mk
include $(top_srcdir)/build-aux/pkg-config.mk
include $(top_srcdir)/build-aux/git-version-gen.mk
#! /bin/sh
# Copyright (C) 2010 Thomas Moulard, JRL, CNRS/AIST.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
# Make sure all errors are fatal.
set -e
# Print an error message and exit.
die ()
{
echo >&2 "fatal: $1"
exit 2
}
# Properly explain how to set up a RobOptim working directory and exit.
die_noroboptimalias ()
{
echo >&2 "To properly finish setting up your working directory,"
echo >&2 "you need to define how RobOptim should connect to SourceForge."
echo >&2 ""
echo >&2 "If you only need read-access (which is usually what one wants):"
echo >&2 "echo '[url \"git://roboptim.git.sourceforge.net/gitroot/roboptim/\"]"
echo >&2 " insteadOf = roboptim:' >> ~/.gitconfig"
echo >&2 ""
die "no \`\`roboptim:'' alias in your git configuration."
}
# Check that git version is newer enough.
check_git_version ()
{
version=`git --version | sed 's/^git version \([0-9]\.[0-9]\.[0-9]\).*$/\1/'`
if test x"$version" = x; then
die "failed to parse git version"
fi
for i in 1 2 3; do
wantedversion=`echo "$1" | cut -d'.' -f$i`
gitversion=`echo "$version" | cut -d'.' -f$i`
if test $gitversion -lt $wantedversion; then
die "git version is too old (version $1 at least is required)"
fi
if test $gitversion -gt $wantedversion; then
return
fi
done
}
# Override the locale.
LC_ALL='C'
export LC_ALL
# Make sure that the submodule are retrieved.
if test -d ".git"; then
# Url rewriting has been introduced in git 1.5.5.
check_git_version "1.5.5"
: ${GIT=git}
if test x`git config -l | grep 'url\..*\.insteadof=roboptim:'` = x; then
die_noroboptimalias
fi
# For dev's:
test "x$1" = x--debug && shift && set -x
git submodule init
git submodule update
# Make sure that the sub-module is retrieved.
if `test -d ".git" || $GIT rev-parse --git-dir 2> /dev/null > /dev/null`; then
$GIT submodule init
$GIT submodule update
fi
exec build-aux/bootstrap
# Additional actions can be done in the submodule,
exec cmake/bootstrap
build-aux @ 8fbf59bc
Subproject commit 8fbf59bc07c614cb0637b2d418ac5cfb5515fe6f
Subproject commit 0644da328a48454b04d24292debeac53c390aed1
# Don't expend macros beginning by JRL_.
m4_pattern_forbid([^JRL_])
AC_PREREQ([2.63])
## --------------------- ##
## Package configuration ##
## --------------------- ##
AC_INIT([hpp-util],
[m4_esyscmd(build-aux/git-version-gen .tarball-version)],
[hpp@laas.fr],
[hpp-util])
# Auxiliary files.
AC_CONFIG_AUX_DIR([build-aux])
# Automake.
AM_INIT_AUTOMAKE([1.9.6 dist-bzip2 -Wall nostdinc])
# Check configure is called properly.
AC_CONFIG_SRCDIR([src/debug.cc])
## ------------- ##
## C++ compiler ##
## ------------- ##
# Search for a C++ compiler.
AC_LANG([C++])
AC_PROG_CXX
# Speed-up compilation.
if test "$GXX" = yes; then
CXXFLAGS="$CXXFLAGS -pipe"
fi
# Customize warnings.
JRL_CXX_WARNINGS([[-Wall],
[-Wcast-align],
[-Wcast-qual],
[-Wformat],
[-Wmissing-prototypes],
[-Wstrict-prototypes],
[-Wwrite-strings],
[-Wbad-function-cast],
[-Wmissing-declarations],
[-Wnested-externs]])
# Macros are stored in build-aux.
AC_CONFIG_MACRO_DIR([build-aux])
## ------------------- ##
## Additionnal tools. ##
## ------------------- ##
# Search for misc. common tools.
AC_PROG_MKDIR_P
AC_PROG_SED
# Search for Doxygen.
JRL_PROG_DOXYGEN
# Search for Libtool.
LT_INIT([win32-dll])
# Search for Boost.
BOOST_REQUIRE([1.34])
BOOST_FILESYSTEM
BOOST_STRING
BOOST_SYSTEM #FIXME: required?
# Generate ``config.hh'' header file.
AC_SUBST([PACKAGE_CPPNAME],
[`echo "$PACKAGE_TARNAME" \
| tr '@<:@:lower:@:>@' '@<:@:upper:@:>@' | sed 's/-/_/g'`])
AC_CONFIG_FILES([include/hpp/util/config.hh])
AC_CONFIG_FILES([include/hpp/util/version.hh])
## ------------ ##
## Test-suite. ##
## ------------ ##
AC_CONFIG_TESTDIR([tests])
AM_MISSING_PROG([AUTOM4TE], [autom4te])
## ------------ ##
## Pkg-config. ##
## ------------ ##
AC_SUBST([PKGCONFIG_DESCRIPTION], ['HPP utilities'])
AC_SUBST([PKGCONFIG_URL], [])
AC_SUBST([PKGCONFIG_REQUIRES], [`echo "$PKGCONFIG_REQUIRES" | sed 's/, $//'`])
AC_SUBST([PKGCONFIG_CONFLICTS], [])
AC_SUBST([PKGCONFIG_LIBS], [-lhpp-util])
AC_SUBST([PKGCONFIG_CFLAGS], [])
## -------------- ##
## Write output. ##
## -------------- ##
# Create config.h
AC_CONFIG_HEADERS([config.h])
# Create Makefiles.
AC_CONFIG_FILES([
Makefile
include/Makefile
src/Makefile
doc/Makefile
tests/Makefile
tests/atlocal
tests/package.m4
])
# Write files.
AC_OUTPUT
include $(top_srcdir)/build-aux/init.mk
include $(top_srcdir)/build-aux/doxygen.mk
EXTRA_DIST += header.html footer.html \
pictures/footer.jpg
# DOXYGEN_EXTRA += $(srcdir)/pictures
include $(top_srcdir)/build-aux/init.mk
# -- Distribute and install headers
nobase_include_HEADERS = \
hpp/util/assertion.hh \
hpp/util/config.hh \
hpp/util/deprecated.hh \
hpp/util/exception.hh \
hpp/util/indent.hh \
hpp/util/debug.hh \
hpp/util/portability.hh \
hpp/util/timer.hh \
hpp/util.hh
include $(top_srcdir)/build-aux/init.mk
# Define logging directory.
loggingdir = $(DESTDIR)$(localstatedir)/log
# Add available warnings flags.
AM_CXXFLAGS += $(WARNING_CXXFLAGS)
# Add Boost.Filesystem linker flags.
AM_LDFLAGS += $(BOOST_FILESYSTEM_LDFLAGS)
# Make sure all symbols are defined.
AM_LDFLAGS += -no-undefined
# Add dependencies CPPFLAGS.
AM_CPPFLAGS += \
-DBUILDING_HPP_UTIL \
-DHPP_LOGGINGDIR=\"$(loggingdir)\" \
$(BOOST_CPPFLAGS)
lib_LTLIBRARIES = libhpp-util.la
libhpp_util_la_SOURCES = \
debug.cc \
exception.cc \
indent.cc \
timer.cc \
version.cc
libhpp_util_la_LIBADD = \
$(BOOST_FILESYSTEM_LIBS) \
$(BOOST_SYSTEM_LIBS)
include $(top_srcdir)/build-aux/init.mk
include $(top_srcdir)/build-aux/autotest.mk
include $(top_srcdir)/build-aux/kineo.mk
# Add available warnings flags.
AM_CXXFLAGS += $(WARNING_CXXFLAGS)
# Package the following files.
EXTRA_DIST += package.m4.in
# Clean atconfig (do not distribute it).
CLEANFILES += atconfig
# Source which are shared by all tests.
COMMON_SOURCES = common.hh
BUILT_SOURCES =
# simple-test
check_PROGRAMS = simple-test
simple_test_SOURCES = simple-test.cc $(COMMON_SOURCES)
simple_test_LDADD = $(top_builddir)/src/libhpp-util.la
# exception
check_PROGRAMS += exception
exception_SOURCES = exception.cc $(COMMON_SOURCES)
exception_LDADD = $(top_builddir)/src/libhpp-util.la
# assertion
check_PROGRAMS += assertion
assertion_SOURCES = assertion.cc $(COMMON_SOURCES)
assertion_LDADD = $(top_builddir)/src/libhpp-util.la
.PHONY: generate-reference
# Re-generate reference outputs.
generate-reference: $(check_PROGRAMS)
@echo "Generating references..."; \
for i in $(check_PROGRAMS); do \
IN="$(srcdir)/$$i.stdin"; \
OUT="$(srcdir)/$$i.stdout"; \
if test -f "$$IN"; then \
"./$$i" < $$IN > $$OUT || true; \
else \
"./$$i" > $$OUT || true; \
fi \
done
# ------------ #
# Test suite. #
# ------------ #
# Distribute reference files.
EXTRA_DIST += \
assertion.stdout \
exception.stdout \
simple-test.stdout
# Clean log files.
CLEANFILES += journal.*.log benchmark.*.*log
# -*- shell-script -*- vi:set ft=sh:
# @configure_input@
# Copyright (C) 2009 by Florent Lamiraux.
#
# This file is part of the hpp-util.
#
# hpp-util is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# hpp-util is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with hpp-util. If not, see <http://www.gnu.org/licenses/>.
# Add test binaries to PATH.
PATH=@abs_builddir@:$PATH
export HPP_LOGGINGDIR=`pwd`
# Copyright (C) 2009 by Florent Lamiraux. -*-Autoconf-*-
#
# This file is part of the hpp-util.
#
# hpp-util is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# hpp-util is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with hpp-util. If not, see <http://www.gnu.org/licenses/>.
# Signature of the current package.
m4_define([AT_PACKAGE_NAME], [@PACKAGE_NAME@])
m4_define([AT_PACKAGE_TARNAME], [@PACKAGE_TARNAME@])
m4_define([AT_PACKAGE_VERSION], [@PACKAGE_VERSION@])
m4_define([AT_PACKAGE_STRING], [@PACKAGE_STRING@])
m4_define([AT_PACKAGE_BUGREPORT], [@PACKAGE_BUGREPORT@])
# Copyright (C) 2010 by Florent Lamiraux. -*-Autotest-*-
#
# This file is part of the hpp-util.
#
# hpp-util is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# hpp-util is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public License
# along with hpp-util. If not, see <http://www.gnu.org/licenses/>.
m4_include([autotest.at])
## ----------------------- ##
## Launch the test suite. ##
## ----------------------- ##
AT_INIT([Main library])
AT_COPYRIGHT(
[Copyright (C) 2010 hpp-util
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.])
CHECK_STDOUT([simple-test], [Check debugging prefix.])
CHECK_STDOUT([exception], [Check exception (class and macros).])
CHECK_STDOUT([assertion], [Check assertion and contract programming tools.])
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment