[CMake] CMake support for Python

Mathieu Malaterre mathieu.malaterre at gmail.com
Thu Jul 10 09:20:18 EDT 2008


You are missing the enable_testing() + include(CTest) thingy

Ref:
http://www.cmake.org/Wiki/CMake_Testing_With_CTest

HTH
-Mathieu

On Thu, Jul 10, 2008 at 3:14 PM, Nicholas Yue <yue.nicholas at gmail.com> wrote:
> Hi Mathieu,
>
>  Are you able to elaborate on the steps?
>
>  I have a python project which has a myproj/src and myproj/test directory.
>
>  The unit test sits in the test directory
>
>  My CMakeLists.txt file sit in the myproj directory
>
>  My CMakeLists.txt has this
>
> 8<------8<------8<------8<------8<------8<------8<------8<------
> CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
>
> PROJECT ( unittest )
>
> INCLUDE ( FindPythonInterp )
> INCLUDE ( UsePythonTest )
>
> ADD_PYTHON_COMPILEALL_TEST ( src )
> ADD_PYTHON_COMPILEALL_TEST ( test )
> ADD_PYTHON_TEST(PYTHON-TEST test/GeometryTestSuite.py)
> 8<------8<------8<------8<------8<------8<------8<------8<------
>
>  How do I trigger the python compile?
>
>  When I do a "make test", there is no test to run.
>
> Regards
>
> 2008/7/10 Mathieu Malaterre <mathieu.malaterre at gmail.com>:
>> Nicholas,
>>
>>  We are using this for GDCM:
>>
>> http://gdcm.svn.sourceforge.net/viewvc/gdcm/trunk/CMake/UsePythonTest.cmake?view=markup
>>
>> HTH
>> -Mathieu
>>
>> On Tue, Jul 8, 2008 at 3:17 PM, Nicholas Yue <yue.nicholas at gmail.com> wrote:
>>> Hi,
>>>
>>>  I'd like to build and run Python unit test using CMake.
>>>
>>>  In the keyword Project, there is support for a language tag after
>>> the project name.
>>>
>>>  Is there any example of using CMake to run Python unit tests?
>>>
>>> Regards
>>> _______________________________________________
>>> CMake mailing list
>>> CMake at cmake.org
>>> http://www.cmake.org/mailman/listinfo/cmake
>>>
>>
>>
>>
>> --
>> Mathieu
>>
>
>
>
> --
> Nicholas Yue BSc (Hons) MACM
> Graphics - RenderMan, RIB, Visualization, OpenGL, netCDF
> Custom Dev - C++ porting, OSX, Linux, Windows
> http://www.proceduralinsight.com/about.html
>



-- 
Mathieu


More information about the CMake mailing list