Browse Source

COMP: Since PythonQt wrapper library are static, make sure the flag -fPIC is passed.

That will avoid the classic compilation problem: relocation R_X86_64_32 against
`a local symbol' can not be used when making a shared object.
Jean-Christophe Fillion-Robin 14 years ago
parent
commit
ce9d183bb0
1 changed files with 3 additions and 0 deletions
  1. 3 0
      CMake/ctkMacroBuildLib.cmake

+ 3 - 0
CMake/ctkMacroBuildLib.cmake

@@ -136,6 +136,9 @@ MACRO(ctkMacroBuildLib)
       KIT_PYTHONQT_SRCS "${MY_SRCS}" ${CTK_WRAP_PYTHONQT_FULL})
     ADD_LIBRARY(${lib_name}PythonQt STATIC ${KIT_PYTHONQT_SRCS})
     TARGET_LINK_LIBRARIES(${lib_name}PythonQt ${lib_name})
+    IF(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
+      SET_TARGET_PROPERTIES(${lib_name}PythonQt PROPERTIES COMPILE_FLAGS "-fPIC")
+    ENDIF()
 
     # Update list of libraries wrapped with PythonQt
     SET(CTK_WRAPPED_LIBRARIES_PYTHONQT