lokinet/daemon/CMakeLists.txt

55 lines
2.1 KiB
CMake
Raw Normal View History

set(EXE lokinet)
set(EXE_SRC main.cpp)
2019-10-07 10:15:45 +00:00
set(CTL lokinetctl)
set(CTL_SRC lokinetctl.cpp)
if(TRACY_ROOT)
list(APPEND EXE_SRC ${TRACY_ROOT}/TracyClient.cpp)
endif()
if(SHADOW)
set(LOKINET_SHADOW shadow-plugin-${SHARED_LIB})
set(LOKINET_SHADOW_LIBS ${SHARED_LIB})
add_shadow_plugin(${LOKINET_SHADOW} ${EXE_SRC})
target_link_libraries(${LOKINET_SHADOW} ${LOKINET_SHADOW_LIBS})
target_include_directories(${LOKINET_SHADOW} PUBLIC ${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/llarp ${PROJECT_SOURCE_DIR}/crypto/include)
else()
2019-10-07 10:15:45 +00:00
if(WIN32 AND NOT MSVC_VERSION)
list(APPEND EXE_SRC ../llarp/win32/version.rc)
list(APPEND CTL_SRC ../llarp/win32/version.rc)
2019-10-07 10:15:45 +00:00
endif()
add_executable(${EXE} ${EXE_SRC})
add_executable(${CTL} ${CTL_SRC})
2019-12-14 01:20:45 +00:00
target_compile_definitions(${EXE} PRIVATE -DVERSIONTAG=${GIT_VERSION_REAL})
target_compile_definitions(${CTL} PRIVATE -DVERSIONTAG=${GIT_VERSION_REAL})
add_log_tag(${EXE})
2019-10-07 10:15:45 +00:00
add_log_tag(${CTL})
install(TARGETS ${EXE} RUNTIME DESTINATION bin)
2019-10-07 10:15:45 +00:00
install(TARGETS ${CTL} RUNTIME DESTINATION bin)
if(WIN32)
2020-01-10 19:59:45 +00:00
# install(PROGRAMS ${CMAKE_SOURCE_DIR}/win32-setup/lokinet-bootstrap.exe DESTINATION bin)
else()
install(PROGRAMS ${CMAKE_SOURCE_DIR}/lokinet-bootstrap DESTINATION bin)
endif()
if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
install(CODE "execute_process(COMMAND setcap cap_net_admin,cap_net_bind_service=+eip ${CMAKE_INSTALL_PREFIX}/bin/lokinet)")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
target_link_directories(${EXE} PRIVATE /usr/local/lib)
2019-10-07 10:15:45 +00:00
target_link_directories(${CTL} PRIVATE /usr/local/lib)
endif()
2020-01-28 21:55:36 +00:00
target_link_libraries(${EXE} PUBLIC ${EXE_LIBS} ${LIBS} ${CRYPTOGRAPHY_LIB})
target_link_libraries(${CTL} PUBLIC ${EXE_LIBS} ${LIBS} ${CRYPTOGRAPHY_LIB})
if(CURL_FOUND)
2019-10-07 10:15:45 +00:00
target_include_directories(${CTL} PRIVATE ${CURL_INCLUDE_DIRS})
target_link_libraries(${CTL} PRIVATE ${CURL_LIBRARIES})
target_compile_definitions(${CTL} PRIVATE -DWITH_CURL=1)
endif(CURL_FOUND)
endif(SHADOW)