]> Creatis software - gdcm.git/blob - gdcmPython/CMakeLists.txt
dc1ac9e5279a47c91766dbf03f4b4e44797c441b
[gdcm.git] / gdcmPython / CMakeLists.txt
1 #IF(GDCM_WRAP_PYTHON)
2 #If we reach this dir we have selected this option
3
4
5 #TODO
6 #http://www.cmake.org/pipermail/cmake/2003-August/004185.html
7 #http://www.cmake.org/pipermail/cmake/2003-January/001092.html
8
9 #As of 09/10/2003 there was no FindSWIG.cmake
10
11 #gdcm_wrap.cxx: $(srcdir)/gdcm.i
12 #       $(SWIG)  -python -c++ $(SWIG_INC) -o $@ $<
13
14 INCLUDE_DIRECTORIES(
15   ${GDCM_SOURCE_DIR}/src
16 )
17
18 SET(GDCM_INC
19   ${GDCM_SOURCE_DIR}/src
20 #  -I$(top_builddir)
21 )
22
23 SET(SWIG_INC
24   ${PYTHON_INCLUDES}
25   ${GDCM_INC}
26 )
27
28 ADD_CUSTOM_TARGET(mathieu ALL)
29
30 SET(GDCM_PYTHON_SOURCES
31   gdcm_wrap.cxx
32 )
33
34 SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED)
35
36 ADD_LIBRARY(pygdcm ${GDCM_PYTHON_SOURCES})
37
38
39 ADD_CUSTOM_COMMAND(
40 SOURCE    ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i
41 COMMAND   swig
42 ARGS      -python -c++ -I${GDCM_SOURCE_DIR}/src -o ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i 
43 TARGET    mathieu
44 OUTPUTS   ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx
45 )
46
47
48
49
50 IF(GDCM_VTK)
51   INCLUDE_DIRECTORIES(
52     ${GDCM_SOURCE_DIR}/vtk
53   )
54
55   SET(vtkgdcmPython_la_SOURCES
56 #      vtkGdcmReaderPython.cxx
57 #      vtkGdcmInit.cxx
58       ${GDCM_SOURCE_DIR}/vtk/vtkGdcmReader.cxx
59   )
60   SET_SOURCE_FILES_PROPERTIES(vtkGdcmReaderPython.cxx GENERATED)
61   #vtkWrapPythonInit.c
62   
63   # The C++ files must be made into a C++ library
64   #ADD_LIBRARY ( vtkgdcmPython ${vtkgdcmPython_la_SOURCES})
65
66   # set the libraries to link against
67   #TARGET_LINK_LIBRARIES(vtkgdcmPython vtkCommon)
68
69   # Configure Python module, which is the plugin itself
70   IF (GDCM_WRAP_PYTHON)
71     VTK_WRAP_PYTHON2(vtkgdcmPython gdcmfoo
72                    ${vtkgdcmPython_la_SOURCES})
73     ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo})
74     TARGET_LINK_LIBRARIES (vtkgdcmPython
75                          pygdcm
76                          vtkgdcm
77                          vtkCommonPython
78                          vtkIOPython)
79   ENDIF (GDCM_WRAP_PYTHON)
80 ENDIF(GDCM_VTK)