]> Creatis software - gdcm.git/commitdiff
Swig should be found on win32 now, some cosmetic cleanup too
authormalaterre <malaterre>
Wed, 12 May 2004 03:51:02 +0000 (03:51 +0000)
committermalaterre <malaterre>
Wed, 12 May 2004 03:51:02 +0000 (03:51 +0000)
gdcmPython/CMakeLists.txt

index a718595ec9b7baf0d2656a12cd1b7b2f9f1f5493..d1afeda1f982e5f31848d713d8bdf52a394e2f18 100644 (file)
@@ -38,14 +38,20 @@ IF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)
 
 ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)   
 
-  ADD_LIBRARY(pygdcm gdcm_wrap.cxx)
-
   # As of 09/10/2003 there was no FindSWIG.cmake
   # later we should use SWIG instead of swig
+  FIND_PROGRAM(SWIG_EXECUTABLE
+    NAMES swig-1.3 swig
+  )
+  
+  IF(NOT SWIG_EXECUTABLE)
+    MESSAGE(FATAL_ERROR "Swig could not be found wrapping is impossible")
+  ENDIF(NOT SWIG_EXECUTABLE)
+  
   # Build our custom command :
   ADD_CUSTOM_COMMAND(
     TARGET    pygdcm
-    COMMAND   swig
+    COMMAND   ${SWIG_EXECUTABLE}
     ARGS      -python -c++ -I${GDCM_SOURCE_DIR}/src -o 
               ${GDCM_BINARY_DIR}/gdcmPython/gdcm_wrap.cxx 
               ${GDCM_SOURCE_DIR}/gdcmPython/gdcm.i 
@@ -58,12 +64,13 @@ ELSE(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)
   # Since the file gdcm_wrap.cxx does not exist, mark it as GENERATED:
   SET_SOURCE_FILES_PROPERTIES(gdcm_wrap.cxx GENERATED)
 
+  ADD_LIBRARY(pygdcm gdcm_wrap.cxx)
   TARGET_LINK_LIBRARIES(pygdcm
     ${PYTHON_LIBRARY}
     gdcm
   )
   # http://www.cmake.org/pipermail/cmake/2003-August/004190.html
-  SET_TARGET_PROPERTIES(pygdcm PROPERTIES PREFIX "_")
+  SET_TARGET_PROPERTIES(pygdcm PROPERTIES PREFIX "_")
 
 ENDIF(${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} GREATER 1.9)   
 
@@ -89,7 +96,7 @@ IF(GDCM_VTK)
     ADD_LIBRARY(vtkgdcmPython SHARED ${gdcmfoo})
     # set the libraries to link against
     TARGET_LINK_LIBRARIES (vtkgdcmPython
-                           pygdcm
+                           #_pygdcm
                            vtkgdcm
                            vtkCommonPython
                            vtkIOPython)