Therefore the question, if there is a single place where
all the slashes could be replaced by backslashes before we write
them down to the ninja file.


All of that is done in the cmLocalGenerator for the NMake and Jom
generators that use windows paths:


    enum RelativeRoot { NONE, FULL, HOME, START, HOME_OUTPUT, START_OUTPUT };
    enum OutputFormat { UNCHANGED, MAKEFILE, SHELL, RESPONSE };
    std::string ConvertToOutputFormat(const char* source, OutputFormat
output);
    std::string Convert(const char* remote, RelativeRoot local,
                        OutputFormat output = UNCHANGED,
                        bool optional = false);
    std::string Convert(RelativeRoot remote, const char* local,
                        OutputFormat output = UNCHANGED,
                        bool optional = false);


So, you want to make sure Convert is used, and it should do the right
thing.  That eventually calls:


std::string cmSystemTools::ConvertToOutputPath(const char* path)

Which will use windows paths, unless s_ForceUnixPaths is set (used by
unix makefile generator on windows.)


OK, thanks. I already noticed the usage of OutputFormat::SHELL.
Then I have to extend cmLocalGenerator by a Ninja case. It will be
similar to NMake but additionally replaces colons by '$:'.

Should I add kwsysSystem_Shell_Flag_Ninja in System.h?

And isn't there some code which then should be moved into cmLocalGenerator,
maybe EncodeIdent?

Peter


--

Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to