mirror of
https://github.com/cemu-project/vcpkg.git
synced 2025-02-22 10:37:10 +01:00
handle multiline arguments in makefile correctly
This commit is contained in:
parent
661f329e03
commit
f99b18d573
@ -9,7 +9,8 @@ function(extract_from_makefile PATTERN RETURN FILEPATH)
|
|||||||
string(REGEX MATCH "${PATTERN}" CONTENTS "${MAKEFILE_CONTENT}")
|
string(REGEX MATCH "${PATTERN}" CONTENTS "${MAKEFILE_CONTENT}")
|
||||||
set(CONTENTS ${CMAKE_MATCH_1})
|
set(CONTENTS ${CMAKE_MATCH_1})
|
||||||
# Split string into list
|
# 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 "")
|
if("${CONTENTS}" STREQUAL "")
|
||||||
message(AUTHOR_WARNING "No match for \"${PATTERN}\" found in file ${FILEPATH}")
|
message(AUTHOR_WARNING "No match for \"${PATTERN}\" found in file ${FILEPATH}")
|
||||||
endif()
|
endif()
|
||||||
@ -19,8 +20,8 @@ endfunction(extract_from_makefile)
|
|||||||
|
|
||||||
# Function to extract C sources from makefile
|
# Function to extract C sources from makefile
|
||||||
function(extract_sources SUBFOLDER ALLSOURCES)
|
function(extract_sources SUBFOLDER ALLSOURCES)
|
||||||
extract_from_makefile("lib[a-zA-Z1-9_]*_la_SOURCES[ \t]*=[ \t]*([^\n]*)" SOURCEFILES "${SUBFOLDER}/Makefile.am")
|
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
|
# Add the folder in front of the file names
|
||||||
string(REGEX REPLACE "([^;]+)" "${SUBFOLDER}/\\1" SOURCEFILES "${SOURCEFILES}")
|
string(REGEX REPLACE "([^;]+)" "${SUBFOLDER}/\\1" SOURCEFILES "${SOURCEFILES}")
|
||||||
# Return
|
# Return
|
||||||
set(${ALLSOURCES} ${${ALLSOURCES}} ${SOURCEFILES} PARENT_SCOPE)
|
set(${ALLSOURCES} ${${ALLSOURCES}} ${SOURCEFILES} PARENT_SCOPE)
|
||||||
@ -28,7 +29,7 @@ endfunction(extract_sources)
|
|||||||
|
|
||||||
set(SOURCES)
|
set(SOURCES)
|
||||||
set(CBLAS_SOURCES)
|
set(CBLAS_SOURCES)
|
||||||
extract_from_makefile("SUBDIRS = ([^\n]*)" FOLDERS "./Makefile.am")
|
extract_from_makefile("SUBDIRS = (((\\\\\n)?[^\n])*)" FOLDERS "./Makefile.am")
|
||||||
extract_sources("." SOURCES)
|
extract_sources("." SOURCES)
|
||||||
foreach(DIR IN LISTS FOLDERS)
|
foreach(DIR IN LISTS FOLDERS)
|
||||||
if("${DIR}" STREQUAL "cblas")
|
if("${DIR}" STREQUAL "cblas")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user