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

CMake: add support for Windows (Visual C++ 2017 toolset)

This commit is contained in:
Davide Beatrici
2018-10-24 19:23:07 +02:00
parent 5fe90bb180
commit c1f522c10e
16 changed files with 381 additions and 172 deletions

View File

@ -1,4 +1,10 @@
add_executable(vpnclient vpncsvc.c)
set(VPNCLIENT_SOURCES vpncsvc.c vpncsvc.h)
if(WIN32)
set(VPNCLIENT_SOURCES ${VPNCLIENT_SOURCES} vpnclient.rc)
endif()
add_executable(vpnclient ${VPNCLIENT_SOURCES})
set_target_properties(vpnclient
PROPERTIES
@ -9,25 +15,27 @@ set_target_properties(vpnclient
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")
if(EXISTS "/lib/systemd/system")
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service)
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service
if(UNIX)
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script and systemd service
install(TARGETS vpnclient
COMPONENT "vpnclient"
DESTINATION "/lib/systemd/system"
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")
if(EXISTS "/lib/systemd/system")
configure_file(${CMAKE_SOURCE_DIR}/systemd/softether-vpnclient.service ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service)
install(FILES ${CMAKE_BINARY_DIR}/systemd/softether-vpnclient.service
COMPONENT "vpnclient"
DESTINATION "/lib/systemd/system"
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
)
endif()
endif()