2018-11-27 07:26:21 +03:00
|
|
|
set(COMPONENT_NAME "Bridge")
|
|
|
|
set(COMPONENT_INTERNAL_NAME "vpnbridge")
|
2018-10-24 20:23:07 +03:00
|
|
|
|
2018-11-18 06:18:42 +03:00
|
|
|
if(WIN32)
|
2021-03-27 02:33:20 +03:00
|
|
|
add_executable(vpnbridge WIN32
|
|
|
|
"vpnbridge.c"
|
|
|
|
|
|
|
|
"${TOP_DIRECTORY}/src/BuildFiles/Manifests/common.manifest"
|
|
|
|
)
|
2020-07-26 00:13:38 +03:00
|
|
|
|
2018-11-18 06:18:42 +03:00
|
|
|
set_target_properties(vpnbridge
|
|
|
|
PROPERTIES
|
|
|
|
PDB_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
)
|
2018-11-27 07:26:21 +03:00
|
|
|
|
|
|
|
get_filename_component(COMPONENT_FILE_NAME vpnbridge NAME)
|
|
|
|
set(COMPONENT_FILE_NAME "${COMPONENT_FILE_NAME}.exe")
|
|
|
|
|
2020-07-20 19:31:41 +03:00
|
|
|
configure_file("${TOP_DIRECTORY}/src/BuildFiles/VerScript/ver.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
|
|
|
target_sources(vpnbridge PRIVATE "vpnbridge.rc" "${CMAKE_CURRENT_BINARY_DIR}/ver.rc")
|
2020-07-26 00:13:38 +03:00
|
|
|
else()
|
|
|
|
add_executable(vpnbridge vpnbridge.c)
|
2018-11-18 06:18:42 +03:00
|
|
|
endif()
|
|
|
|
|
2020-07-26 00:13:38 +03:00
|
|
|
set_target_properties(vpnbridge
|
|
|
|
PROPERTIES
|
|
|
|
ARCHIVE_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
LIBRARY_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
RUNTIME_OUTPUT_DIRECTORY "${BUILD_DIRECTORY}"
|
|
|
|
)
|
|
|
|
|
2021-07-07 09:08:12 +03:00
|
|
|
target_link_libraries(vpnbridge cedar)
|
2018-10-18 03:02:17 +03:00
|
|
|
|
2018-10-24 20:23:07 +03:00
|
|
|
if(UNIX)
|
|
|
|
# Copy binary and "hamcore.se2" to /usr/lib(exec)/softether/, install launch script and systemd service
|
|
|
|
install(TARGETS vpnbridge
|
|
|
|
COMPONENT "vpnbridge"
|
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnbridge"
|
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE
|
|
|
|
)
|
2018-10-18 03:02:17 +03:00
|
|
|
|
2018-10-24 20:23:07 +03:00
|
|
|
install(FILES "${BUILD_DIRECTORY}/hamcore.se2"
|
2018-10-22 08:55:12 +03:00
|
|
|
COMPONENT "vpnbridge"
|
2018-10-24 20:23:07 +03:00
|
|
|
DESTINATION "${CMAKE_INSTALL_LIBEXECDIR}/softether/vpnbridge"
|
2018-10-22 08:55:12 +03:00
|
|
|
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ
|
|
|
|
)
|
2018-10-24 20:23:07 +03:00
|
|
|
|
2020-06-30 06:04:35 +03:00
|
|
|
install_wrapper_script("vpnbridge")
|
2019-10-29 18:33:28 +03:00
|
|
|
if(NOT "${CMAKE_INSTALL_SYSTEMD_UNITDIR}" STREQUAL "")
|
2020-06-30 08:22:37 +03:00
|
|
|
install_unit_file("vpnbridge")
|
2018-10-24 20:23:07 +03:00
|
|
|
endif()
|
2018-10-22 08:55:12 +03:00
|
|
|
endif()
|