X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2FCMakeLists.txt;h=de7d7008010a0ad36ffa30c7b4fb5241dd278f29;hb=df1a3b45849af2e3d6ee4f616e5d5b88f3b4b5a6;hp=ba6957394782755a5969540ee17088996ffde128;hpb=def46e1406409aebffa69097d83d7e1730352497;p=gdcm.git diff --git a/gdcmPython/CMakeLists.txt b/gdcmPython/CMakeLists.txt index ba695739..de7d7008 100644 --- a/gdcmPython/CMakeLists.txt +++ b/gdcmPython/CMakeLists.txt @@ -2,6 +2,7 @@ INCLUDE_DIRECTORIES( ${GDCM_SOURCE_DIR}/src + ${GDCM_SOURCE_DIR}/gdcmPython ${PYTHON_INCLUDE_PATH} ${GDCM_BINARY_DIR}/ ) @@ -28,6 +29,11 @@ SET_SOURCE_FILES_PROPERTIES(gdcm.i PROPERTIES CPLUSPLUS ON) # BUG: This is only needed with cmake <= 2.0.5 SET_SOURCE_FILES_PROPERTIES(gdcm.i PROPERTIES SWIG_FLAGS "") # END OF BUG +#FIXME : +#where must we put the keyword SHARED +#- just like in ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmWrapSOURCES}) - +#to allow use of a static/shared libray ? +# JPRx SWIG_ADD_MODULE(gdcm python gdcm.i) #gdcm_wrap.cxx, or gdcmPYTHON_wrap.cxx SWIG_LINK_LIBRARIES(gdcm gdcm ${PYTHON_LIBRARIES}) @@ -62,6 +68,9 @@ IF(GDCM_VTK) IF(NOT VTK_WRAP_PYTHON) MESSAGE(FATAL_ERROR "Can't build gdcm python wrapping if VTK_WRAP_PYTHON is OFF" ) ENDIF(NOT VTK_WRAP_PYTHON) + IF("${VTK_MAJOR_VERSION}" GREATER 4) + INCLUDE(${VTK_CMAKE_DIR}/vtkWrapPython.cmake) + ENDIF("${VTK_MAJOR_VERSION}" GREATER 4) VTK_WRAP_PYTHON2(vtkgdcmPython gdcmWrapSOURCES ${vtkgdcmPython_la_SOURCES}) # The C++ files must be made into a C++ library @@ -70,10 +79,17 @@ IF(GDCM_VTK) #SET_TARGET_PROPERTIES(${foobar} PROPERTIES PREFIX "") #GET_TARGET_PROPERTY(swig_gdcm_fullpath "${SWIG_MODULE_gdcm_REAL_NAME}" LOCATION) - TARGET_LINK_LIBRARIES (vtkgdcmPython - vtkgdcm - vtkCommonPython - vtkIOPython) + IF("${VTK_MAJOR_VERSION}" LESS 5) + TARGET_LINK_LIBRARIES (vtkgdcmPython + vtkgdcm + vtkCommonPython + vtkIOPython) + ELSE("${VTK_MAJOR_VERSION}" LESS 5) + TARGET_LINK_LIBRARIES (vtkgdcmPython + vtkgdcm + vtkCommonPythonD + vtkIOPythonD) + ENDIF("${VTK_MAJOR_VERSION}" LESS 5) INSTALL_TARGETS(/lib/gdcm/ vtkgdcmPython) ENDIF (GDCM_WRAP_PYTHON) @@ -125,10 +141,17 @@ IF(WIN32) "${GDCM_BINARY_DIR}\n" "${GDCM_BINARY_DIR}/bin/release\n" ) + FILE(WRITE ${GDCM_BINARY_DIR}/gdcmPython/InstallOnly/gdcmPython.pth + "${GDCM_SOURCE_DIR}\n" + "${GDCM_SOURCE_DIR}/bin\n" + ) ELSE(WIN32) FILE(WRITE ${GDCM_BINARY_DIR}/gdcmPython/gdcmPython.pth "${CMAKE_INSTALL_PREFIX}/lib/gdcm\n" ) + FILE(WRITE ${GDCM_BINARY_DIR}/gdcmPython/InstallOnly/gdcmPython.pth + "/usr/lib/gdcm\n" + ) ENDIF(WIN32) # Install a python path file in site-packages that tells @@ -143,7 +166,7 @@ IF(UNIX) STRING(REGEX REPLACE "/usr" "" PYTHON_DIR ${PYTHON_DIR}) INSTALL_FILES(${PYTHON_DIR}/site-packages FILES - "${GDCM_BINARY_DIR}/gdcmPython/gdcmPython.pth" + "${GDCM_BINARY_DIR}/gdcmPython/InstallOnly/gdcmPython.pth" ) INSTALL_FILES(/lib/gdcm/gdcmPython FILES "gdcm.py"