IAP GITLAB

Skip to content
Snippets Groups Projects
CMakeLists.txt 1.57 KiB
Newer Older
ralfulrich's avatar
ralfulrich committed

set (
  GEOMETRY_SOURCES
  CoordinateSystem.cc
  )

set (
  GEOMETRY_HEADERS
  Vector.h
  Point.h
  Line.h
  Volume.h
  RootCoordinateSystem.h
  Helix.h
  BaseVector.h
  QuantityVector.h
  Trajectory.h
ralfulrich's avatar
ralfulrich committed
  FourVector.h
ralfulrich's avatar
ralfulrich committed

add_library (CORSIKAgeometry STATIC ${GEOMETRY_SOURCES})
CORSIKA_COPY_HEADERS_TO_NAMESPACE (CORSIKAgeometry ${GEOMETRY_NAMESPACE} ${GEOMETRY_HEADERS})
set_target_properties (
  CORSIKAgeometry
  PROPERTIES
  VERSION ${PROJECT_VERSION}
  SOVERSION 1
  PUBLIC_HEADER "${GEOMETRY_HEADERS}"
  )
# target dependencies on other libraries (also the header onlys)
target_link_libraries (
  CORSIKAgeometry
  CORSIKAunits
target_include_directories (
  CORSIKAgeometry
  INTERFACE ${EIGEN3_INCLUDE_DIR}
  )

target_include_directories (
  CORSIKAgeometry
  INTERFACE
  $<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
  $<INSTALL_INTERFACE:include/include>
  )
install (
  TARGETS CORSIKAgeometry
  LIBRARY DESTINATION lib
  ARCHIVE DESTINATION lib
  PUBLIC_HEADER DESTINATION include/${GEOMETRY_NAMESPACE}
  )
# --------------------
# code unit testing
ralfulrich's avatar
ralfulrich committed
add_executable (testGeometry testGeometry.cc)
target_link_libraries (
  testGeometry
  CORSIKAgeometry
  CORSIKAunits
  CORSIKAthirdparty # for catch2
  )
CORSIKA_ADD_TEST(testGeometry)
ralfulrich's avatar
ralfulrich committed

add_executable (testFourVector testFourVector.cc) 
target_link_libraries (
  testFourVector
  CORSIKAgeometry
  CORSIKAunits
  CORSIKAthirdparty # for catch2
  )
CORSIKA_ADD_TEST(testFourVector)