Changeset 115378 for src


Ignore:
Timestamp:
Dec 22, 2010, 9:16:51 AM (15 years ago)
Author:
Frederik Heber <heber@…>
Children:
9098f9
Parents:
1d77e1a
git-author:
Frederik Heber <heber@…> (12/22/10 08:22:13)
git-committer:
Frederik Heber <heber@…> (12/22/10 09:16:51)
Message:

Changes to allow for (re-)incorporation of CodePatterns into MoleCuilder.

library:

  • no more suffixed with version, this should be dealt by pkg-config (.pc) or a contained version information.
  • corrected and extended .pc file
  • m4 macro ax_codepatterns.m4 created to allow for easy checking with autotools

codepatterns-config:

  • if pkg-config fails there is a small tool that tells about necessary cflags and the likes to compile with CodePatterns library (this was developed before we noticed we had a (half-)working pkg-config present).

smaller changes:

  • moved all Helpers files to src/Helpers (again).
  • changed include paths for Assert.hpp, ... accordingly.
  • version is not prefixed with "v" anymore.
  • small stuff in fast_functions.hpp is absolete (stl::algorithms)
  • Helpers/enumeration.hpp contains enumeration class ("iterable enum")
Location:
src
Files:
4 added
3 deleted
12 edited
16 moved

Legend:

Unmodified
Added
Removed
  • src/Helpers/Assert.hpp

    r1d77e1a r115378  
    1515#include<map>
    1616
    17 #include "toString.hpp"
     17#include "Helpers/toString.hpp"
    1818
    1919/**
  • src/Makefile.am

    r1d77e1a r115378  
    11# PLEASE adhere to the alphabetical ordering in this Makefile!
    22# Also indentation by a single tab
    3 
    4 SUBDIRS = Patterns
    53
    64INCLUDES = -I$(top_srcdir)/src
     
    119AM_CPPFLAGS = ${BOOST_CPPFLAGS}
    1210
     11BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_THREAD_LIB)
     12
     13
     14## config utility ###
     15
     16bin_PROGRAMS = codepatterns-config
     17
     18codepatterns_config_SOURCES = \
     19        codepatterns-config-main.cpp \
     20        codepatterns-config.cpp \
     21        codepatterns-config.hpp \
     22        version.hpp
     23codepatterns_config_LDFLAGS = \
     24        $(BOOST_LDFLAGS) \
     25        $(BOOST_PROGRAM_OPTIONS_LIB) \
     26        $(BOOST_THREAD_LIB) \
     27        libCodePatterns.la
     28
     29
     30### PATTERNS ###
     31
     32nobase_include_HEADERS = $(PATTERNSOURCE) $(PATTERNHEADER)
     33
     34PATTERNSOURCE = \
     35        Patterns/ObservedContainer_impl.hpp \
     36        Patterns/Registry_impl.hpp \
     37        Patterns/Singleton_impl.hpp
     38PATTERNHEADER = \
     39        Patterns/Cacheable.hpp \
     40        Patterns/ObservedContainer.hpp \
     41        Patterns/ObservedIterator.hpp \
     42        Patterns/Observer.hpp \
     43        Patterns/Registry.hpp \
     44        Patterns/Singleton.hpp
     45
     46### HELPERS ###
     47
     48include_HEADERS = \
     49        $(srcdir)/version.hpp
     50
    1351# this includes source files that need to be present at multiple points
    1452HELPERSSOURCE =  \
    15   Assert.cpp \
    16   errorlogger.cpp \
    17   Info.cpp \
    18   Log.cpp \
    19   logger.cpp \
    20   MemDebug.cpp \
    21   Verbose.cpp \
    22   $(srcdir)/version.cpp
     53        Patterns/Observer.cpp \
     54        Helpers/Assert.cpp \
     55        Helpers/errorlogger.cpp \
     56        Helpers/Info.cpp \
     57        Helpers/Log.cpp \
     58        Helpers/logger.cpp \
     59        Helpers/MemDebug.cpp \
     60        Helpers/Verbose.cpp \
     61        $(srcdir)/version.cpp
    2362
    2463HELPERSHEADER =  \
    25   Assert.hpp \
    26   errorlogger.hpp \
    27   Info.hpp \
    28   Log.hpp \
    29   logger.hpp \
    30   MemDebug.hpp \
    31   Verbose.hpp \
    32   $(srcdir)/version.hpp
     64        Helpers/Assert.hpp \
     65        Helpers/enumeration.hpp \
     66        Helpers/errorlogger.hpp \
     67        Helpers/Info.hpp \
     68        Helpers/Log.hpp \
     69        Helpers/logger.hpp \
     70        Helpers/MemDebug.hpp \
     71        Helpers/Range.hpp \
     72        Helpers/toString.hpp \
     73        Helpers/Verbose.hpp \
     74        $(srcdir)/version.hpp
    3375
    34 lib_LTLIBRARIES = libCodePatterns-@CODEPATTERNS_API_VERSION@.la
    35 libCodePatterns_includedir = $(includedir)/CodePatterns-$(CODEPATTERNS_API_VERSION)/
    36 nobase_libCodePatterns_include_HEADERS = ${HELPERSHEADER}
     76##-@CODEPATTERNS_API_VERSION@
     77lib_LTLIBRARIES = libCodePatterns.la
     78libCodePatterns_LIBS = $(BOOST_THREAD_LIB)
    3779
    3880## Define the source file list for the "libexample-@CODEPATTERNS_API_VERSION@.la"
     
    4486## from each source file.  Note that it is not necessary to list header files
    4587## which are already listed elsewhere in a _HEADERS variable assignment.
    46 libCodePatterns_@CODEPATTERNS_API_VERSION@_la_SOURCES = ${HELPERSSOURCE}
     88#-$(CODEPATTERNS_API_VERSION)
     89libCodePatterns_la_SOURCES = ${HELPERSSOURCE}
    4790
    4891## Instruct libtool to include ABI version information in the generated shared
    4992## library file (.so).  The library ABI version is defined in configure.ac, so
    5093## that all version information is kept in one place.
    51 libCodePatterns_@CODEPATTERNS_API_VERSION@_la_LDFLAGS = -version-info $(CODEPATTERNS_SO_VERSION)
     94#-$(CODEPATTERNS_API_VERSION)
     95libCodePatterns_la_LDFLAGS = -version-info $(CODEPATTERNS_SO_VERSION)
    5296
    5397## The generated configuration header is installed in its own subdirectory of
     
    62106## configuration header file is generated at configure time and should not be
    63107## shipped with the source tarball.
    64 libCodePatterns_libincludedir = $(libdir)/CodePatterns-$(CODEPATTERNS_API_VERSION)/include
    65 nodist_libCodePatterns_libinclude_HEADERS = $(top_builddir)/libCodePatterns_config.h
     108libCodePatterns_libincludedir = $(includedir)/Helpers/
     109#-$(CODEPATTERNS_API_VERSION)
     110nodist_libCodePatterns_libinclude_HEADERS = $(HELPERSHEADER) $(top_builddir)/libCodePatterns_config.h
    66111
    67112## Install the generated pkg-config file (.pc) into the expected location for
     
    70115## in which case the correct install location would be $(datadir)/pkgconfig.
    71116pkgconfigdir = $(libdir)/pkgconfig
    72 pkgconfig_DATA = $(top_builddir)/CodePatterns-$(CODEPATTERNS_API_VERSION).pc
     117pkgconfig_DATA = $(top_builddir)/CodePatterns.pc
    73118
    74119FORCE:
     
    76121$(srcdir)/.git-version: FORCE
    77122        @if (test -d $(top_srcdir)/.git && cd $(srcdir) \
    78              && { git describe --dirty --always || git describe; } ) > .git-version-t 2>/dev/null \
     123             && { git describe | sed -e "s#^v##" ; } ) > .git-version-t 2>/dev/null \
    79124          && ! diff .git-version-t $(srcdir)/.git-version >/dev/null 2>&1; then \
    80125          mv -f .git-version-t $(srcdir)/.git-version; \
     
    86131
    87132$(srcdir)/version.cpp: $(srcdir)/.git-version
    88         echo "const char *MOLECUILDERVERSION = \"$(PACKAGE_NAME) version "`cat $(srcdir)/.git-version`"\";" > $@
     133        echo -e "const char *CODEPATTERNSVERSION = \"`cat $(srcdir)/.git-version`\";\nconst char *CODEPATTERNSFULLVERSION = \"$(PACKAGE_NAME) version "`cat $(srcdir)/.git-version`"\";\n" > $@
     134
     135$(srcdir)/codepatterns-config.cpp:
     136        echo -e "const char *CODEPATTERNSCFLAGS=\"-I$(includedir) ${BOOST_CPPFLAGS}\";\nconst char *CODEPATTERNSLDFLAGS=\"-L$(libdir) $(BOOST_LDFLAGS)\";\nconst char *CODEPATTERNSLIBS=\"-lCodePatterns $(BOOST_THREAD_LIB)\";\n" > $@
     137
  • src/Patterns/Cacheable.hpp

    r1d77e1a r115378  
    1313#include <boost/shared_ptr.hpp>
    1414
    15 #include "Assert.hpp"
     15#include "Helpers/Assert.hpp"
    1616
    1717#ifndef NO_CACHING
  • src/Patterns/Observer.cpp

    r1d77e1a r115378  
    1818#endif
    1919
    20 #include "MemDebug.hpp"
     20#include "Helpers/MemDebug.hpp"
    2121
    2222#include "Observer.hpp"
     
    2424#include <iostream>
    2525
    26 #include "Assert.hpp"
    27 #include "MemDebug.hpp"
     26#include "Helpers/Assert.hpp"
     27#include "Helpers/MemDebug.hpp"
    2828
    2929using namespace std;
  • src/Patterns/Registry_impl.hpp

    r1d77e1a r115378  
    99#define REGISTRY_IMPL_HPP_
    1010
    11 #include "MemDebug.hpp"
     11#include "Helpers/MemDebug.hpp"
    1212
    1313#include "Patterns/Registry.hpp"
    1414#include "Patterns/Singleton_impl.hpp"
    1515
    16 #include "Assert.hpp"
     16#include "Helpers/Assert.hpp"
    1717#include <iostream>
    1818
  • src/Patterns/Singleton.hpp

    r1d77e1a r115378  
    1111#include <boost/thread.hpp>
    1212
    13 #include "Assert.hpp"
     13#include "Helpers/Assert.hpp"
    1414
    1515/**
  • src/Patterns/Singleton_impl.hpp

    r1d77e1a r115378  
    99#define SINGLETON_IMPL_HPP_
    1010
    11 #include "Assert.hpp"
     11#include "Helpers/Assert.hpp"
    1212#include "Patterns/Singleton.hpp"
    1313
  • src/Patterns/unittests/Makefile.am

    r1d77e1a r115378  
    2020BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_THREAD_LIB)
    2121TESTLIBS = \
    22         ../../libCodePatterns-@CODEPATTERNS_API_VERSION@.la \
     22        ../../libCodePatterns.la \
    2323        $(BOOST_LIB)
    2424
     
    2727        CacheableUnitTest.hpp \
    2828        ../Cachable.hpp \
    29         ../Observer.cpp \
    3029        ../Observer.hpp \
    3130        ../ObserverIterator.hpp
     
    3534        ObserverUnitTest.cpp \
    3635        ObserverUnitTest.hpp \
    37         ../Observer.cpp \
    3836        ../Observer.hpp \
    3937        ../ObserverIterator.hpp
  • src/Patterns/unittests/ObserverUnitTest.cpp

    r1d77e1a r115378  
    2525#include "Patterns/Observer.hpp"
    2626#include "Patterns/ObservedIterator.hpp"
    27 #include "Assert.hpp"
     27#include "Helpers/Assert.hpp"
    2828
    2929#include <iostream>
  • src/unittests/InfoUnitTest.cpp

    r1d77e1a r115378  
    2727#include <stdio.h>
    2828
    29 #include "Info.hpp"
    30 #include "Log.hpp"
     29#include "Helpers/Info.hpp"
     30#include "Helpers/Log.hpp"
    3131
    3232#include "InfoUnitTest.hpp"
  • src/unittests/LogUnitTest.cpp

    r1d77e1a r115378  
    2222#include <cppunit/ui/text/TestRunner.h>
    2323
    24 #include "Log.hpp"
    25 #include "Verbose.hpp"
     24#include "Helpers/Log.hpp"
     25#include "Helpers/Verbose.hpp"
    2626
    2727#include "LogUnitTest.hpp"
  • src/unittests/Makefile.am

    r1d77e1a r115378  
    2020BOOST_LIB = $(BOOST_LDFLAGS) $(BOOST_MPL_LIB) $(BOOST_PROGRAM_OPTIONS_LIB) $(BOOST_FILESYSTEM_LIB) $(BOOST_SYSTEM_LIB) $(BOOST_THREAD_LIB)
    2121TESTLIBS = \
    22         ../libCodePatterns-@CODEPATTERNS_API_VERSION@.la \
     22        ../libCodePatterns.la \
    2323        $(BOOST_LIB)
    2424
  • src/version.hpp

    r1d77e1a r115378  
    1 #ifndef VERSION_H_
    2 #define VERSION_H_
     1#ifndef VERSION_HPP_
     2#define VERSION_HPP_
    33
    4 extern const char *MOLECUILDERVERSION;
     4extern const char *CODEPATTERNSVERSION;
     5extern const char *CODEPATTERNSFULLVERSION;
    56
    6 #endif /* VERSION_H_ */
     7#endif /* VERSION_HPP_ */
Note: See TracChangeset for help on using the changeset viewer.