Skip to content

Commit 4cfdfa6

Browse files
committed
chore: moved install step from workspace
1 parent afa979d commit 4cfdfa6

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

CMakeLists.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,36 @@ if(NOT TARGET redasm::redasm)
55
find_package(redasm REQUIRED)
66
endif()
77

8+
if(WIN32)
9+
set(REDASM_INSTALL_PLUGINS "plugins/processors")
10+
else()
11+
include(GNUInstallDirs)
12+
set(REDASM_INSTALL_PLUGINS "${CMAKE_INSTALL_LIBDIR}/redasm/plugins/processors")
13+
endif()
14+
815
add_subdirectory(capstonebundle)
916
add_subdirectory(x86)
1017
add_subdirectory(mips)
18+
19+
get_property(subdirs DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" PROPERTY SUBDIRECTORIES)
20+
21+
foreach(subdir ${subdirs})
22+
get_property(targets DIRECTORY ${subdir} PROPERTY BUILDSYSTEM_TARGETS)
23+
24+
foreach(target ${targets})
25+
get_target_property(target_type ${target} TYPE)
26+
27+
if(target_type STREQUAL "SHARED_LIBRARY")
28+
if(NOT WIN32)
29+
set_target_properties(${target} PROPERTIES
30+
INSTALL_RPATH "$ORIGIN/../../../"
31+
)
32+
endif()
33+
34+
install(TARGETS ${target}
35+
LIBRARY DESTINATION "${REDASM_INSTALL_PLUGINS}"
36+
RUNTIME DESTINATION "${REDASM_INSTALL_PLUGINS}"
37+
)
38+
endif()
39+
endforeach()
40+
endforeach()

0 commit comments

Comments
 (0)