Skip to content

Commit 27c14e0

Browse files
authored
Merge pull request #70 from blshkv/fix-plugin-dir
cmake/main: detect system plugin dir via GNUInstallDirs
2 parents a7c663d + d9e0e6a commit 27c14e0

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ cmake_minimum_required(VERSION 3.25)
22

33
project(redasm-gui)
44

5+
include(GNUInstallDirs)
6+
57
if(NOT TARGET redasm::redasm)
68
find_package(redasm REQUIRED)
79
endif()
@@ -86,6 +88,7 @@ target_sources(${PROJECT_NAME}
8688
target_compile_definitions(${PROJECT_NAME}
8789
PRIVATE
8890
SHARED_OBJECT_EXT="${CMAKE_SHARED_LIBRARY_SUFFIX}"
91+
$<$<NOT:$<BOOL:${WIN32}>>:REDASM_PLUGIN_DIR="${CMAKE_INSTALL_FULL_LIBDIR}/redasm/plugins">
8992
)
9093

9194
target_include_directories(${PROJECT_NAME}

src/main.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ void configure_searchpaths() {
5656
append_unique(utils::search_paths, APP_DIR + "/plugins");
5757
append_unique(utils::kb_search_paths, (APP_DIR + "/kb").toUtf8());
5858

59+
#if defined(REDASM_PLUGIN_DIR)
60+
append_unique(utils::search_paths, QString::fromUtf8(REDASM_PLUGIN_DIR));
61+
#endif
62+
5963
for(const QString& sp : QStandardPaths::standardLocations(QStandardPaths::AppDataLocation)) {
6064
append_unique(utils::search_paths, sp + "/plugins");
6165
append_unique(utils::kb_search_paths, (sp + "/kb").toUtf8());

0 commit comments

Comments
 (0)