diff --git a/CMakeLists.txt b/CMakeLists.txt index 6447fa65034f6691f1e42dbf2f3ecd9f90fee342..0707d3605ab98a7598cfcec3df9e6d274b8700b5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -66,3 +66,4 @@ endif() configure_file(cmake/thisdd4hep.csh thisdd4hep.csh @ONLY) configure_file(cmake/thisdd4hep.sh thisdd4hep.sh @ONLY) + diff --git a/DDCore/CMakeLists.txt b/DDCore/CMakeLists.txt index 9bb72f0c7d7675bdf17e434b60588357a24d9b4d..7148aa176a68b0a97809cb680c5a920e16429dcd 100644 --- a/DDCore/CMakeLists.txt +++ b/DDCore/CMakeLists.txt @@ -27,7 +27,7 @@ add_library(DD4hepPlugins SHARED ${plugin_sources}) target_link_libraries(DD4hepPlugins ${ROOT_LIBRARIES} ${XML_LIBRARIES} DD4hepCore Geom Reflex ${libraries}) #---Rootmap generation-------------------------------------------------------------- dd4hep_generate_rootmap(DD4hepPlugins) - +#dd4hep_install_library(DD4hepPlugins) #--- install target------------------------------------- @@ -40,5 +40,6 @@ install(TARGETS DD4hepCore DD4hepPlugins RUNTIME DESTINATION bin LIBRARY DESTINATION lib ) + # to do: add corresponding uninstall... #------------------------------------------------------- \ No newline at end of file diff --git a/DDExamples/AlignDet/CMakeLists.txt b/DDExamples/AlignDet/CMakeLists.txt index 0ba9efc6f8a881da379632d033a528cd9951f638..dc7b5ad4b8454f4a97185fe0f0770cde6494ae97 100644 --- a/DDExamples/AlignDet/CMakeLists.txt +++ b/DDExamples/AlignDet/CMakeLists.txt @@ -11,3 +11,12 @@ file(GLOB sources src/*.cpp) add_library(Aligntest SHARED ${sources}) target_link_libraries(Aligntest DD4hepCore ${ROOT_LIBRARIES} Rint Reflex) dd4hep_generate_rootmap(Aligntest) + +#--- install target------------------------------------- + +install(TARGETS Aligntest + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ) +# to do: add corresponding uninstall... +#------------------------------------------------------- \ No newline at end of file diff --git a/DDExamples/CLICSiD/CMakeLists.txt b/DDExamples/CLICSiD/CMakeLists.txt index 7095c6a737ce94083587a722635e48548c11045e..1341cc89bad78edcde18c16caa1b183b3ef4e9eb 100644 --- a/DDExamples/CLICSiD/CMakeLists.txt +++ b/DDExamples/CLICSiD/CMakeLists.txt @@ -10,3 +10,12 @@ include(DD4hep_XML_setup) add_library(CLICSiD SHARED ${sources}) target_link_libraries(CLICSiD DD4hepCore ${ROOT_LIBRARIES}) dd4hep_generate_rootmap(CLICSiD) + +#--- install target------------------------------------- + +install(TARGETS CLICSiD + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ) +# to do: add corresponding uninstall... +#------------------------------------------------------- \ No newline at end of file diff --git a/DDExamples/ILDExDet/CMakeLists.txt b/DDExamples/ILDExDet/CMakeLists.txt index e0e2899b667fca50ae906017348fa594e780e7ac..b232202740a4ff5dfb9f68a07b48b8c5a1ea719f 100644 --- a/DDExamples/ILDExDet/CMakeLists.txt +++ b/DDExamples/ILDExDet/CMakeLists.txt @@ -62,3 +62,12 @@ add_library(ILDEx SHARED ${sources}) target_link_libraries(ILDEx DD4hepCore ${LCIO_LIBRARIES}) #---Rootmap generation-------------------------------------------------------------- dd4hep_generate_rootmap(ILDEx) + +#--- install target------------------------------------- + +install(TARGETS ILDEx + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ) +# to do: add corresponding uninstall... +#------------------------------------------------------- \ No newline at end of file diff --git a/DDExamples/ILDExSimu/CMakeLists.txt b/DDExamples/ILDExSimu/CMakeLists.txt index 8820b078b41918a04f4da5ed6f13dcc90779faba..05836d38d83937cb8acfb2907e63bebc3798e6f5 100644 --- a/DDExamples/ILDExSimu/CMakeLists.txt +++ b/DDExamples/ILDExSimu/CMakeLists.txt @@ -22,4 +22,3 @@ include_directories( ${CMAKE_SOURCE_DIR}/DDCore/include file(GLOB sources src/*.cpp) add_executable(ILDExSimu ILDExSimu.cpp ${sources}) target_link_libraries(ILDExSimu DD4hepCore DD4hepG4 ILDEx ${Geant4_LIBRARIES} ${LCIO_LIBRARIES}) - diff --git a/DDG4/CMakeLists.txt b/DDG4/CMakeLists.txt index 35ea94cac658cd9a29c97b93967d409a0bab6058..47c2f2722ee138c70155fa79a01a9b5a0cbf5bf2 100644 --- a/DDG4/CMakeLists.txt +++ b/DDG4/CMakeLists.txt @@ -23,3 +23,16 @@ endif() add_library(DD4hepG4 SHARED ${sources}) target_link_libraries(DD4hepG4 DD4hepCore ${ROOT_LIBRARIES} Reflex ${Geant4_LIBRARIES}) dd4hep_generate_rootmap(DD4hepG4) + +#--- install target------------------------------------- + +install(DIRECTORY include/DDG4 + DESTINATION include + PATTERN ".svn" EXCLUDE ) + +install(TARGETS DD4hepG4 + RUNTIME DESTINATION bin + LIBRARY DESTINATION lib + ) +# to do: add corresponding uninstall... +#------------------------------------------------------- \ No newline at end of file diff --git a/cmake/DD4hep.cmake b/cmake/DD4hep.cmake index d013076ba3675564f4afe1f9d40966ace44916f2..dec0e2c55e5f0728a2875b1eebaf29ee1823cc73 100644 --- a/cmake/DD4hep.cmake +++ b/cmake/DD4hep.cmake @@ -13,6 +13,11 @@ function(dd4hep_generate_rootmap library) ${ROOT_genmap_CMD} -i ${libname} -o ${rootmapfile} DEPENDS ${library}) add_custom_target(${library}Rootmap ALL DEPENDS ${rootmapfile}) + + install(FILES ${LIBRARY_OUTPUT_PATH}/${rootmapfile} + DESTINATION lib + ) + # Notify the project level target #gaudi_merge_files_append(Rootmap ${library}Rootmap ${CMAKE_CURRENT_BINARY_DIR}/${library}.rootmap) endfunction() @@ -25,7 +30,11 @@ endfunction() #--------------------------------------------------------------------------------------------------- function(dd4hep_install_library library) set(installfile ${library}.install) - set(libname ${CMAKE_SHARED_MODULE_PREFIX}${library}${CMAKE_SHARED_MODULE_SUFFIX}) + + set(rootmapfile ${CMAKE_SHARED_MODULE_PREFIX}${library}.rootmap) + + set(libname ${CMAKE_SHARED_MODULE_PREFIX}${library}${CMAKE_SHARED_MODULE_SUFFIX}) + add_custom_command(OUTPUT ${rootmapfile} COMMAND echo ${library} ${LIBRARY_OUTPUT_DIR}