From 8d99684e85d588db22f58d1b93449094cf9cd69e Mon Sep 17 00:00:00 2001 From: Alexander Grund Date: Thu, 11 Sep 2025 18:23:08 +0200 Subject: [PATCH] Add more special cases for library names Also handle the prefix-case commonly --- include/BoostRoot.cmake | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/include/BoostRoot.cmake b/include/BoostRoot.cmake index 150accf..e35af2c 100644 --- a/include/BoostRoot.cmake +++ b/include/BoostRoot.cmake @@ -199,6 +199,8 @@ endfunction() function(__boost_scan_dependencies lib var sub_folder) + # Libraries that define at least one library with a name like "_" + set(prefix_names "asio" "dll" "fiber" "log" "regex" "stacktrace") set(result "") set(cml_files "${BOOST_SUPERPROJECT_SOURCE_DIR}/libs/${lib}") @@ -222,14 +224,27 @@ function(__boost_scan_dependencies lib var sub_folder) foreach(dep IN LISTS libs) string(REGEX REPLACE "^Boost::" "" dep ${dep}) + if(dep STREQUAL "headers" OR dep STREQUAL "boost" OR dep MATCHES "linking") + continue() + endif() if(dep MATCHES "unit_test_framework|prg_exec_monitor|test_exec_monitor") set(dep "test") - elseif(dep MATCHES "^asio") - set(dep "asio") + elseif(dep STREQUAL "numpy") + set(dep "python") + elseif(dep MATCHES "serialization") + set(dep "serialization") else() string(REGEX REPLACE "^numeric_" "numeric/" dep ${dep}) + foreach(prefix IN LISTS prefix_names) + if(dep MATCHES "^${prefix}_") + set(dep ${prefix}) + break() + endif() + endforeach() + endif() + if(NOT dep STREQUAL lib) + list(APPEND result ${dep}) endif() - list(APPEND result ${dep}) endforeach() endif() @@ -238,6 +253,7 @@ function(__boost_scan_dependencies lib var sub_folder) endforeach() + list(REMOVE_DUPLICATES result) set(${var} ${result} PARENT_SCOPE) endfunction()