]> Creatis software - gdcm.git/blob - gdcmPython/demo/CMakeLists.txt
To allow testsuite go on.
[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 python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5
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-PrintDict ${PYTHON_EXECUTABLE}
20     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDict.py
21     )
22   ADD_TEST(Python-PrintFile ${PYTHON_EXECUTABLE}
23     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintFile.py
24     )
25   ADD_TEST(Python-PrintDicomDir ${PYTHON_EXECUTABLE}
26     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py
27     )
28   ADD_TEST(Python-MakeDicomDir ${PYTHON_EXECUTABLE}
29     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py
30     )
31 ELSE(PYTHON_EXECUTABLE)
32   MESSAGE(FATAL_ERROR "You requested testing for python, but python was not
33     found")
34 ENDIF(PYTHON_EXECUTABLE)
35
36 #-----------------------------------------------------------------------------
37 # Copy all the demo directory content to the cmake bin 
38 # Without it, tests can't be launched
39 CONFIGURE_FILE(
40     ${GDCM_SOURCE_DIR}/gdcmPython/demo/gdcmConfigDemo.py.in
41     ${GDCM_BINARY_DIR}/gdcmPython/demo/gdcmConfigDemo.py
42 )
43
44 CONFIGURE_FILE(
45     ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintFile.py.in
46     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintFile.py
47 )
48
49 CONFIGURE_FILE(
50     ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintDicomDir.py.in
51     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py
52 )
53
54 CONFIGURE_FILE(
55     ${GDCM_SOURCE_DIR}/gdcmPython/demo/MakeDicomDir.py.in
56     ${GDCM_BINARY_DIR}/gdcmPython/demo/MakeDicomDir.py
57 )
58
59 CONFIGURE_FILE(
60     ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintDict.py.in
61     ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDict.py
62 )
63
64 INSTALL_FILES(/lib/gdcm/gdcmPython/demo FILES 
65    "${GDCM_BINARY_DIR}/gdcmPython/demo/PrintFile.py"
66    "${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py"
67    "${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDict.py"
68 )
69
70 #-----------------------------------------------------------------------------
71 # Same but for VTK
72 IF(GDCM_VTK)
73   IF(PYTHON_EXECUTABLE)
74     ADD_TEST(Python-VTK-Reader ${PYTHON_EXECUTABLE}
75         ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmReader.py
76     )
77     ADD_TEST(Python-VTK-Writer ${PYTHON_EXECUTABLE}
78         ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmWriter.py
79     )
80   ENDIF(PYTHON_EXECUTABLE)
81
82   CONFIGURE_FILE(
83       ${GDCM_SOURCE_DIR}/gdcmPython/demo/vtkGdcmReader.py.in
84       ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmReader.py
85   )
86
87   CONFIGURE_FILE(
88       ${GDCM_SOURCE_DIR}/gdcmPython/demo/vtkGdcmWriter.py.in
89       ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmWriter.py
90   )
91
92   INSTALL_FILES(/lib/gdcm/gdcmPython/demo FILES 
93      "${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmReader.py"
94      "${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmWriter.py"
95   )
96
97 ENDIF(GDCM_VTK)
98
99 #-----------------------------------------------------------------------------
100