<div dir="ltr"><div>Hi Hanumanth,<br></div><div><br></div>The "python --version" is writing out to stderr rather than stdout.<div><br></div><div>Regards,<br>Paul</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
On 26 February 2014 10:47, Pandu Tech <span dir="ltr"><<a href="mailto:pandu4tech@gmail.com" target="_blank">pandu4tech@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Hi,<div><br></div><div>I am trying to use add_custom_command in my CMakeLists.txt, but it is not working properly.</div><div><br></div><div>Here is the code:</div><div>@@@@</div><div><div>CMAKE_MINIMUM_REQUIRED(VERSION 2.8)</div>
<div><br></div><div>find_program(PYTHON_EXECUTABLE python)</div><div>find_program(CMAKE_EXECUTABLE cmake)</div><div><br></div><div>set(CMAKE_INSTALL_PREFIX "/home/Documents/testCMakeBuild")</div><div><br></div>
<div>
SET(Output_file1 "cmakeVersion.txt")</div><div>SET(Output_file2 "pythonVersion.txt")</div><div><br></div><div>ADD_CUSTOM_COMMAND(</div><div> OUTPUT ${CMAKE_INSTALL_PREFIX}/${Output_file1}</div><div>
COMMAND ${CMAKE_EXECUTABLE} --version > ${CMAKE_INSTALL_PREFIX}/${Output_file1})</div><div> </div><div>ADD_CUSTOM_TARGET(cmakeInternal ALL DEPENDS ${CMAKE_INSTALL_PREFIX}/${Output_file1})</div><div><br></div><div>
<br>
</div><div>ADD_CUSTOM_COMMAND(</div><div> OUTPUT ${CMAKE_INSTALL_PREFIX}/${Output_file2}</div><div> COMMAND ${PYTHON_EXECUTABLE} --version > ${CMAKE_INSTALL_PREFIX}/${Output_file2})</div><div> </div><div>ADD_CUSTOM_TARGET(pythonInternal ALL DEPENDS ${CMAKE_INSTALL_PREFIX}/${Output_file2})</div>
</div><div><br></div><div>@@@@@@@@@</div><div><br></div><div>In case of cmakeVersion.txt, o/p of cmake --version is written to cmakeVersion.txt and nothing is printed to console, but in case of python just o/p of python --version is written to console. pythonVersion.txt is created but file is empty.</div>
<div><br></div><div>Please share your views.</div><div><br></div><div>Appreciate your help in this regard.</div><div><br></div><div>Thanks,</div><div>Pandu.</div></div>
<br>_______________________________________________<br>
Paraview-developers mailing list<br>
<a href="mailto:Paraview-developers@paraview.org">Paraview-developers@paraview.org</a><br>
<a href="http://public.kitware.com/mailman/listinfo/paraview-developers" target="_blank">http://public.kitware.com/mailman/listinfo/paraview-developers</a><br>
<br></blockquote></div><br></div>