X-Git-Url: https://git.creatis.insa-lyon.fr/pubgit/?a=blobdiff_plain;f=gdcmPython%2FCMakeLists.txt;h=ba6957394782755a5969540ee17088996ffde128;hb=5ae9aa5467bc943c2545ed669aa616e2c93f5a24;hp=0f73e8f402724483919931d8b0442d6cc3fc5941;hpb=55659173e732ba10873db1b8c32fc18de9bea0ff;p=gdcm.git diff --git a/gdcmPython/CMakeLists.txt b/gdcmPython/CMakeLists.txt index 0f73e8f4..ba695739 100644 --- a/gdcmPython/CMakeLists.txt +++ b/gdcmPython/CMakeLists.txt @@ -14,6 +14,7 @@ INCLUDE_DIRECTORIES( # We need to pass that to swig to be sure all modules are generated in the proper dir SET(CMAKE_SWIG_FLAGS "-outdir \"${GDCM_BINARY_DIR}/gdcmPython\"") +#SET(CMAKE_SWIG_OUTDIR "${GDCM_BINARY_DIR}/gdcmPython") # Looks like a bug to me in cmake 2.0.x: SEPARATE_ARGUMENTS(CMAKE_SWIG_FLAGS) @@ -130,17 +131,28 @@ ELSE(WIN32) ) ENDIF(WIN32) -FIND_PATH(PYTHON_DIR "site-packages" - /usr/lib/python2.4 - /usr/lib/python2.3 - /usr/lib/python2.2 - /usr/lib/python2.1 -) -STRING(REGEX REPLACE "/usr" "" PYTHON_DIR ${PYTHON_DIR}) - -INSTALL_FILES(${PYTHON_DIR}/site-packages "gdcmPython.pth") -INSTALL_FILES(/lib/gdcm/gdcmPython "\\.py$") -INSTALL_FILES(/lib/gdcm/gdcmPython FILES "gdcm.py") +# Install a python path file in site-packages that tells +# python where to find the gdcmPython module +IF(UNIX) + FIND_PATH(PYTHON_DIR "site-packages" + /usr/lib/python2.4 + /usr/lib/python2.3 + /usr/lib/python2.2 + /usr/lib/python2.1 + ) + STRING(REGEX REPLACE "/usr" "" PYTHON_DIR ${PYTHON_DIR}) + + INSTALL_FILES(${PYTHON_DIR}/site-packages FILES + "${GDCM_BINARY_DIR}/gdcmPython/gdcmPython.pth" + ) + INSTALL_FILES(/lib/gdcm/gdcmPython FILES + "gdcm.py" + "__init__.py" + "gdcmVersion.py" + "core.py" + "vtk.py" + ) +ENDIF(UNIX) #----------------------------------------------------------------------------- # Add test from demo subdir: