mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-14 18:48:36 -07:00
Beginning CMake configuration for ZT
Only tested on Windows so far
This commit is contained in:
parent
af5d3a7f0b
commit
0b3b5f6174
111 changed files with 19586 additions and 36 deletions
|
@ -1,12 +1,78 @@
|
|||
# CMake build script for libzerotiercore.a
|
||||
# CMake build script for ZeroTier One
|
||||
|
||||
cmake_minimum_required (VERSION 2.8)
|
||||
project (zerotiercore)
|
||||
project (zerotier-one)
|
||||
|
||||
set (PROJ_DIR ${PROJECT_SOURCE_DIR})
|
||||
set (ZT_DEFS -std=c++11)
|
||||
option(BUILD_CENTRAL_CONTROLLER "Build ZeroTier Central Controller" OFF)
|
||||
|
||||
file(GLOB core_src_glob ${PROJ_DIR}/node/*.cpp)
|
||||
add_library(zerotiercore STATIC ${core_src_glob})
|
||||
if (BUILD_CENTRAL_CONTROLLER)
|
||||
find_package(PostgreSQL REQUIRED)
|
||||
|
||||
target_compile_options(zerotiercore PRIVATE ${ZT_DEFS})
|
||||
set(ENABLE_SSL_SUPPORT OFF)
|
||||
set(BUILD_SHARED_LIBS OFF)
|
||||
set(BUILD_EXAMPLES OFF)
|
||||
set(BUILD_TOOLS OFF)
|
||||
set(BUILD_TESTS OFF)
|
||||
set(BUILD_API_DOCS OFF)
|
||||
add_subdirectory("ext/librabbitmq")
|
||||
endif(BUILD_CENTRAL_CONTROLLER)
|
||||
|
||||
if(CMAKE_BUILD_TYPE EQUAL "Debug")
|
||||
add_definitions(-DZT_TRACE)
|
||||
endif(CMAKE_BUILD_TYPE EQUAL "Debug")
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DNOMINMAX)
|
||||
if(CMAKE_BUILD_TYPE EQUAL "Debug")
|
||||
add_definitions(-DZT_WIN_RUN_IN_CONSOLE)
|
||||
endif(CMAKE_BUILD_TYPE EQUAL "Debug")
|
||||
endif(WIN32)
|
||||
|
||||
|
||||
add_subdirectory(node)
|
||||
add_subdirectory(controller)
|
||||
add_subdirectory(osdep)
|
||||
add_subdirectory(service)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-DNOMINMAX)
|
||||
endif(WIN32)
|
||||
|
||||
set(libs
|
||||
zt_controller
|
||||
zt_core
|
||||
zt_osdep
|
||||
zt_service
|
||||
)
|
||||
|
||||
set(src
|
||||
one.cpp
|
||||
"ext/http-parser/http_parser.c"
|
||||
)
|
||||
set(headers
|
||||
"ext/http-parser/http_parser.h"
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(libs ${libs} wsock32 ws2_32 rpcrt4 iphlpapi)
|
||||
set(src
|
||||
${src}
|
||||
"windows/ZeroTierOne/ServiceBase.cpp"
|
||||
"windows/ZeroTierOne/ServiceInstaller.cpp"
|
||||
"windows/ZeroTierOne/ZeroTierOneService.cpp"
|
||||
"windows/ZeroTierOne/ZeroTierOne.rc"
|
||||
)
|
||||
set(headers
|
||||
${headers}
|
||||
"windows/ZeroTierOne/ServiceBase.h"
|
||||
"windows/ZeroTierOne/ServiceInstaller.h"
|
||||
"windows/ZeroTierOne/ZeroTierOneService.h"
|
||||
)
|
||||
endif(WIN32)
|
||||
|
||||
if(BUILD_CENTRAL_CONTROLLER)
|
||||
set(libs ${libs} rabbitmq-static ${PostgreSQL_LIBRARIES})
|
||||
endif(BUILD_CENTRAL_CONTROLLER)
|
||||
|
||||
add_executable(${PROJECT_NAME} ${src} ${headers})
|
||||
target_link_libraries(${PROJECT_NAME} ${libs})
|
Loading…
Add table
Add a link
Reference in a new issue