Skip to content

Commit 613c0d5

Browse files
committed
Error out if no included libraries were found
1 parent 7795bbe commit 613c0d5

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

include/BoostRoot.cmake

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,16 +244,23 @@ endmacro()
244244
file(GLOB __boost_libraries RELATIVE "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/*/CMakeLists.txt" "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/numeric/*/CMakeLists.txt")
245245

246246
# Check for mistakes in BOOST_INCLUDE_LIBRARIES
247+
if(BOOST_INCLUDE_LIBRARIES)
248+
set(__boost_any_library_found OFF)
249+
foreach(__boost_included_lib IN LISTS BOOST_INCLUDE_LIBRARIES)
247250

248-
foreach(__boost_included_lib IN LISTS BOOST_INCLUDE_LIBRARIES)
251+
if(NOT "${__boost_included_lib}/CMakeLists.txt" IN_LIST __boost_libraries)
249252

250-
if(NOT "${__boost_included_lib}/CMakeLists.txt" IN_LIST __boost_libraries)
253+
message(WARNING "Library '${__boost_included_lib}' given in BOOST_INCLUDE_LIBRARIES has not been found.")
251254

252-
message(WARNING "Library '${__boost_included_lib}' given in BOOST_INCLUDE_LIBRARIES has not been found.")
255+
else()
256+
set(__boost_any_library_found ON)
257+
endif()
253258

259+
endforeach()
260+
if(NOT __boost_any_library_found)
261+
message(FATAL_ERROR "None of the libraries given in BOOST_INCLUDE_LIBRARIES has been found so no libraries would be build. Verify BOOST_INCLUDE_LIBRARIES (${BOOST_INCLUDE_LIBRARIES})")
254262
endif()
255-
256-
endforeach()
263+
endif()
257264

258265
# Scan for dependencies
259266

0 commit comments

Comments
 (0)