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()
|
endif()
|
||||||
endforeach()
|
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 plugin definitions
|
||||||
include(cmake/plugins.cmake)
|
include(cmake/plugins.cmake)
|
||||||
|
|
||||||
@ -661,16 +653,17 @@ foreach(PROXY_NAME proxy socks pop3p smtpp ftppr tcppm udppm tlspr)
|
|||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
# Install plugins
|
# Install plugins
|
||||||
file(GLOB PLUGINFILES "${PLUGIN_OUTPUT_DIR}/*${PLUGIN_SUFFIX}")
|
get_property(PLUGINTARGETS GLOBAL PROPERTY 3PROXY_PLUGIN_TARGETS)
|
||||||
|
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
install(FILES
|
install(TARGETS
|
||||||
${PLUGINFILES}
|
${PLUGINTARGETS}
|
||||||
DESTINATION ${CMAKE_INSTALL_BINDIR}
|
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
|
||||||
)
|
)
|
||||||
else()
|
else()
|
||||||
install(FILES
|
install(TARGETS
|
||||||
${PLUGINFILES}
|
${PLUGINTARGETS}
|
||||||
DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}/3proxy
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|||||||
@ -20,6 +20,8 @@ function(add_3proxy_plugin PLUGIN_NAME)
|
|||||||
|
|
||||||
add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES})
|
add_library(${PLUGIN_NAME} SHARED ${PLUGIN_SOURCES})
|
||||||
|
|
||||||
|
set_property(GLOBAL APPEND PROPERTY 3PROXY_PLUGIN_TARGETS ${PLUGIN_NAME})
|
||||||
|
|
||||||
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
set_target_properties(${PLUGIN_NAME} PROPERTIES
|
||||||
PREFIX ""
|
PREFIX ""
|
||||||
SUFFIX ${PLUGIN_SUFFIX}
|
SUFFIX ${PLUGIN_SUFFIX}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user