[cmake-developers] [Review request] Topic FindPkgConfig_Extend-PKG_CONFIG_PATH

Daniele E. Domenichelli daniele.domenichelli at gmail.com
Tue Mar 11 10:43:14 EDT 2014


On 11/03/14 14:51, Brad King wrote:
> Also the hunks:
> 
> +        if(UNIX)
> +          string(REPLACE "\\:" ";" _path "${_path}")
> +        endif()
> 
> should not be necessary because TO_CMAKE_PATH already does that.
> It looks like TO_NATIVE_PATH does not do the reveres though so that
> explicit replacement is still needed.


Done. I also added an extra commit to remove empty values from the list.
I'll add the unit tests as soon as possible.

It is a quite common use case to get and set "path" environment
variables and taking care of TO_CMAKE_PATH/TO_NATIVE_PATH windows/linux
every time is a bit annoying... It would be really nice to have an easy
way to do this replacement in both ways that automatically takes care of
unix and windows
Perhaps having a syntax like this:

  get: $ENV:PATH{VAR}
  set: ENV:PATH{VAR}

That automatically convert to local/native path and replaces the ";" and
":" as necessary on the system.

Do you think this is doable?


Cheers,
 Daniele



More information about the cmake-developers mailing list