diff --git a/CMakeLists.txt b/CMakeLists.txt index 2257f8e..7a125f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,11 +68,14 @@ if(VOID_ENABLED_MODULES) list(APPEND _void_selected ${_void_module}) if(EXISTS "${_void_module_file}") file(READ "${_void_module_file}" _void_text) - # The words after INTERNAL_DEPS up to the next keyword or ')'. + # Drop comments so prose between keywords is never parsed as a + # dependency name, then read the words after INTERNAL_DEPS up to + # the next keyword or ')'. + string(REGEX REPLACE "#[^\n]*" "" _void_text "${_void_text}") if(_void_text MATCHES "INTERNAL_DEPS([^)]*)") separate_arguments(_void_words UNIX_COMMAND "${CMAKE_MATCH_1}") foreach(_void_word IN LISTS _void_words) - if(_void_word MATCHES "^(INTERNAL_DEPS|EXTERNAL_DEPS|OPTIONAL_DEPS|DEPS_WIN32|DEPS_UNIX|OPTIONS_WIN32|OPTIONS_UNIX|EXTRA_HEADERS|EXCLUDE_HEADERS)$") + if(_void_word MATCHES "^(INTERNAL_DEPS|EXTERNAL_DEPS|OPTIONAL_DEPS|DEPS_WIN32|DEPS_UNIX|OPTIONS_WIN32|OPTIONS_UNIX|EXTRA_HEADERS|EXCLUDE_HEADERS|EXCLUDE_SOURCES_WIN32|EXCLUDE_SOURCES_UNIX)$") break() endif() list(APPEND _void_pending ${_void_word})