]> Creatis software - gdcm.git/blob - gdcmPython/demo/CMakeLists.txt
* Now, python test might work on systems
[gdcm.git] / gdcmPython / demo / CMakeLists.txt
1 # Python testing directory, 'demo' is not very explicit ...
2
3 #-----------------------------------------------------------------------------
4 # DOH! python is not found by default
5 FIND_PROGRAM(PYTHON_EXECUTABLE
6     NAMES python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python
7     PATHS
8     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath]
9     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath]
10     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath]
11     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath]
12     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.0\\InstallPath]
13     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.6\\InstallPath]
14     [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\1.5\\InstallPath]
15 )
16 MARK_AS_ADVANCED(PYTHON_EXECUTABLE)
17
18 IF(PYTHON_EXECUTABLE)
19   ADD_TEST(Python-PrintHeader ${PYTHON_EXECUTABLE}
20     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintHeader.py
21     )
22 ELSE(PYTHON_EXECUTABLE)
23   MESSAGE(FATAL_ERROR "You requested testing for python, but python was not
24     found")
25 ENDIF(PYTHON_EXECUTABLE)
26
27 #-----------------------------------------------------------------------------
28 # Copy all the demo directory content to the cmake bin 
29 # Without it, tests can't be launched
30 CONFIGURE_FILE(
31     ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintHeader.py.in
32     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintHeader.py
33 )
34