Skip to content
Merged

V3.0 #17

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 12 additions & 13 deletions Application/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#todo sym links not copy headers, use macro to seach for .so files in Usertools and add the libraries to libs list and symlink to libs folder

cmake_minimum_required (VERSION 2.6)

project (ToolFrameworkApplicaiton)
Expand All @@ -10,11 +12,15 @@ set(MYTOOLS_INC "")
set(MYTOOLS_LIB_PATH "")
set(MYTOOLS_LIBS "")

include_directories (${DATAMODEL_INC} ${MYTOOLS_INC})
link_directories(${DATAMODEL_LIB_PATH} ${MYTOOLS_LIB_PATH})
set(TOOLFRAMEWORK_INC "${PROJECT_SOURCE_DIR}/Dependencies/ToolFrameworkCore/include")
set(TOOLFRAMEWORK_LIBS_PATH "${PROJECT_SOURCE_DIR}/Dependencies/ToolFrameworkCore/lib")
set(TOOLFRAMEWORK_LIBS "-lDataModelBase -lLogging -lStore -lToolChain")

include_directories (${DATAMODEL_INC} ${MYTOOLS_INC} ${TOOLFRAMEWORK_INC})
link_directories(${DATAMODEL_LIB_PATH} ${MYTOOLS_LIB_PATH} ${TOOLFRAMEWORK_LIBS_PATH})

MACRO(HEADER_DIRECTORIES return_list)
FILE(GLOB_RECURSE new_list ${PROJECT_SOURCE_DIR}/*.h)
FILE(GLOB_RECURSE new_list ${PROJECT_SOURCE_DIR}/src/*.h ${PROJECT_SOURCE_DIR}/DataModel/*.h ${PROJECT_SOURCE_DIR}/UserTools/*.h )
FILE(COPY ${new_list} DESTINATION ${PROJECT_BINARY_DIR}/include)
SET(dir_list "")
FOREACH(file_path ${new_list})
Expand All @@ -30,22 +36,15 @@ FILE(COPY ${PROJECT_SOURCE_DIR}/configfiles DESTINATION ${PROJECT_BINARY_DIR}/)
HEADER_DIRECTORIES(header_list)
include_directories(${header_list})

set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

file(GLOB_RECURSE STORE_SRC RELATIVE ${CMAKE_SOURCE_DIR} "Dependencies/ToolFrameworkCore/src/Store/*.cpp")
add_library(Store SHARED ${STORE_SRC})
message(header_list=${header_list})

file(GLOB_RECURSE LOGGING_SRC RELATIVE ${CMAKE_SOURCE_DIR} "Dependencies/ToolFrameworkCore/src/Logging/*.cpp")
add_library(Logging SHARED ${LOGGING_SRC})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR}/lib)

file(GLOB_RECURSE DATAMODEL_SRC RELATIVE ${CMAKE_SOURCE_DIR} "DataModel/*.cpp")
add_library(DataModel SHARED ${DATAMODEL_SRC})

file(GLOB_RECURSE MYTOOLS_SRC RELATIVE ${CMAKE_SOURCE_DIR} "UserTools/*.cpp")
add_library(MyTools SHARED ${MYTOOLS_SRC})

file(GLOB_RECURSE TOOLCHAIN_SRC RELATIVE ${CMAKE_SOURCE_DIR} "Dependencies/ToolFrameworkCore/src/ToolChain/*.cpp")
add_library(ToolChain SHARED ${TOOLCHAIN_SRC})

add_executable (main ${PROJECT_SOURCE_DIR}/src/main.cpp)
target_link_libraries (main Store Logging ToolChain MyTools DataModel pthread ${DATAMODEL_LIBS} ${MYTOOLS_LIBS})
target_link_libraries (main MyTools DataModel pthread ${DATAMODEL_LIBS} ${MYTOOLS_LIBS} ${TOOLFRAMEWORK_LIBS})
80 changes: 80 additions & 0 deletions Application/Makefile.new
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
Dependencies=Dependencies
ToolFrameworkCore=$(Dependencies)/ToolFrameworkCore
SOURCEDIR=`pwd`

CXXFLAGS= -fPIC -O3 -Wpedantic -Wall -std=c++11 -Wno-comment -Wno-unused -Wextra -Wcast-align -Wcast-qual -Wctor-dtor-privacy -Wdisabled-optimization -Wformat=2 -Winit-self -Wlogical-op -Wmissing-declarations -Wmissing-include-dirs -Wnoexcept -Woverloaded-virtual -Wredundant-decls -Wshadow -Wsign-conversion -Wsign-promo -Wstrict-null-sentinel -Wstrict-overflow=5 -Wswitch-default -Wundef #-Werror -Wold-style-cast


ifeq ($(MAKECMDGOALS),debug)
CXXFLAGS+= -O0 -g -lSegFault -rdynamic -DDEBUG
endif

DataModelInclude =
DataModelLib =

MyToolsInclude =
MyToolsLib =

Includes=-I $(ToolFrameworkCore)/include/ -I $(SOURCEDIR)/include/
ToolLibraries = $(patsubst %, lib/%, $(filter lib%, $(subst /, , $(wildcard UserTools/*/*.so))))
LIBRARIES=lib/libDataModel.so lib/libMyTools.so $(ToolLibraries)
DataModelHEADERS:=$(patsubst %.h, include/%.h, $(filter %.h, $(subst /, ,$(wildcard DataModel/*.h))))
MyToolHEADERS:=$(patsubst %.h, include/%.h, $(filter %.h, $(subst /, ,$(wildcard UserTools/*/*.h) $(wildcard UserTools/*.h))))
ToolLibs = $(patsubst %.so, %, $(patsubst lib%, -l%,$(filter lib%, $(subst /, , $(wildcard UserTools/*/*.so)))))
AlreadyCompiled = $(wildcard UserTools/$(filter-out %.so UserTools , $(subst /, ,$(wildcard UserTools/*/*.so)))/*.cpp)
SOURCEFILES:=$(patsubst %.cpp, %.o, $(filter-out $(AlreadyCompiled), $(wildcard */*.cpp) $(wildcard */*/*.cpp)))
Libs=-L $(SOURCEDIR)/lib/ -lMyTools -lDataModel -L $(ToolFrameworkCore)/lib/ -lStore -lLogging -lToolChain -lDataModelBase -lpthread $(ToolLibs)


#.SECONDARY: $(%.o)

all: $(DataModelHEADERS) $(MyToolHEADERS) $(SOURCEFILES) $(LIBRARIES) main

debug: all

main: src/main.o $(LIBRARIES) $(DataModelHEADERS) $(MyToolHEADERS) | $(SOURCEFILES)
@echo -e "\e[38;5;11m\n*************** Making " $@ " ****************\e[0m"
g++ $(CXXFLAGS) $< -o $@ $(Includes) $(Libs) $(DataModelInclude) $(DataModellib) $(MyToolsInclude) $(MyToolslib)

include/%.h:
@echo -e "\e[38;5;87m\n*************** sym linking headers ****************\e[0m"
ln -s `pwd`/$(filter %$(strip $(patsubst include/%.h, /%.h, $@)), $(wildcard DataModel/*.h) $(wildcard UserTools/*/*.h) $(wildcard UserTools/*.h)) $@

src/%.o : src/%.cpp
@echo -e "\e[38;5;214m\n*************** Making " $@ "****************\e[0m"
g++ $(CXXFLAGS) -c $< -o $@ $(Includes)

UserTools/Factory/Factory.o : UserTools/Factory/Factory.cpp $(DataModelHEADERS)
@echo -e "\e[38;5;214m\n*************** Making " $@ "****************\e[0m"
g++ $(CXXFLAGS) -c $< -o $@ $(Includes) $(DataModelInclude) $(ToolsInclude)

UserTools/%.o : UserTools/%.cpp $(DataModelHEADERS) UserTools/%.h
@echo -e "\e[38;5;214m\n*************** Making " $@ "****************\e[0m"
g++ $(CXXFLAGS) -c $< -o $@ $(Includes) $(DataModelInclude) $(ToolsInclude)

DataModel/%.o : DataModel/%.cpp DataModel/%.h $(DataModelHEADERS)
@echo -e "\e[38;5;214m\n*************** Making " $@ "****************\e[0m"
g++ $(CXXFLAGS) -c $< -o $@ $(Includes) $(DataModelInclude)

lib/libDataModel.so: $(patsubst %.cpp, %.o , $(wildcard DataModel/*.cpp)) | $(DataModelInclude)
@echo -e "\e[38;5;201m\n*************** Making " $@ "****************\e[0m"
g++ $(CXXFLAGS) --shared $^ -o $@ $(Includes) $(DataModelInclude)

lib/libMyTools.so: $(patsubst %.cpp, %.o , $(filter-out $(AlreadyCompiled), $(wildcard UserTools/*/*.cpp))) | $(DataModelInclude) $(MyToolsInclude)
@echo -e "\e[38;5;201m\n*************** Making " $@ "****************\e[0m"
g++ $(CXXFLAGS) --shared $^ -o $@ $(Includes) $(DataModelInclude) $(MyToolsInclude)

lib/%.so:
@echo -e "\e[38;5;87m\n*************** sym linking Tool libs ****************\e[0m"
ln -s `pwd`/$(filter %$(strip $(patsubst lib/%.so, /%.so ,$@)), $(wildcard UserTools/*/*.so)) $@

clean:
@echo -e "\e[38;5;201m\n*************** Cleaning up ****************\e[0m"
rm -f */*/*.o
rm -f */*.o
rm -f include/*.h
rm -f lib/*.so

Docs:
doxygen Doxyfile

2 changes: 1 addition & 1 deletion Application/Setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

Dependencies=`pwd`/Dependencies

export LD_LIBRARY_PATH=`pwd`/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=`pwd`/lib:$Dependencies/ToolFrameworkCore/lib:$LD_LIBRARY_PATH

export SEGFAULT_SIGNALS="all"
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,17 @@ add_library(Store SHARED ${STORE_SRC})
file(GLOB_RECURSE LOGGING_SRC RELATIVE ${CMAKE_SOURCE_DIR} "src/Logging/*.cpp")
add_library(Logging SHARED ${LOGGING_SRC})

file(GLOB_RECURSE DATAMODEL_SRC RELATIVE ${CMAKE_SOURCE_DIR} "DataModel/*.cpp")
add_library(DataModel SHARED ${DATAMODEL_SRC})
file(GLOB_RECURSE DATAMODELBASE_SRC RELATIVE ${CMAKE_SOURCE_DIR} "src/DataModelBase/*.cpp")
add_library(DataModelBase SHARED ${DATAMODELBASE_SRC})

file(GLOB_RECURSE MYTOOLS_SRC RELATIVE ${CMAKE_SOURCE_DIR} "UserTools/*.cpp")
add_library(MyTools SHARED ${MYTOOLS_SRC})
file(GLOB_RECURSE TEMPDATAMODEL_SRC RELATIVE ${CMAKE_SOURCE_DIR} "DataModel/*.cpp")
add_library(TempDataModel SHARED ${TEMPDATAMODEL_SRC})

file(GLOB_RECURSE TEMPTOOLS_SRC RELATIVE ${CMAKE_SOURCE_DIR} "UserTools/*.cpp")
add_library(TempTools SHARED ${TEMPTOOLS_SRC})

file(GLOB_RECURSE TOOLCHAIN_SRC RELATIVE ${CMAKE_SOURCE_DIR} "src/ToolChain/*.cpp")
add_library(ToolChain SHARED ${TOOLCHAIN_SRC})

add_executable (main ${PROJECT_SOURCE_DIR}/src/main.cpp)
target_link_libraries (main Store Logging ToolChain MyTools DataModel pthread ${DATAMODEL_LIBS} ${MYTOOLS_LIBS})
target_link_libraries (main Store Logging DataModelBase ToolChain TempTools TempDataModel pthread ${DATAMODEL_LIBS} ${MYTOOLS_LIBS})
2 changes: 1 addition & 1 deletion DataModel/DataModel.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "DataModel.h"

DataModel::DataModel(){ Log=0;}
DataModel::DataModel():DataModelBase(){}

/*
TTree* DataModel::GetTTree(std::string name){
Expand Down
15 changes: 5 additions & 10 deletions DataModel/DataModel.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
#include "Store.h"
#include "BStore.h"
#include "Logging.h"
#include "DataModelBase.h"

using namespace ToolFramework;

/**
* \class DataModel
Expand All @@ -23,7 +26,7 @@
*
*/

class DataModel {
class DataModel: public DataModelBase {


public:
Expand All @@ -33,16 +36,8 @@ class DataModel {
//TTree* GetTTree(std::string name);
//void AddTTree(std::string name,TTree *tree);
//void DeleteTTree(std::string name,TTree *tree);

Logging *Log; ///< Log class pointer for use in Tools, it can be used to send messages which can have multiple error levels and destination end points

Store vars; ///< This Store can be used for any variables. It is an inefficent ascii based storage and command line arguments will be placed in here along with ToolChain variables
BStore CStore; ///< This is a more efficent binary Store that can be used to store a dynamic set of inter Tool variables, very useful for constants and and flags hence the name CStore
std::map<std::string,BStore*> Stores; ///< This is a map of named BStore pointers which can be deffined to hold a nammed collection of any type of BStore. It is usefull to store data collections that needs subdividing into differnt stores.



private:
// private:


//std::map<std::string,TTree*> m_trees;
Expand Down
82 changes: 0 additions & 82 deletions DataModel/Utilities.h

This file was deleted.

Loading