Skip to content

Commit 2bb4413

Browse files
awegrzynkostorr
authored andcommitted
Fix issue with transitive dependency requiring different Boost components
1 parent c86dc38 commit 2bb4413

File tree

2 files changed

+9
-12
lines changed

2 files changed

+9
-12
lines changed

CMakeLists.txt

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ find_package(PDA)
8181
# Module, library and executable definition
8282
####################################
8383

84-
set(SRCS
84+
add_library(ReadoutCard SHARED
8585
#src/CardConfigurator.cxx
8686
src/CardType.cxx
8787
src/Factory/ChannelFactory.cxx
@@ -106,13 +106,11 @@ set(SRCS
106106
src/Utilities/Hugetlbfs.cxx
107107
src/Utilities/MemoryMaps.cxx
108108
src/Utilities/Numa.cxx
109-
src/CommandLineUtilities/Common.cxx
110-
src/CommandLineUtilities/Options.cxx
111109
)
112110

113111
# Add sources requiring PDA
114112
if(PDA_FOUND)
115-
list(APPEND SRCS
113+
target_sources(ReadoutCard PRIVATE
116114
src/DmaChannelPdaBase.cxx
117115
src/BarInterfaceBase.cxx
118116
src/CardConfigurator.cxx
@@ -135,8 +133,6 @@ if(PDA_FOUND)
135133
)
136134
endif()
137135

138-
# Create library
139-
add_library(ReadoutCard SHARED ${SRCS})
140136
target_include_directories(ReadoutCard
141137
PUBLIC
142138
$<INSTALL_INTERFACE:include>
@@ -232,7 +228,7 @@ math(EXPR count "${count}-1")
232228
foreach(i RANGE ${count})
233229
list(GET EXE_SRCS ${i} src)
234230
list(GET EXE_NAMES ${i} name)
235-
add_executable(${name} src/CommandLineUtilities/${src})
231+
add_executable(${name} src/CommandLineUtilities/${src} src/CommandLineUtilities/Options.cxx src/CommandLineUtilities/Common.cxx)
236232
target_include_directories(${name}
237233
PRIVATE
238234
${CMAKE_CURRENT_SOURCE_DIR}/src
@@ -273,7 +269,7 @@ foreach (test ${TEST_SRCS})
273269
get_filename_component(test_name ${test} NAME)
274270
string(REGEX REPLACE ".cxx" "" test_name ${test_name})
275271

276-
add_executable(${test_name} ${test})
272+
add_executable(${test_name} ${test} src/CommandLineUtilities/Options.cxx)
277273
target_include_directories(${test_name}
278274
PRIVATE
279275
${CMAKE_CURRENT_SOURCE_DIR}/src

cmake/ReadoutCardConfig.cmake.in

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,17 @@ if(NOT APPLE)
1111
find_dependency(Python2 2.7 COMPONENTS Development REQUIRED)
1212
endif()
1313

14-
find_dependency(Boost
14+
find_dependency(Common CONFIG HINTS ${Common_CMAKE_DIR})
15+
find_dependency(InfoLogger CONFIG HINTS ${InfoLogger_CMAKE_DIR})
16+
17+
# find package must be used as Common already looks for boost and set Boost_FOUND
18+
find_package(Boost QUIET
1519
COMPONENTS
16-
program_options
1720
system
1821
filesystem
1922
${boost_python_component}
2023
REQUIRED
2124
)
22-
find_dependency(Common CONFIG REQUIRED HINTS ${Common_CMAKE_DIR})
23-
find_dependency(InfoLogger CONFIG REQUIRED HINTS ${InfoLogger_CMAKE_DIR})
2425

2526
if(NOT TARGET AliceO2::ReadoutCard)
2627
include("${ReadoutCard_CMAKE_DIR}/ReadoutCardTargets.cmake")

0 commit comments

Comments
 (0)