Browse Source

Make QT modules build with fPIC flag if required

When building on Ubuntu (14.04 with cmake 3.2.2) the -fPIC flag needs to be added when compiling. This change fixes that issue, but I don't know how it will affect building on other systems.

Plex-CLA-1.0-signed-off-by: Niclas Berglind <nb@kjam.se>
Niclas Berglind 8 years ago
parent
commit
3e7a28de65
1 changed files with 4 additions and 0 deletions
  1. 4 0
      CMakeLists.txt

+ 4 - 0
CMakeLists.txt

@@ -54,6 +54,10 @@ endif(CMAKE_COMPILER_IS_GNUCC)
 set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${WARNINGS}")
 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${WARNINGS}")
 
+if (Qt5_POSITION_INDEPENDENT_CODE)
+  SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif(Qt5_POSITION_INDEPENDENT_CODE)
+
 add_subdirectory(external)
 add_subdirectory(src)