mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-07 13:03:45 +02:00
enable -DPACKAGE_STATIC=1 builds
Only configures the project for packaging of the statically built binary placed in build/
This commit is contained in:
parent
7c6f5e2c37
commit
09a8b66d3b
1 changed files with 182 additions and 174 deletions
|
@ -17,13 +17,13 @@ project(zerotier
|
||||||
DESCRIPTION "ZeroTier Network Hypervisor"
|
DESCRIPTION "ZeroTier Network Hypervisor"
|
||||||
LANGUAGES CXX C)
|
LANGUAGES CXX C)
|
||||||
|
|
||||||
|
|
||||||
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
||||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||||
else()
|
else()
|
||||||
cmake_policy(VERSION 3.15)
|
cmake_policy(VERSION 3.15)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(NOT PACKAGE_STATIC)
|
||||||
find_program(
|
find_program(
|
||||||
GO go
|
GO go
|
||||||
HINTS "/usr/local/go/bin" "C:/go/bin"
|
HINTS "/usr/local/go/bin" "C:/go/bin"
|
||||||
|
@ -234,8 +234,16 @@ add_custom_target(
|
||||||
COMMENT "Compiling Go Code..."
|
COMMENT "Compiling Go Code..."
|
||||||
)
|
)
|
||||||
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
|
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
|
||||||
|
|
||||||
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zerotier DESTINATION bin)
|
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/zerotier DESTINATION bin)
|
||||||
|
else(NOT PACKAGE_STATIC)
|
||||||
|
set(STATIC_BINARY ${CMAKE_BINARY_DIR}/zerotier)
|
||||||
|
set(IMPORTED_LOCATION ${CMAKE_BINARY_DIR})
|
||||||
|
add_executable(zerotier IMPORTED GLOBAL)
|
||||||
|
install(PROGRAMS ${STATIC_BINARY} DESTINATION bin)
|
||||||
|
endif(NOT PACKAGE_STATIC)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if("${CMAKE_SYSTEM_NAME}" EQUAL "Linux")
|
if("${CMAKE_SYSTEM_NAME}" EQUAL "Linux")
|
||||||
if(IS_DIRECTORY /lib/systemd/system)
|
if(IS_DIRECTORY /lib/systemd/system)
|
||||||
install(
|
install(
|
||||||
|
|
Loading…
Add table
Reference in a new issue