Skip to content
Snippets Groups Projects
Commit c8df4fa6 authored by Nicolas Pope's avatar Nicolas Pope
Browse files

Add missing CMakeLists.txt and improve cmake config for net module

parent 4d412d8c
No related branches found
No related tags found
No related merge requests found
Pipeline #9611 passed
......@@ -6,6 +6,7 @@ include(CheckLanguage)
project (ftl.utu.fi)
include(GNUInstallDirs)
include(CTest)
enable_testing()
......@@ -33,9 +34,6 @@ if (NODE_NPM)
message(STATUS "Found NPM: ${NODE_NPM}")
endif()
include_directories(${GLOG_INCLUDE_DIRS})
# Why is this problematic on some machines?
check_language(CUDA)
if (CUDA_TOOLKIT_ROOT_DIR)
enable_language(CUDA)
......
add_subdirectory(cpp)
# Perform Javascript module tests
if (NODE_NPM)
add_test(
NAME NetJSTests
COMMAND npm test
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/net/js
)
endif()
......@@ -3,7 +3,7 @@ include_directories(${PROJECT_SOURCE_DIR}/net/cpp/include)
#include_directories(${PROJECT_BINARY_DIR})
set(NETSOURCE
add_library(ftlnet
src/net.cpp
src/listener.cpp
src/socket.cpp
......@@ -13,15 +13,20 @@ set(NETSOURCE
src/p2p.cpp
)
#check_include_file("uriparser/Uri.h" HAVE_URI_H)
#if(NOT HAVE_URI_H)
# message(FATAL_ERROR "Uriparser not found")
#endif()
check_function_exists(uriParseSingleUriA HAVE_URIPARSESINGLE)
add_library(ftlnet ${NETSOURCE})
target_include_directories(ftlnet PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE src)
target_link_libraries(ftlnet Threads::Threads glog::glog)
install(TARGETS ftlnet EXPORT ftlnet-config
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
add_executable(net-cli src/main.cpp)
target_link_libraries(net-cli ftlnet glog::glog ${URIPARSER_LIBRARIES} Threads::Threads ${READLINE_LIBRARY} ${UUID_LIBRARIES})
add_dependencies(net-cli ftlnet)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment