瀏覽代碼

Use "pyd" extension for PythonQt module

See http://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll
Jean-Christophe Fillion-Robin 13 年之前
父節點
當前提交
6e3bdca9cd
共有 1 個文件被更改,包括 8 次插入1 次删除
  1. 8 1
      CMake/ctkMacroBuildLibWrapper.cmake

+ 8 - 1
CMake/ctkMacroBuildLibWrapper.cmake

@@ -30,7 +30,7 @@
 #! On the other hand, when CTK is built statically, it creates a
 #! On the other hand, when CTK is built statically, it creates a
 #! static library providing a initialization function that will allow to load
 #! static library providing a initialization function that will allow to load
 #! both (1) and (2).
 #! both (1) and (2).
-  
+
 #! \ingroup CMakeAPI
 #! \ingroup CMakeAPI
 MACRO(ctkMacroBuildLibWrapper)
 MACRO(ctkMacroBuildLibWrapper)
   ctkMacroParseArguments(MY
   ctkMacroParseArguments(MY
@@ -120,6 +120,13 @@ MACRO(ctkMacroBuildLibWrapper)
   IF(MY_WRAPPER_LIBRARY_TYPE STREQUAL "MODULE")
   IF(MY_WRAPPER_LIBRARY_TYPE STREQUAL "MODULE")
     # Make sure that no prefix is set on the library
     # Make sure that no prefix is set on the library
     set_target_properties(${lib_name}PythonQt PROPERTIES PREFIX "")
     set_target_properties(${lib_name}PythonQt PROPERTIES PREFIX "")
+    # Python extension modules on Windows must have the extension ".pyd"
+    # instead of ".dll" as of Python 2.5.  Older python versions do support
+    # this suffix.
+    # See http://docs.python.org/faq/windows.html#is-a-pyd-file-the-same-as-a-dll
+    IF(WIN32 AND NOT CYGWIN)
+      set_target_properties(${lib_name}PythonQt PROPERTIES SUFFIX ".pyd")
+    ENDIF()
   ENDIF()
   ENDIF()
   set_target_properties(${lib_name}PythonQt PROPERTIES
   set_target_properties(${lib_name}PythonQt PROPERTIES
     RUNTIME_OUTPUT_DIRECTORY "${MY_RUNTIME_OUTPUT_DIRECTORY}"
     RUNTIME_OUTPUT_DIRECTORY "${MY_RUNTIME_OUTPUT_DIRECTORY}"