Skip to content

Commit

Permalink
CMake: install all library targets, use relative paths from GNUInstal…
Browse files Browse the repository at this point in the history
…lDirs
  • Loading branch information
andresailer committed Nov 16, 2023
1 parent 53b96a6 commit 38b50ac
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,12 @@ target_link_libraries(${PackageName}G4 DD4hep::DDCore DD4hep::DDRec DD4hep::DDPa
#Create this_package.sh file, and install
dd4hep_instantiate_package(${PackageName})

# Destination directories are hardcoded because GNUdirectories are not included
install(TARGETS ${PackageName} ${PackageName}G4
EXPORT ${PROJECT_NAME}Targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} COMPONENT shlib
)

#---Testing-------------------------------------------------------------------------
if(BUILD_TESTING)
include(CTest)
Expand Down
8 changes: 4 additions & 4 deletions detectorSegmentations/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ target_include_directories(detectorSegmentationsPlugin
# Destination directories are hardcoded because GNUdirectories are not included
install(TARGETS detectorSegmentations detectorSegmentationsPlugin
EXPORT ${PROJECT_NAME}Targets
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/bin" COMPONENT bin
LIBRARY DESTINATION "${CMAKE_INSTALL_PREFIX}/lib" COMPONENT shlib
PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_PREFIX}/include/detectorSegmentations"
COMPONENT dev)
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} COMPONENT bin
LIBRARY DESTINATION ${CMAKE_INSTALL_LIDIR} COMPONENT shlib
PUBLIC_HEADER DESTINATION include/detectorSegmentations COMPONENT dev
)

#
#include(CTest)
Expand Down

0 comments on commit 38b50ac

Please sign in to comment.