[CMake] Best way to copy Python test file to binary directory?

Jean-Christophe Fillion-Robin jchris.fillionr at kitware.com
Tue Oct 29 17:00:26 EDT 2013


Hi James,

Within CTK we implemented a macro allowing to easily copy and compile files
to the binary directory.
See
https://github.com/commontk/CTK/blob/master/CMake/ctkMacroCompilePythonScript.cmake

Hth
Jc


On Tue, Oct 29, 2013 at 4:50 PM, James Amundson <amundson at fnal.gov> wrote:

> Hi,
>
> I have a mixed C++/Python project. The test suite includes executing
> python files through a wrapper script. For example,
>
> add_test(test_parallel_utils_**py ${SYNERGIA2_BINARY_DIR}/**synergia-local
> -c "import nose; nose.main()"
>     test_parallel_utils.py)
>
>
> One detail is important: the python file must exist in the binary
> directory. For reasons beyond my control, simply specifying the source
> directory as the location for test_parallel_utils.py won't work. For
> in-source builds, of course there is no problem -- the python file is
> already there.
>
> What is the best way to get the python file into the binary directory for
> out-of-source builds?
>
> Thanks for any advice,
> Jim Amundson
> --
>
> Powered by www.kitware.com
>
> Please keep messages on-topic and check the CMake FAQ at:
> http://www.cmake.org/Wiki/**CMake_FAQ<http://www.cmake.org/Wiki/CMake_FAQ>
>
> Kitware offers various services to support the CMake community. For more
> information on each offering, please visit:
>
> CMake Support: http://cmake.org/cmake/help/**support.html<http://cmake.org/cmake/help/support.html>
> CMake Consulting: http://cmake.org/cmake/help/**consulting.html<http://cmake.org/cmake/help/consulting.html>
> CMake Training Courses: http://cmake.org/cmake/help/**training.html<http://cmake.org/cmake/help/training.html>
>
> Visit other Kitware open-source projects at http://www.kitware.com/**
> opensource/opensource.html<http://www.kitware.com/opensource/opensource.html>
>
> Follow this link to subscribe/unsubscribe:
> http://www.cmake.org/mailman/**listinfo/cmake<http://www.cmake.org/mailman/listinfo/cmake>
>



-- 
+1 919 869 8849
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20131029/e3d8ea1a/attachment.htm>


More information about the CMake mailing list