Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 22 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,6 @@ include(GNUInstallDirs)
set(CMAKE_INSTALL_CMAKEDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME})
set(STREAM_INSTALL_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/stream)

export(
TARGETS ${PROJECT_TARGETS}
NAMESPACE stream::
FILE ${PROJECT_NAME}Targets.cmake)

install(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE stream::
DESTINATION ${CMAKE_INSTALL_CMAKEDIR})

#--- Load some basic macros ---
include(StreamMacros)

Expand Down Expand Up @@ -53,8 +43,13 @@ else()
set(_ldvname_ LD_LIBRARY_PATH)
endif()

configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/StreamConfig.cmake.in
${CMAKE_BINARY_DIR}/StreamConfig.cmake COPYONLY)
include(CMakePackageConfigHelpers)

configure_package_config_file(
${CMAKE_SOURCE_DIR}/cmake/scripts/StreamConfig.cmake.in
${CMAKE_BINARY_DIR}/StreamConfig.cmake
INSTALL_DESTINATION lib/cmake/Stream
)

set(_streamsys_ ${CMAKE_BINARY_DIR})
set(_streaminc_ ${CMAKE_BINARY_DIR}/include)
Expand All @@ -73,6 +68,10 @@ configure_file(${CMAKE_SOURCE_DIR}/cmake/scripts/streamlogin.in
install(PROGRAMS ${PROJECT_BINARY_DIR}/macros/streamlogin
DESTINATION ${CMAKE_INSTALL_BINDIR})

install(FILES ${CMAKE_BINARY_DIR}/StreamConfig.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}
)

add_subdirectory(framework)

if(Go4_FOUND)
Expand All @@ -81,3 +80,14 @@ endif()

get_property(__allHeaders GLOBAL PROPERTY STREAM_HEADER_TARGETS)
add_custom_target(move_headers ALL DEPENDS ${__allHeaders})

export(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE stream::
FILE ${PROJECT_NAME}Targets.cmake)

install(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE stream::
DESTINATION ${CMAKE_INSTALL_CMAKEDIR})

6 changes: 5 additions & 1 deletion cmake/modules/StreamMacros.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,11 @@ function(STREAM_LINK_LIBRARY libname)

# add_dependencies(${libname} move_headers ${ARG_DEPENDENCIES})

target_include_directories(${libname} PRIVATE ${CMAKE_SOURCE_DIR}/include)
target_include_directories(${libname}
PUBLIC
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:${STREAM_INSTALL_INCLUDEDIR}>
)

install(
TARGETS ${libname}
Expand Down
16 changes: 3 additions & 13 deletions cmake/scripts/StreamConfig.cmake.in
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
# Stream CMake Configuration File for External Projects
@PACKAGE_INIT@

# Stream configured for use from the build tree - absolute paths are used.
set(STREAM_INCLUDE_DIR ${CMAKE_CURRENT_LIST_DIR}/include)
include(CMakeFindDependencyMacro)

# Stream configured for use from the build tree - absolute paths are used.
set(STREAM_LIBRARY_DIR ${CMAKE_CURRENT_LIST_DIR}/lib)

# search for stream libraries
foreach(_cpt Stream)
find_library(${_cpt}_LIBRARY ${_cpt} HINTS ${STREAM_LIBRARY_DIR})
if(${_cpt}_LIBRARY)
mark_as_advanced(${_cpt}_LIBRARY)
endif()
endforeach()
include("${CMAKE_CURRENT_LIST_DIR}/StreamTargets.cmake")
2 changes: 1 addition & 1 deletion framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ STREAM_LINK_LIBRARY(Stream

# ================== Install Stream headers ==========

foreach(dir base dogma get4 hadaq mbs nx)
foreach(dir base dogma get4 hadaq mbs nx dabc)
install(DIRECTORY ${PROJECT_SOURCE_DIR}/include/${dir}
DESTINATION ${STREAM_INSTALL_INCLUDEDIR})
endforeach()
Expand Down
3 changes: 3 additions & 0 deletions go4engine/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,6 @@ install(

install(FILES ${CMAKE_BINARY_DIR}/lib/libGo4UserAnalysis.rootmap ${CMAKE_BINARY_DIR}/lib/libGo4UserAnalysis_rdict.pcm
DESTINATION ${CMAKE_INSTALL_LIBDIR})

install(FILES TStreamEvent.h TUserSource.h TFirstStepProcessor.h
DESTINATION ${STREAM_INSTALL_INCLUDEDIR})