From 6c1549aac911aea335bdb69db6a6fba5a215e408 Mon Sep 17 00:00:00 2001
From: Sebastian Hahta <joseha@utu.fi>
Date: Fri, 17 May 2019 12:03:31 +0300
Subject: [PATCH] Fix #17 (forgot actual code)

---
 CMakeLists.txt | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0d6e127e1..2fdc61284 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()
 
-- 
GitLab