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}
14 ${GDCM_SOURCE_DIR}/src
22 #ADD_CUSTOM_TARGET(mathieu ALL)
24 SET(GDCM_PYTHON_SOURCES
28 SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED)
30 ADD_LIBRARY(pygdcm ${GDCM_PYTHON_SOURCES})
31 # http://www.cmake.org/pipermail/cmake/2003-August/004190.html
32 # SET_TARGET_PROPERTIES(pygdcm PROPERTIES PREFIX "_")
33 TARGET_LINK_LIBRARIES(pygdcm
38 #-----------------------------------------------------------------------------
39 # As of 09/10/2003 there was no FindSWIG.cmake
40 # later we should use SWIG instead of swig
41 # Build our custom command :
43 SOURCE ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i
45 ARGS -python -c++ -I${GDCM_SOURCE_DIR}/src -o
46 ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx
47 ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i
49 OUTPUTS ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx
54 ${GDCM_SOURCE_DIR}/vtk
57 SET(vtkgdcmPython_la_SOURCES
58 ${GDCM_SOURCE_DIR}/vtk/vtkGdcmReader.cxx
60 SET_SOURCE_FILES_PROPERTIES(vtkGdcmReaderPython.cxx GENERATED)
62 # Configure Python module, which is the plugin itself
64 VTK_WRAP_PYTHON2(vtkgdcmPython gdcmfoo
65 ${vtkgdcmPython_la_SOURCES})
66 # The C++ files must be made into a C++ library
67 ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo})
68 # set the libraries to link against
69 TARGET_LINK_LIBRARIES (vtkgdcmPython
74 ENDIF (GDCM_WRAP_PYTHON)
76 #generate a setup.py according to VTK installation
77 #put it in subdir in order to not override old one
79 ${GDCM_SOURCE_DIR}/gdcmPython/setup.py.in
80 ${GDCM_BINARY_DIR}/gdcmPython/setup.py
85 #I should install in path of PYTHON_LIBRARY
86 #GET_FILENAME_COMPONENT(PYTHON_LIB_INSTALL ${PYTHON_LIBRARY} PATH)
87 #GET_FILENAME_COMPONENT(SITEPACKAGE ${PYTHON_LIB_INSTALL}/../site-packages ABSOLUTE)
88 #MESSAGE(STATUS ${SITEPACKAGE})
89 #INSTALL_FILES(/include "\\.h$")
90 #INSTALL_TARGETS(/lib/ gdcm)
92 INSTALL_TARGETS(/lib/ "gdcm.py")
94 # When installing swig-generated python module one should pay attention
95 # to library naming convention, see here for more detail:
96 # http://www.swig.org/Doc1.3/Python.html#n6
97 # even with the $swig -module mylib, there is always a trailing underscore added