diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d6e127e1028952891503c5bf4a4b25dbe17ff6d..2fdc61284395004130452696af97ddc28b2ddcfc 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -166,4 +166,11 @@ configure_file(${CMAKE_SOURCE_DIR}/common/cpp/src/config.cpp.in
 
 # For issue #17
 # https://gitlab.kitware.com/cmake/cmake/issues/16915#note_456382
+if ( TARGET Qt5::Core )
+	get_property( core_options TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_OPTIONS )
+	string( REPLACE "-fPIC" "" new_core_options "${core_options}" )
+	set_property( TARGET Qt5::Core PROPERTY INTERFACE_COMPILE_OPTIONS ${new_core_options} )
+	set_property( TARGET Qt5::Core PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE "ON" )
+	set( CMAKE_CXX_COMPILE_OPTIONS_PIE "-fPIC" )
+endif()