These are chat archives for inbilla/CMake

25th
Aug 2015
Packadal
@packadal
Aug 25 2015 07:17
Hey, I opened a MR with my corrections
I did not fix the escaping issue
but I have something towards it
still not working though
my work project does not build though because of another problem with RC files
Conflicting objects found:
File A: c:/src/foo.rc
File A: c:/src/foo.cpp
Both compile to c:/build/foo.obj
although I got some help on the CMake irc with the separation of command from args
the correct way would be something along the lines of
        for(unsigned int i = 0; i < ccg.GetNumberOfCommands(); ++i)
        {
            context.fc.WriteVariable("ExecExecutable", Quote(ccg.GetCommand(i)));

            std::string args;
            ccg.AppendArguments(i, args);
            cmSystemTools::ReplaceString(args, "$", "^$");
            context.fc.WriteVariable("ExecArguments", Quote(args));
        }
Packadal
@packadal
Aug 25 2015 07:22
but for some reason I can't fathom this does not work when running the tests
the following rule is being created :
Exec('TDocument-CustomCommand-Debug-2-doc1.txt.rule')
{
.ExecExecutable = 'C:/src/build/cmake-fbuild/bin/Release/cmake.exe'
.ExecArguments = ' -E echo "Example Document Target" > doc1.txt'
.ExecInput =
{
'doc1.tex'
}
.ExecOutput = 'C:/src/build/cmake-fbuild/Tests/CustomCommand/doc1.txt'
}
but it does not create 'doc1.txt'
I'm guessing something is wrong with the way I pass the args
Joshua Green
@inbilla
Aug 25 2015 11:55
I imagine its a working directory issue?
Possibly it IS creating doc1.txt, but not in the location you expect...
interesting, good information...
The "for number of commands" side of the above description doesn't quite work though....
still need to have one command...
but extracting the first exe off the front like that could work
Packadal
@packadal
Aug 25 2015 12:28
well I tried to force the working dir , but it did not create the file
Joshua Green
@inbilla
Aug 25 2015 12:29
strange
Packadal
@packadal
Aug 25 2015 12:29
yeah, I don't know what's happening, and fastbuild kinda lacks a 'verbose' mode
the showcmds options is quite not enough for debug
Joshua Green
@inbilla
Aug 25 2015 12:37
not enough you think?
what more should be in there?
Packadal
@packadal
Aug 25 2015 12:38
well it seems it's trying to spawn new processes when doing ExecCommand
and it just show me the executable anme and the params
which I guess is not exactly what it does in the background
Joshua Green
@inbilla
Aug 25 2015 12:40
does just this....
Packadal
@packadal
Aug 25 2015 12:40
strange then
Joshua Green
@inbilla
Aug 25 2015 12:40
how did you paste code in here?
(new to this chat)
Packadal
@packadal
Aug 25 2015 12:40
I just copy/pasted from my IDE and i think gitter did all the magic
Joshua Green
@inbilla
Aug 25 2015 12:40
bool spawnOK = p.Spawn( m_Executable->GetName().Get(),
fullArgs.Get(),
workingDir,
FBuild::Get().GetEnvironmentString() );
thats what it does...
pretty straight forward...
Packadal
@packadal
Aug 25 2015 12:41
hmmm
I don't get what's not working then
Joshua Green
@inbilla
Aug 25 2015 12:41
fullArgs is the expanded version of the arguments (using %1 etc)
interesting...
Joshua Green
@inbilla
Aug 25 2015 12:47
I need to head off, I'm almost finished with another bit of code needed in fastbuild, I can take a look closer at the cmake side soon
thanks for getting into the code! very helpful!
Packadal
@packadal
Aug 25 2015 12:48
don't mention it
I'll try and fix my MR a bit this afternoon
Packadal
@packadal
Aug 25 2015 13:32
I look back at the failing test, and I'm guessing the way fastbuild runs the command does not support output redirection
which is the problem with the CMake test
this is the problem this test runs into
Joshua Green
@inbilla
Aug 25 2015 23:34
That makes sense. In which case, we need to look into writing out batch/sh scripts instead and call those I guess...
I can't imagine we want fastbuild to attempt to decode the redirection arguments of a command line.