Skip to content
Snippets Groups Projects
Commit 2aefa4f8 authored by lintao@ihep.ac.cn's avatar lintao@ihep.ac.cn
Browse files

WIP: add the install macros.

parent c6d628aa
No related branches found
No related tags found
No related merge requests found
......@@ -18,3 +18,9 @@ gaudi_add_module(TotalInvMass
EDM4HEP::edm4hep EDM4HEP::edm4hepDict
${ROOT_LIBRARIES}
)
install(TARGETS TotalInvMass
EXPORT CEPCSWTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
COMPONENT dev)
......@@ -6,6 +6,15 @@ find_package(ROOT COMPONENTS RIO Tree)
find_package(Gaudi)
include(GNUInstallDirs)
include(CTest)
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
set(CMAKE_INSTALL_PREFIX ${CMAKE_SOURCE_DIR}/InstallArea/ CACHE PATH
"Install path prefix, prepended onto install directories." FORCE )
endif()
# Set up C++ Standard
# ``-DCMAKE_CXX_STANDARD=<standard>`` when invoking CMake
set(CMAKE_CXX_STANDARD 17 CACHE STRING "")
......@@ -16,3 +25,15 @@ endif()
add_subdirectory(Analysis)
add_subdirectory(Detector)
##############################################################################
# INSTALL
##############################################################################
install(EXPORT ${PROJECT_NAME}Targets
NAMESPACE ${PROJECT_NAME}::
FILE "${PROJECT_NAME}Targets.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}/"
)
gaudi_install(CMAKE cmake/${PROJECT_NAME}Config.cmake)
......@@ -5,4 +5,4 @@
# add_subdirectory(DetEcalMatrix)
add_subdirectory(DetInterface)
# add_subdirectory(DetSegmentation)
# add_subdirectory(GeomSvc)
add_subdirectory(GeomSvc)
......@@ -4,31 +4,22 @@
# Desc: implement the IGeomSvc interface.
##############################################################################
gaudi_subdir(GeomSvc v0r0)
gaudi_depends_on_subdirs(
k4FWCore
Detector/DetInterface
)
find_package(ROOT COMPONENTS MathCore GenVector Geom Tree)
find_package(DD4hep COMPONENTS DDG4 DDRec REQUIRED)
find_package(GEAR REQUIRED)
message("GEAR_LIBRARIES: ${GEAR_LIBRARIES}")
gaudi_add_module(GeomSvc
src/GeomSvc.cpp
INCLUDE_DIRS
# DetInterface
# DD4hep
# GaudiKernel
# ROOT
LINK_LIBRARIES
DD4hep
SOURCES src/GeomSvc.cpp
LINK
DetInterface
${DD4hep_COMPONENT_LIBRARIES}
GaudiKernel
Gaudi::GaudiKernel
${GEAR_LIBRARIES}
${ROOT_LIBRARIES}
# ROOT
)
install(TARGETS GeomSvc
EXPORT CEPCSWTargets
RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT bin
LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}" COMPONENT shlib
COMPONENT dev)
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