]> Creatis software - gdcm.git/blob - gdcmPython/CMakeLists.txt
* doh, forgot the most important :)
[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   ${PYTHON_INCLUDE_PATH}
17 )
18
19 SET(GDCM_INC
20   ${GDCM_SOURCE_DIR}/src
21 #  -I$(top_builddir)
22 )
23
24 SET(SWIG_INC
25   ${PYTHON_INCLUDES}
26   ${GDCM_INC}
27 )
28
29 ADD_CUSTOM_TARGET(mathieu ALL)
30
31 SET(GDCM_PYTHON_SOURCES
32   gdcm_wrap.cxx
33 )
34
35 SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED)
36
37 ADD_LIBRARY(pygdcm ${GDCM_PYTHON_SOURCES})
38 TARGET_LINK_LIBRARIES(pygdcm 
39   ${PYTHON_LIBRARY}
40   gdcm
41 )
42
43
44 ADD_CUSTOM_COMMAND(
45 SOURCE    ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i
46 COMMAND   swig
47 ARGS      -python -c++ -I${GDCM_SOURCE_DIR}/src -o ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i 
48 TARGET    mathieu
49 OUTPUTS   ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx
50 )
51
52
53
54
55 IF(GDCM_VTK)
56   INCLUDE_DIRECTORIES(
57     ${GDCM_SOURCE_DIR}/vtk
58   )
59
60   SET(vtkgdcmPython_la_SOURCES
61 #      vtkGdcmReaderPython.cxx
62 #      vtkGdcmInit.cxx
63       ${GDCM_SOURCE_DIR}/vtk/vtkGdcmReader.cxx
64   )
65   SET_SOURCE_FILES_PROPERTIES(vtkGdcmReaderPython.cxx GENERATED)
66   #vtkWrapPythonInit.c
67   
68   # The C++ files must be made into a C++ library
69   #ADD_LIBRARY ( vtkgdcmPython ${vtkgdcmPython_la_SOURCES})
70
71   # set the libraries to link against
72   #TARGET_LINK_LIBRARIES(vtkgdcmPython vtkCommon)
73
74   # Configure Python module, which is the plugin itself
75   IF (GDCM_WRAP_PYTHON)
76     VTK_WRAP_PYTHON2(vtkgdcmPython gdcmfoo
77                    ${vtkgdcmPython_la_SOURCES})
78     ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo})
79     TARGET_LINK_LIBRARIES (vtkgdcmPython
80                          pygdcm
81                          vtkgdcm
82                          vtkCommonPython
83                          vtkIOPython)
84   ENDIF (GDCM_WRAP_PYTHON)
85 ENDIF(GDCM_VTK)