From 3bc4c24e06862d2cfa4b4aed603f234115e4b583 Mon Sep 17 00:00:00 2001 From: craftablescience Date: Thu, 13 Jun 2024 21:51:08 -0400 Subject: [PATCH] fix: set proper runpath on linux for all executables --- CMakeLists.txt | 5 +++++ src/gui/_gui.cmake | 4 ---- src/gui/previews/MDLPreview.cpp | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6585f45..28df0f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -42,6 +42,11 @@ option(VPKEDIT_USE_LTO "Build VPKEdit with link-time optimization enabled" OFF) # Global CMake options if(PROJECT_IS_TOP_LEVEL) + # Set proper runpath + set(CMAKE_SKIP_BUILD_RPATH OFF) + set(CMAKE_BUILD_RPATH_USE_ORIGIN ON) + set(CMAKE_INSTALL_RPATH $ORIGIN) + # Compile with PIC set(CMAKE_POSITION_INDEPENDENT_CODE ON) diff --git a/src/gui/_gui.cmake b/src/gui/_gui.cmake index 56354f8..6d61925 100644 --- a/src/gui/_gui.cmake +++ b/src/gui/_gui.cmake @@ -1,7 +1,3 @@ -set(CMAKE_SKIP_BUILD_RPATH FALSE) -set(CMAKE_BUILD_RPATH_USE_ORIGIN TRUE) -set(CMAKE_INSTALL_RPATH $ORIGIN) - # discord-rpc add_subdirectory("${CMAKE_CURRENT_LIST_DIR}/thirdparty/discord") diff --git a/src/gui/previews/MDLPreview.cpp b/src/gui/previews/MDLPreview.cpp index e7ed0da..469c7b2 100644 --- a/src/gui/previews/MDLPreview.cpp +++ b/src/gui/previews/MDLPreview.cpp @@ -390,7 +390,7 @@ void MDLWidget::mouseMoveEvent(QMouseEvent* event) { } QVector3D inputAxis; - if (!rmbBeingHeld) { + if (!this->rmbBeingHeld) { // Rotation axis is perpendicular to the mouse position difference vector inputAxis = QVector3D(diff.y(), diff.x(), 0.0).normalized(); } else {