diff --git a/CMakeLists.txt b/CMakeLists.txt index 24128218..3d6f635f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -567,15 +567,15 @@ foreach (man ${mans}) # defined in that page. Defined means listed in a line ".B " # between lines ".SH NAME" and ".SH LIBRARY". Ignore terminating "," # or spaces in .B line. - file(STRINGS ${man} manpage REGEX "^.(SH|B) ") + file(STRINGS ${man} manpage REGEX "^\\.(SH +NAME|SH +LIBRARY|B )") set(in_list 0) foreach (line ${manpage}) - if ("${line}" STREQUAL ".SH NAME") + if ("${line}" MATCHES "^\\.SH +NAME") set(in_list 1) - elseif ("${line}" STREQUAL ".SH LIBRARY") + elseif ("${line}" MATCHES "^\\.SH +LIBRARY") set(in_list 0) elseif (${in_list}) - string(REGEX REPLACE ".B *([^ ,]+).*" "\\1" alt "${line}") + string(REGEX REPLACE ".B +([^ ,]+).*" "\\1" alt "${line}") configure_file(${man} man3/${alt}.3 @ONLY) endif () endforeach()