From 28279a6349a80cc6148963e80da736ae33e415b3 Mon Sep 17 00:00:00 2001 From: Peguen <73380451+Peguen@users.noreply.github.com> Date: Fri, 26 Apr 2024 13:46:11 +0200 Subject: [PATCH] [CMake] Added CMAKE_POSITION_INDEPENDENT_CODE ON to qt relevant builds (#1569) --- app/mon/mon_plugins/monitor_tree_view/CMakeLists.txt | 2 ++ lib/CustomQt/CMakeLists.txt | 2 ++ lib/CustomTclap/CMakeLists.txt | 2 ++ lib/QEcalParser/CMakeLists.txt | 2 ++ lib/ThreadingUtils/CMakeLists.txt | 2 ++ lib/ecal_utils/CMakeLists.txt | 2 ++ thirdparty/qwt/CMakeLists.txt | 2 ++ 7 files changed, 14 insertions(+) diff --git a/app/mon/mon_plugins/monitor_tree_view/CMakeLists.txt b/app/mon/mon_plugins/monitor_tree_view/CMakeLists.txt index bd2f1c99a2..2e86602c2c 100644 --- a/app/mon/mon_plugins/monitor_tree_view/CMakeLists.txt +++ b/app/mon/mon_plugins/monitor_tree_view/CMakeLists.txt @@ -18,6 +18,8 @@ project(MonitorTreeView) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # Legacy Qt5 (pre 5.15) support as suggested by teh Qt Documentation: # https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html#supporting-older-qt-5-versions find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets) diff --git a/lib/CustomQt/CMakeLists.txt b/lib/CustomQt/CMakeLists.txt index 0e93dba090..24fa75d6f4 100644 --- a/lib/CustomQt/CMakeLists.txt +++ b/lib/CustomQt/CMakeLists.txt @@ -18,6 +18,8 @@ project(CustomQt) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # Legacy Qt5 (pre 5.15) support as suggested by teh Qt Documentation: # https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html#supporting-older-qt-5-versions find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets) diff --git a/lib/CustomTclap/CMakeLists.txt b/lib/CustomTclap/CMakeLists.txt index ad8b35f214..daaae09d15 100644 --- a/lib/CustomTclap/CMakeLists.txt +++ b/lib/CustomTclap/CMakeLists.txt @@ -18,6 +18,8 @@ project(CustomTclap) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + find_package(tclap REQUIRED) set(include_files diff --git a/lib/QEcalParser/CMakeLists.txt b/lib/QEcalParser/CMakeLists.txt index 9a5fda1be6..1ee2a39801 100644 --- a/lib/QEcalParser/CMakeLists.txt +++ b/lib/QEcalParser/CMakeLists.txt @@ -18,6 +18,8 @@ project(QEcalParser) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # Legacy Qt5 (pre 5.15) support as suggested by teh Qt Documentation: # https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html#supporting-older-qt-5-versions find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core Widgets) diff --git a/lib/ThreadingUtils/CMakeLists.txt b/lib/ThreadingUtils/CMakeLists.txt index 28d9268c07..a8222da9e1 100644 --- a/lib/ThreadingUtils/CMakeLists.txt +++ b/lib/ThreadingUtils/CMakeLists.txt @@ -18,6 +18,8 @@ project(ThreadingUtils) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + find_package(Threads REQUIRED) set (threading_utils_includes diff --git a/lib/ecal_utils/CMakeLists.txt b/lib/ecal_utils/CMakeLists.txt index c6a4c6cd49..2f31c93c3c 100644 --- a/lib/ecal_utils/CMakeLists.txt +++ b/lib/ecal_utils/CMakeLists.txt @@ -17,6 +17,8 @@ # ========================= eCAL LICENSE ================================= project(ecal-utils) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + find_package(Threads REQUIRED) set (ecal_utils_includes diff --git a/thirdparty/qwt/CMakeLists.txt b/thirdparty/qwt/CMakeLists.txt index 61173c8cf8..5db44b880f 100644 --- a/thirdparty/qwt/CMakeLists.txt +++ b/thirdparty/qwt/CMakeLists.txt @@ -7,6 +7,8 @@ endif() project(qwt VERSION 6.2.0) +set(CMAKE_POSITION_INDEPENDENT_CODE ON) + # Legacy Qt5 (pre 5.15) support as suggested by teh Qt Documentation: # https://doc.qt.io/qt-6/cmake-qt5-and-qt6-compatibility.html#supporting-older-qt-5-versions find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets OpenGL Svg Concurrent PrintSupport)