1
0
mirror of https://github.com/SoftEtherVPN/SoftEtherVPN.git synced 2025-07-06 07:44:57 +03:00

CMake: build all targets in the same directory, so that "hamcore.se2" doesn't have to be copied for each of them

This commit is contained in:
Davide Beatrici
2018-10-18 02:02:17 +02:00
parent 966a5e6dea
commit 8173eb4509
7 changed files with 81 additions and 96 deletions

View File

@ -2,9 +2,25 @@ add_executable(vpnclient vpncsvc.c)
set_target_properties(vpnclient
PROPERTIES
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnclient"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnclient"
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}/vpnclient"
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
)
target_link_libraries(vpnclient cedar mayaqua)
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script and systemd service
install(TARGETS vpnclient
COMPONENT "vpnclient"
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnclient"
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
)
install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
COMPONENT "vpnclient"
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnclient"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
install_wrapper_script("vpnclient" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")
install_systemd_service("vpnclient" "${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service" "${CMAKE_INSTALL_FULL_LIBEXECDIR}/softether/vpnclient/vpnclient")