Commit 1d6dc450 authored by Reuther, Sebastian's avatar Reuther, Sebastian
Browse files

modified zoltan makefile parser (cmake)

parent 5278c061
macro(parse_zoltan_makefile _FILE_ _TARGET_ _SCOPE_)
file(STRINGS ${_FILE_} ZOLTAN_MAKEFILE_LINE REGEX "ZOLTAN_EXTRA_LIBS")
# parse zoltan extra libs AND ld flags
file(STRINGS ${_FILE_} ZOLTAN_EXTRA_LIBS_LINE REGEX "ZOLTAN_EXTRA_LIBS")
file(STRINGS ${_FILE_} ZOLTAN_LDFLAGS_LINE REGEX "ZOLTAN_LDFLAGS")
get_filename_component(ZOLTAN_MAKEFILE_DIR "${ZOLTAN_MAKEFILE}" PATH CACHE)
string(STRIP "${ZOLTAN_MAKEFILE_LINE}" LINE)
if ("${LINE}" MATCHES "^ZOLTAN_EXTRA_LIBS[ ]*=[ ]*([a-zA-Z0-9_/. -]+)$")
string(STRIP "${ZOLTAN_EXTRA_LIBS_LINE}" ZOLTAN_EXTRA_LIBS_LINE)
string(STRIP "${ZOLTAN_LDFLAGS_LINE}" ZOLTAN_LDFLAGS_LINE)
if ("${ZOLTAN_EXTRA_LIBS_LINE}" MATCHES "^ZOLTAN_EXTRA_LIBS[ ]*=[ ]*([a-zA-Z0-9_/. -]+)*$")
string(REGEX REPLACE " " ";" ZOLTAN_EXTRA_LIBS_LIST "${CMAKE_MATCH_1}")
if ("${ZOLTAN_LDFLAGS_LINE}" MATCHES "^ZOLTAN_LDFLAGS[ ]*=[ ]*([a-zA-Z0-9_/. -]+)*$")
string(REGEX REPLACE " " ";" ZOLTAN_LDFLAGS_LIST "${CMAKE_MATCH_1}")
set(COMBINED_LIST ${ZOLTAN_LDFLAGS_LIST} ${ZOLTAN_EXTRA_LIBS_LIST})
set(ZOLTAN_LIB_DIRS "")
foreach(LIBS ${ZOLTAN_EXTRA_LIBS_LIST})
foreach(LIBS ${COMBINED_LIST})
string(STRIP "${LIBS}" LIBS)
string(SUBSTRING "${LIBS}" 0 2 LIB_PREFIX)
string(SUBSTRING "${LIBS}" 2 -1 LIB_NAME)
......@@ -27,4 +33,6 @@ macro(parse_zoltan_makefile _FILE_ _TARGET_ _SCOPE_)
endif ()
endforeach (LIBS)
endif()
endif()
endmacro(parse_zoltan_makefile)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment