X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2FCMakeLists.txt;h=66aaca9e69714c2e32ec62bb72da3b550594c2d3;hb=b7518dc8f2304a666cafac4b1b18ac7d81983555;hp=c8cb8da3f01dcc323f7ec6adaeda47c881c8d73f;hpb=ec5c97e570cd68bd66ccf41b61e96d11c87bbd5b;p=gdcm.git diff --git a/gdcmPython/CMakeLists.txt b/gdcmPython/CMakeLists.txt index c8cb8da3..66aaca9e 100644 --- a/gdcmPython/CMakeLists.txt +++ b/gdcmPython/CMakeLists.txt @@ -1,15 +1,14 @@ #IF(GDCM_WRAP_PYTHON) #If we reach this dir we have selected this option - -#TODO -#http://www.cmake.org/pipermail/cmake/2003-August/004185.html -#http://www.cmake.org/pipermail/cmake/2003-January/001092.html - +# TODO +# http://www.cmake.org/pipermail/cmake/2003-August/004185.html +# http://www.cmake.org/pipermail/cmake/2003-January/001092.html INCLUDE_DIRECTORIES( ${GDCM_SOURCE_DIR}/src ${PYTHON_INCLUDE_PATH} + ${GDCM_BINARY_DIR}/ ) SET(GDCM_INC @@ -21,7 +20,7 @@ SET(SWIG_INC ${GDCM_INC} ) -ADD_CUSTOM_TARGET(mathieu ALL) +#ADD_CUSTOM_TARGET(mathieu ALL) SET(GDCM_PYTHON_SOURCES gdcm_wrap.cxx @@ -30,8 +29,8 @@ SET(GDCM_PYTHON_SOURCES SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED) ADD_LIBRARY(pygdcm ${GDCM_PYTHON_SOURCES}) -#http://www.cmake.org/pipermail/cmake/2003-August/004190.html -#SET_TARGET_PROPERTIES(pygdcm PROPERTIES PREFIX "") +# http://www.cmake.org/pipermail/cmake/2003-August/004190.html +# SET_TARGET_PROPERTIES(pygdcm PROPERTIES PREFIX "_") TARGET_LINK_LIBRARIES(pygdcm ${PYTHON_LIBRARY} gdcm @@ -49,6 +48,7 @@ ADD_CUSTOM_COMMAND( ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i TARGET pygdcm OUTPUTS ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx + COMMENT "Generating gdcm_wrap.cxx based on gdcm.i" ) IF(GDCM_VTK) @@ -61,17 +61,13 @@ IF(GDCM_VTK) ) SET_SOURCE_FILES_PROPERTIES(vtkGdcmReaderPython.cxx GENERATED) - # The C++ files must be made into a C++ library - #ADD_LIBRARY ( vtkgdcmPython ${vtkgdcmPython_la_SOURCES}) - - # set the libraries to link against - #TARGET_LINK_LIBRARIES(vtkgdcmPython vtkCommon) - # Configure Python module, which is the plugin itself IF (GDCM_WRAP_PYTHON) VTK_WRAP_PYTHON2(vtkgdcmPython gdcmfoo ${vtkgdcmPython_la_SOURCES}) + # The C++ files must be made into a C++ library ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo}) + # set the libraries to link against TARGET_LINK_LIBRARIES (vtkgdcmPython pygdcm vtkgdcm @@ -81,9 +77,12 @@ IF(GDCM_VTK) #generate a setup.py according to VTK installation #put it in subdir in order to not override old one + # as it is a pain...override existing file... + + GET_FILENAME_COMPONENT(VTKPATH ${VTK_DIR}/../../ ABSOLUTE) CONFIGURE_FILE( ${GDCM_SOURCE_DIR}/gdcmPython/setup.py.in - ${GDCM_BINARY_DIR}/gdcmPython/setup.py + ${GDCM_SOURCE_DIR}/setup.py ) ENDIF(GDCM_VTK) @@ -95,6 +94,8 @@ ENDIF(GDCM_VTK) #INSTALL_FILES(/include "\\.h$") #INSTALL_TARGETS(/lib/ gdcm) +INSTALL_TARGETS(/lib/ "gdcm.py") + # When installing swig-generated python module one should pay attention # to library naming convention, see here for more detail: # http://www.swig.org/Doc1.3/Python.html#n6