[Paraview-developers] cmake add_custom_command problem

Paul Edwards paul.m.edwards at gmail.com
Wed Feb 26 06:31:38 EST 2014


Hi Hanumanth,

The "python --version" is writing out to stderr rather than stdout.

Regards,
Paul


On 26 February 2014 10:47, Pandu Tech <pandu4tech at gmail.com> wrote:

> Hi,
>
> I am trying to use add_custom_command in my CMakeLists.txt, but it is not
> working properly.
>
> Here is the code:
> @@@@
> CMAKE_MINIMUM_REQUIRED(VERSION 2.8)
>
> find_program(PYTHON_EXECUTABLE python)
> find_program(CMAKE_EXECUTABLE cmake)
>
> set(CMAKE_INSTALL_PREFIX "/home/Documents/testCMakeBuild")
>
> SET(Output_file1 "cmakeVersion.txt")
> SET(Output_file2 "pythonVersion.txt")
>
> ADD_CUSTOM_COMMAND(
>     OUTPUT ${CMAKE_INSTALL_PREFIX}/${Output_file1}
>     COMMAND ${CMAKE_EXECUTABLE} --version >
> ${CMAKE_INSTALL_PREFIX}/${Output_file1})
>
> ADD_CUSTOM_TARGET(cmakeInternal ALL DEPENDS
> ${CMAKE_INSTALL_PREFIX}/${Output_file1})
>
>
> ADD_CUSTOM_COMMAND(
>     OUTPUT ${CMAKE_INSTALL_PREFIX}/${Output_file2}
>     COMMAND ${PYTHON_EXECUTABLE} --version >
> ${CMAKE_INSTALL_PREFIX}/${Output_file2})
>
> ADD_CUSTOM_TARGET(pythonInternal ALL DEPENDS
> ${CMAKE_INSTALL_PREFIX}/${Output_file2})
>
> @@@@@@@@@
>
> 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.
>
> Please share your views.
>
> Appreciate your help in this regard.
>
> Thanks,
> Pandu.
>
> _______________________________________________
> Paraview-developers mailing list
> Paraview-developers at paraview.org
> http://public.kitware.com/mailman/listinfo/paraview-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview-developers/attachments/20140226/f1d6ecdc/attachment.html>


More information about the Paraview-developers mailing list