MacPlistMacros.cmake 572 B

12345678910111213
  1. # Mac Plist Macros
  2. FUNCTION (GET_VERSION_PLIST PLISTFILE OUTVAR)
  3. SET (PVERSION "")
  4. IF (EXISTS ${PLISTFILE})
  5. FILE (READ "${PLISTFILE}" info_plist)
  6. STRING (REGEX REPLACE "\n" "" info_plist "${info_plist}")
  7. STRING (REGEX MATCH "<key>CFBundleShortVersionString</key>[ \t]*<string>([0-9\\.]*)</string>" PLISTVERSION "${info_plist}")
  8. STRING (REGEX REPLACE "<key>CFBundleShortVersionString</key>[ \t]*<string>([0-9\\.]*)</string>" "\\1" PVERSION "${PLISTVERSION}")
  9. ENDIF (EXISTS ${PLISTFILE})
  10. SET (${OUTVAR} ${PVERSION} PARENT_SCOPE)
  11. ENDFUNCTION (GET_VERSION_PLIST)