2 #If we reach this dir we have selected this option
5 # http://www.cmake.org/pipermail/cmake/2003-August/004185.html
6 # http://www.cmake.org/pipermail/cmake/2003-January/001092.html
10 ${PYTHON_INCLUDE_PATH}
15 ${GDCM_SOURCE_DIR}/src
23 #ADD_CUSTOM_TARGET(mathieu ALL)
25 SET(GDCM_PYTHON_SOURCES
29 SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED)
31 ADD_LIBRARY(pygdcm ${GDCM_PYTHON_SOURCES})
32 # http://www.cmake.org/pipermail/cmake/2003-August/004190.html
33 # SET_TARGET_PROPERTIES(pygdcm PROPERTIES PREFIX "_")
34 TARGET_LINK_LIBRARIES(pygdcm
39 #-----------------------------------------------------------------------------
40 # As of 09/10/2003 there was no FindSWIG.cmake
41 # later we should use SWIG instead of swig
42 # Build our custom command :
44 SOURCE ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i
46 ARGS -python -c++ -I${GDCM_SOURCE_DIR}/src -o
47 ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx
48 ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i
50 OUTPUTS ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx
51 COMMENT "Generating gdcm_wrap.cxx based on gdcm.i"
56 ${GDCM_SOURCE_DIR}/vtk
59 SET(vtkgdcmPython_la_SOURCES
60 ${GDCM_SOURCE_DIR}/vtk/vtkGdcmReader.cxx
62 SET_SOURCE_FILES_PROPERTIES(vtkGdcmReaderPython.cxx GENERATED)
64 # Configure Python module, which is the plugin itself
66 VTK_WRAP_PYTHON2(vtkgdcmPython gdcmfoo
67 ${vtkgdcmPython_la_SOURCES})
68 # The C++ files must be made into a C++ library
69 ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo})
70 # set the libraries to link against
71 TARGET_LINK_LIBRARIES (vtkgdcmPython
76 ENDIF (GDCM_WRAP_PYTHON)
78 #generate a setup.py according to VTK installation
79 #put it in subdir in order to not override old one
80 # as it is a pain...override existing file...
82 GET_FILENAME_COMPONENT(VTKPATH ${VTK_DIR}/../../ ABSOLUTE)
84 ${GDCM_SOURCE_DIR}/gdcmPython/setup.py.in
85 ${GDCM_SOURCE_DIR}/setup.py
90 #I should install in path of PYTHON_LIBRARY
91 #GET_FILENAME_COMPONENT(PYTHON_LIB_INSTALL ${PYTHON_LIBRARY} PATH)
92 #GET_FILENAME_COMPONENT(SITEPACKAGE ${PYTHON_LIB_INSTALL}/../site-packages ABSOLUTE)
93 #MESSAGE(STATUS ${SITEPACKAGE})
94 #INSTALL_FILES(/include "\\.h$")
95 #INSTALL_TARGETS(/lib/ gdcm)
97 INSTALL_TARGETS(/lib/ "gdcm.py")
99 # When installing swig-generated python module one should pay attention
100 # to library naming convention, see here for more detail:
101 # http://www.swig.org/Doc1.3/Python.html#n6
102 # even with the $swig -module mylib, there is always a trailing underscore added