IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 56859348 authored by ralfulrich's avatar ralfulrich
Browse files

started to copy header files to namesapce directories in build dir

parent 3f643125
No related branches found
No related tags found
No related merge requests found
#ifndef _include_Sink_h_
#define _include_Sink_h_
namespace logger {
namespace fwk {
/**
a sink for the logger must implement the two functions
......
#define CATCH_CONFIG_MAIN // This tells Catch to provide a main() - only do this in one cpp file
#include <catch2/catch.hpp>
#include <Logging/Logger.h>
#include <fwk/Logger.h>
TEST_CASE( "Logging", "[Logging]" )
{
......
set (STACK_HEADERS StackOne.h)
set (PUBLIC_HEADER_FILES StackOne.h)
add_library (CORSIKAstack INTERFACE)
......@@ -11,8 +11,22 @@ add_library (CORSIKAstack INTERFACE)
#target_link_libraries (CORSIKAstackinterface CORSIKAunits)
#target_include_directories (CORSIKAstack PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories (CORSIKAstack INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
$<INSTALL_INTERFACE:include/Framework>
)
target_include_directories (
CORSIKAstack
INTERFACE
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>
)
install (FILES StackOne.h DESTINATION include/Stack)
#add_custom_command (
# CORSIKAstack
# PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PUBLIC_HEADER_FILES} ${PROJECT_BINARY_DIR}/include/corsika})
# )
install (
FILES
StackOne.h
DESTINATION
include/Stack
)
......@@ -5,6 +5,7 @@
#include <string>
#include <StackInterface/Stack.h>
//#include <corsika/Stack.h>
namespace stack {
......@@ -24,8 +25,8 @@ namespace stack {
void SetId(const int id) { GetStack().SetId(GetIndex(), id); }
void SetEnergy(const double e) { GetStack().SetEnergy(GetIndex(), e); }
int GetId() const { GetStack().GetId(GetIndex()); }
double GetEnergy() const { GetStack().GetEnergy(GetIndex()); }
int GetId() const { return GetStack().GetId(GetIndex()); }
double GetEnergy() const { return GetStack().GetEnergy(GetIndex()); }
double GetPDG() const { return 0; } // ConvertToPDG(GetId()); }
void SetPDG(double v) { GetStack().SetId(0, 0); } //fIndex, ConvertFromPDG(v)); }
......
add_custom_command(OUTPUT ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
COMMAND ${PROJECT_SOURCE_DIR}/Framework/Particles/pdxml_reader.py ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleData.xml ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleClassNames.xml
DEPENDS pdxml_reader.py ParticleData.xml ParticleClassNames.xml
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}/Framework/Particles/
COMMENT "Read PYTHIA8 particle data and produce C++ source code GeneratedParticleProperties.inc"
VERBATIM)
add_custom_command (
OUTPUT
${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
COMMAND
${PROJECT_SOURCE_DIR}/Framework/Particles/pdxml_reader.py ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleData.xml ${PROJECT_SOURCE_DIR}/Framework/Particles/ParticleClassNames.xml
DEPENDS
pdxml_reader.py
ParticleData.xml
ParticleClassNames.xml
WORKING_DIRECTORY
${PROJECT_BINARY_DIR}/Framework/Particles/
COMMENT
"Read PYTHIA8 particle data and produce C++ source code GeneratedParticleProperties.inc"
VERBATIM
)
#set (PARTICLES_SOURCES )
set (PARTICLE_HEADERS Particles.h ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc)
set (
PARTICLE_HEADERS
Particles.h
${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
)
add_library (CORSIKAparticles INTERFACE)
......@@ -21,21 +34,50 @@ add_library (CORSIKAparticles INTERFACE)
#target_link_libraries (CORSIKAparticles CORSIKAunits)
#target_include_directories (CORSIKAparticles PRIVATE ${EIGEN3_INCLUDE_DIR})
target_include_directories (CORSIKAparticles INTERFACE ${EIGEN3_INCLUDE_DIR})
target_include_directories (CORSIKAparticles INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/Framework>
$<INSTALL_INTERFACE:include/Framework>
)
target_include_directories (
CORSIKAparticles
INTERFACE
${EIGEN3_INCLUDE_DIR}
)
target_include_directories (
CORSIKAparticles
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/Framework>
$<INSTALL_INTERFACE:include/Framework>
)
#install (TARGETS CORSIKAparticles
# LIBRARY DESTINATION lib
# ARCHIVE DESTINATION lib
# PUBLIC_HEADER DESTINATION include/Particles)
install (FILES ${PARTICLE_HEADERS} DESTINATION include/Particles)
install (
FILES
${PARTICLE_HEADERS}
DESTINATION
include/Particles
)
# code testing
add_executable (testParticles testParticles.cc ${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc)
target_link_libraries (testParticles CORSIKAparticles CORSIKAunits CORSIKAthirdparty) # for catch2
add_test (NAME testParticles COMMAND testParticles)
add_executable (
testParticles
testParticles.cc
${PROJECT_BINARY_DIR}/Framework/Particles/GeneratedParticleProperties.inc
)
target_link_libraries (
testParticles
CORSIKAparticles
CORSIKAunits
CORSIKAthirdparty # for catch2
)
add_test (
NAME
testParticles
COMMAND
testParticles
)
......@@ -203,6 +203,8 @@ def gen_classes(pythia_db):
break
string += "\n";
string += "/** @class " + cname + "\n"
string += "*/\n\n"
string += "struct " + cname + "{\n"
string += " static InternalParticleCode GetType() { return Type; }\n"
string += " static quantity<energy_d> GetMass() { return masses[TypeIndex]; }\n"
......
set (
PUBLIC_HEADER_FILES
Stack.h
StackIterator.h
)
add_library (CORSIKAstackinterface INTERFACE)
add_library (
CORSIKAstackinterface
INTERFACE
)
target_include_directories (CORSIKAstackinterface INTERFACE $<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/Framework>
$<INSTALL_INTERFACE:include/Framework>
)
target_include_directories (
CORSIKAstackinterface
INTERFACE
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
)
install (FILES Stack.h StackIterator.h
DESTINATION include/StackInterface)
#add_custom_command (
# TARGET
# CORSIKAstackinterface
# PRE_BUILD
# COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PUBLIC_HEADER_FILES} ${PROJECT_BINARY_DIR}/include/corsika
# )
install (
FILES
${PUBLIC_HEADER_FILES}
DESTINATION
include/corsika
)
......@@ -2,6 +2,7 @@
#define _include_Stack_h__
#include <StackInterface/StackIterator.h> // to help application programmres
//#include <corsika/StackIterator.h> // to help application programmres
/**
All classes around management of particles on a stack.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment