aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ports/gsl/CMakeLists.txt9
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")