Skip to content

Commit

Permalink
Add a small downstream project for testing
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Jan 11, 2024
1 parent 1ff4e36 commit 1148219
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/downstream-project-cmake-test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.14)

project(DownstreamProjectUsingLCIO)

find_package(LCIO REQUIRED)

# Make sure that the LCIO version is set and usableas a version
if (${LCIO_VERSION} VERSION_GREATER "0.0.0")
message(STATUS "Found LCIO version " ${LCIO_VERSION})
else()
message(FATAL_ERROR "Cannot determine LCIO_VERSION")
endif()

add_executable(lcio_test_program lcio_test_program.cpp)
target_link_libraries(lcio_test_program PRIVATE LCIO::lcio)
22 changes: 22 additions & 0 deletions tests/downstream-project-cmake-test/lcio_test_program.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#include "EVENT/LCEvent.h"
#include "IMPL/LCCollectionVec.h"
#include "IMPL/LCEventImpl.h"
#include "IMPL/MCParticleImpl.h"
#include "MT/LCWriter.h"

int main() {
auto mcp = new IMPL::MCParticleImpl();
mcp->setPDG(11);

auto coll = new IMPL::LCCollectionVec(EVENT::LCIO::MCPARTICLE);
coll->addElement(mcp);

auto event = new IMPL::LCEventImpl();
event->addCollection(coll, "mcps");

auto writer = MT::LCWriter();
writer.open("test.slcio");
writer.writeEvent(event);

return 0;
}

0 comments on commit 1148219

Please sign in to comment.