2019-10-05 15:03:25 +00:00
|
|
|
set(EXE lokinet)
|
|
|
|
set(EXE_SRC main.cpp)
|
2019-10-07 10:15:45 +00:00
|
|
|
set(CTL lokinetctl)
|
|
|
|
set(CTL_SRC lokinetctl.cpp)
|
2019-10-05 15:03:25 +00:00
|
|
|
|
2019-10-07 10:08:47 +00:00
|
|
|
if(TRACY_ROOT)
|
|
|
|
list(APPEND EXE_SRC ${TRACY_ROOT}/TracyClient.cpp)
|
|
|
|
endif()
|
|
|
|
|
2019-10-05 15:03:25 +00:00
|
|
|
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)
|
2019-12-03 22:06:06 +00:00
|
|
|
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-10-05 15:03:25 +00:00
|
|
|
|
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})
|
2019-12-12 02:32:27 +00:00
|
|
|
|
2019-10-05 15:03:25 +00:00
|
|
|
add_log_tag(${EXE})
|
2019-10-07 10:15:45 +00:00
|
|
|
add_log_tag(${CTL})
|
2019-10-05 15:03:25 +00:00
|
|
|
|
|
|
|
install(TARGETS ${EXE} RUNTIME DESTINATION bin)
|
2019-10-07 10:15:45 +00:00
|
|
|
install(TARGETS ${CTL} RUNTIME DESTINATION bin)
|
2019-10-05 15:03:25 +00:00
|
|
|
if(WIN32)
|
2019-12-03 22:06:06 +00:00
|
|
|
install(PROGRAMS ${CMAKE_SOURCE_DIR}/win32-setup/lokinet-bootstrap.exe DESTINATION bin)
|
2019-10-05 15:03:25 +00:00
|
|
|
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)
|
2019-10-05 15:03:25 +00:00
|
|
|
endif()
|
|
|
|
target_link_libraries(${EXE} PUBLIC ${EXE_LIBS} ${LIBS})
|
2019-10-07 10:15:45 +00:00
|
|
|
target_link_libraries(${CTL} PUBLIC ${EXE_LIBS} ${LIBS})
|
2019-10-05 16:48:05 +00:00
|
|
|
|
|
|
|
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)
|
2019-10-05 16:48:05 +00:00
|
|
|
endif(CURL_FOUND)
|
|
|
|
|
2019-10-05 15:03:25 +00:00
|
|
|
endif(SHADOW)
|