diff options
| author | Alexander Neumann <Alexander.Neumann@hamburg.de> | 2020-04-09 12:41:16 +0200 |
|---|---|---|
| committer | Alexander Neumann <Alexander.Neumann@hamburg.de> | 2020-04-09 12:41:16 +0200 |
| commit | f99b18d573f0966e9c432a83c76ce2a20485dcd4 (patch) | |
| tree | b1a3116343000d0245b9e027d3882cc2a46d4549 | |
| parent | 661f329e03056967b49ca448354df3a21f1ef06c (diff) | |
| download | vcpkg-f99b18d573f0966e9c432a83c76ce2a20485dcd4.tar.gz vcpkg-f99b18d573f0966e9c432a83c76ce2a20485dcd4.zip | |
handle multiline arguments in makefile correctly
| -rw-r--r-- | ports/gsl/CMakeLists.txt | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ports/gsl/CMakeLists.txt b/ports/gsl/CMakeLists.txt index 0027fe291..2d37f37e9 100644 --- a/ports/gsl/CMakeLists.txt +++ b/ports/gsl/CMakeLists.txt @@ -9,7 +9,8 @@ function(extract_from_makefile PATTERN RETURN FILEPATH) string(REGEX MATCH "${PATTERN}" CONTENTS "${MAKEFILE_CONTENT}") set(CONTENTS ${CMAKE_MATCH_1}) # Split string into list - string(REGEX REPLACE "[ \t]+" ";" CONTENTS "${CONTENTS}") + string(REGEX REPLACE "([\t ]+(\\\\\n)?)+" ";" CONTENTS "${CONTENTS}") + string(REGEX REPLACE "[\t ]*\\\\\n[\t ]*;" "" CONTENTS "${CONTENTS}") if("${CONTENTS}" STREQUAL "") message(AUTHOR_WARNING "No match for \"${PATTERN}\" found in file ${FILEPATH}") endif() @@ -19,8 +20,8 @@ endfunction(extract_from_makefile) # Function to extract C sources from makefile function(extract_sources SUBFOLDER ALLSOURCES) - extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*([^\n]*)" SOURCEFILES "${SUBFOLDER}/Makefile.am") - # Add the folder in front of the file names + extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*(((\\\\\n)?[^\n])*)" SOURCEFILES "${SUBFOLDER}/Makefile.am") + # Add the folder in front of the file names string(REGEX REPLACE "([^;]+)" "${SUBFOLDER}/\\1" SOURCEFILES "${SOURCEFILES}") # Return set(${ALLSOURCES} ${${ALLSOURCES}} ${SOURCEFILES} PARENT_SCOPE) @@ -28,7 +29,7 @@ endfunction(extract_sources) set(SOURCES) set(CBLAS_SOURCES) -extract_from_makefile("SUBDIRS = ([^\n]*)" FOLDERS "./Makefile.am") +extract_from_makefile("SUBDIRS = (((\\\\\n)?[^\n])*)" FOLDERS "./Makefile.am") extract_sources("." SOURCES) foreach(DIR IN LISTS FOLDERS) if("${DIR}" STREQUAL "cblas") |
