X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2Fdemo%2FCMakeLists.txt;h=4c76a3bae078854150d723300c8a8789d1eee888;hb=1eace7fe2d9708f674da4abe0461f4bb1d734c52;hp=d6cc435a9a4059ffb9f35462be9dd9198b91a80c;hpb=0ffb612fa350791ea6de473a5c5a1fd965f80227;p=gdcm.git diff --git a/gdcmPython/demo/CMakeLists.txt b/gdcmPython/demo/CMakeLists.txt index d6cc435a..4c76a3ba 100644 --- a/gdcmPython/demo/CMakeLists.txt +++ b/gdcmPython/demo/CMakeLists.txt @@ -1,9 +1,11 @@ # Python testing directory, 'demo' is not very explicit ... +#----------------------------------------------------------------------------- # DOH! python is not found by default FIND_PROGRAM(PYTHON_EXECUTABLE - NAMES python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 python + NAMES python python2.4 python2.3 python2.2 python2.1 python2.0 python1.6 python1.5 PATHS + [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.4\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.3\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.2\\InstallPath] [HKEY_LOCAL_MACHINE\\SOFTWARE\\Python\\PythonCore\\2.1\\InstallPath] @@ -14,10 +16,77 @@ FIND_PROGRAM(PYTHON_EXECUTABLE MARK_AS_ADVANCED(PYTHON_EXECUTABLE) IF(PYTHON_EXECUTABLE) - ADD_TEST(PrintHeader-Python ${PYTHON_EXECUTABLE} - ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintHeader.py + ADD_TEST(Python-PrintDict ${PYTHON_EXECUTABLE} + ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDict.py + ) + ADD_TEST(Python-PrintFile ${PYTHON_EXECUTABLE} + ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintFile.py + ) + ADD_TEST(Python-PrintDicomDir ${PYTHON_EXECUTABLE} + ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py ) ELSE(PYTHON_EXECUTABLE) MESSAGE(FATAL_ERROR "You requested testing for python, but python was not found") ENDIF(PYTHON_EXECUTABLE) + +#----------------------------------------------------------------------------- +# Copy all the demo directory content to the cmake bin +# Without it, tests can't be launched +CONFIGURE_FILE( + ${GDCM_SOURCE_DIR}/gdcmPython/demo/gdcmConfigDemo.py.in + ${GDCM_BINARY_DIR}/gdcmPython/demo/gdcmConfigDemo.py +) + +CONFIGURE_FILE( + ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintFile.py.in + ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintFile.py +) + +CONFIGURE_FILE( + ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintDicomDir.py.in + ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py +) + +CONFIGURE_FILE( + ${GDCM_SOURCE_DIR}/gdcmPython/demo/PrintDict.py.in + ${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDict.py +) + +INSTALL_FILES(/lib/gdcm/gdcmPython/demo FILES + "${GDCM_BINARY_DIR}/gdcmPython/demo/PrintFile.py" + "${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDicomDir.py" + "${GDCM_BINARY_DIR}/gdcmPython/demo/PrintDict.py" +) + +#----------------------------------------------------------------------------- +# Same but for VTK +IF(GDCM_VTK) + IF(PYTHON_EXECUTABLE) + ADD_TEST(Python-VTK-Reader ${PYTHON_EXECUTABLE} + ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmReader.py + ) + ADD_TEST(Python-VTK-Writer ${PYTHON_EXECUTABLE} + ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmWriter.py + ) + ENDIF(PYTHON_EXECUTABLE) + + CONFIGURE_FILE( + ${GDCM_SOURCE_DIR}/gdcmPython/demo/vtkGdcmReader.py.in + ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmReader.py + ) + + CONFIGURE_FILE( + ${GDCM_SOURCE_DIR}/gdcmPython/demo/vtkGdcmWriter.py.in + ${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmWriter.py + ) + + INSTALL_FILES(/lib/gdcm/gdcmPython/demo FILES + "${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmReader.py" + "${GDCM_BINARY_DIR}/gdcmPython/demo/vtkGdcmWriter.py" + ) + +ENDIF(GDCM_VTK) + +#----------------------------------------------------------------------------- +