# Mac Plist Macros FUNCTION (GET_VERSION_PLIST PLISTFILE OUTVAR) SET (PVERSION "") IF (EXISTS ${PLISTFILE}) FILE (READ "${PLISTFILE}" info_plist) STRING (REGEX REPLACE "\n" "" info_plist "${info_plist}") STRING (REGEX MATCH "CFBundleShortVersionString[ \t]*([0-9\\.]*)" PLISTVERSION "${info_plist}") STRING (REGEX REPLACE "CFBundleShortVersionString[ \t]*([0-9\\.]*)" "\\1" PVERSION "${PLISTVERSION}") ENDIF (EXISTS ${PLISTFILE}) SET (${OUTVAR} ${PVERSION} PARENT_SCOPE) ENDFUNCTION (GET_VERSION_PLIST)