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"
|
||||
LANGUAGES CXX C)
|
||||
|
||||
|
||||
if(${CMAKE_VERSION} VERSION_LESS 3.15)
|
||||
cmake_policy(VERSION ${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION})
|
||||
else()
|
||||
cmake_policy(VERSION 3.15)
|
||||
endif()
|
||||
|
||||
if(NOT PACKAGE_STATIC)
|
||||
find_program(
|
||||
GO go
|
||||
HINTS "/usr/local/go/bin" "C:/go/bin"
|
||||
|
@ -234,8 +234,16 @@ add_custom_target(
|
|||
COMMENT "Compiling Go Code..."
|
||||
)
|
||||
add_dependencies(zerotier zt_osdep zt_core zt_controller zt_service_io_core)
|
||||
|
||||
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(IS_DIRECTORY /lib/systemd/system)
|
||||
install(
|
||||
|
|
Loading…
Add table
Reference in a new issue