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
30 changes: 18 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,28 @@ install(FILES ${CMAKE_BINARY_DIR}/StreamConfig.cmake
DESTINATION ${CMAKE_INSTALL_CMAKEDIR}
)

add_subdirectory(framework)
option(ENABLE_FRAMEWORK "Build framework subdirectory" ON)
option(ENABLE_GO4ENGINE "Build go4engine subdirectory" ON)

if(Go4_FOUND)
add_subdirectory(go4engine)
if(ENABLE_FRAMEWORK)
add_subdirectory(framework)
endif()

if(ENABLE_GO4ENGINE AND Go4_FOUND)
add_subdirectory(go4engine)
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})
if(ENABLE_FRAMEWORK)
export(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE stream::
FILE ${PROJECT_NAME}Targets.cmake)

install(
EXPORT ${PROJECT_NAME}Targets
NAMESPACE stream::
DESTINATION ${CMAKE_INSTALL_CMAKEDIR})
endif()
3 changes: 3 additions & 0 deletions framework/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,8 @@ STREAM_LINK_LIBRARY(Stream
LIBRARIES ${stream_libs}
)

add_library(stream::Stream ALIAS Stream)

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

foreach(dir base dogma get4 hadaq mbs nx dabc)
Expand Down Expand Up @@ -175,4 +177,5 @@ if(ROOT_FOUND)
install(FILES ${CMAKE_BINARY_DIR}/lib/libStreamDict.rootmap ${CMAKE_BINARY_DIR}/lib/libStreamDict_rdict.pcm
DESTINATION ${CMAKE_INSTALL_LIBDIR})

add_library(stream::StreamDict ALIAS StreamDict)
endif()
6 changes: 5 additions & 1 deletion go4engine/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
include(${GO4_USE_FILE})

if(NOT TARGET stream::Stream)
find_package(Stream REQUIRED PATHS $ENV{STREAMSYS})
endif()

GO4_USER_ANALYSIS(
LINKDEF
LinkDef.h
Expand All @@ -11,7 +15,7 @@ GO4_USER_ANALYSIS(
TUserSource.cxx
TFirstStepProcessor.cxx
LIBRARIES
Stream StreamDict
stream::Stream stream::StreamDict
INCLUDE_DIRS
${CMAKE_SOURCE_DIR}/include
TARGET_DIR
Expand Down