Make the cmake flags parsing in packagemetadata more robust
Summary
In packagemetadata the cmake flags coming from multiple sources are collected and stored in a dict, for later usage in the cmake generators. In the extraction of the cmake flags, this MR improves the interpretation of flags, by following exactly cmakes definition of a cache entry:
-D <var>:<type>=<value>, -D <var>=<value>
Create or update a CMake CACHE entry.
When CMake is first run in an empty build tree, it creates a CMakeCache.txt file and populates it with customizable settings for the project. This option may be used to specify a setting that takes priority over the
project's default value. The option may be repeated for as many CACHE entries as desired.
If the :<type> portion is given it must be one of the types specified by the set() command documentation for its CACHE signature. If the :<type> portion is omitted the entry will be created with no type if it does not
exist with a type already. If a command in the project sets the type to PATH or FILEPATH then the <value> will be converted to an absolute path.
This option may also be given as a single argument: -D<var>:<type>=<value> or -D<var>=<value>.