Skip to content

Commit fbecb3a

Browse files
committed
chore: moved install step from workspace
1 parent 38c644a commit fbecb3a

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,7 +5,37 @@ if(NOT TARGET redasm::redasm)
55
find_package(redasm REQUIRED)
66
endif()
77

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

0 commit comments

Comments
 (0)