mirror of
https://github.com/3proxy/3proxy.git
synced 2026-07-16 17:30:11 +08:00
cmake: use targets for plugins installation
using file(GLOB) could install plugins from the wrong location, use targets instead to get the correct output path Signed-off-by: Nicolas PARLANT <nicolas.parlant@parhuet.fr>
This commit is contained in:
parent
de5acb2abd
commit
6429ec9255
@ -620,14 +620,6 @@ foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
# Plugin output directory
|
||||
set(PLUGIN_OUTPUT_DIR ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
|
||||
if(WIN32)
|
||||
set(PLUGIN_SUFFIX ".dll")
|
||||
else()
|
||||
set(PLUGIN_SUFFIX ".ld.so")
|
||||
endif()
|
||||
|
||||
# Include plugin definitions
|
||||
include(cmake/plugins.cmake)
|
||||
|
||||
@ -661,16 +653,17 @@ foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
||||
endforeach()
|
||||
|
||||
# Install plugins
|
||||
file(GLOB PLUGINFILES "${PLUGIN_OUTPUT_DIR}/*${PLUGIN_SUFFIX}")
|
||||
get_property(PLUGINTARGETS GLOBAL PROPERTY 3PROXY_PLUGIN_TARGETS)
|
||||
|
||||
if(WIN32)
|
||||
install(FILES
|
||||
${PLUGINFILES}
|
||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
install(TARGETS
|
||||
${PLUGINTARGETS}
|
||||
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||
)
|
||||
else()
|
||||
install(FILES
|
||||
${PLUGINFILES}
|
||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
||||
install(TARGETS
|
||||
${PLUGINTARGETS}
|
||||
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@ -20,6 +20,8 @@ function(add_3proxy_plugin PLUGIN_NAME)
|
||||
|
||||
add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES})
|
||||
|
||||
set_property(GLOBAL APPEND PROPERTY 3PROXY_PLUGIN_TARGETS ${PLUGIN_NAME})
|
||||
|
||||
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
||||
PREFIX ""
|
||||
SUFFIX ${PLUGIN_SUFFIX}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user