Commit 3ae87b39 authored by Arnaud Blanchard's avatar Arnaud Blanchard

Update the demo

parent f4a81e7f
...@@ -11,32 +11,14 @@ ...@@ -11,32 +11,14 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(t_net_reader) project(t_net_reader)
add_definitions(-Wall -Wno-multichar)
find_package(blc_network REQUIRED)
if ( ${BLAAR_DIR} STREQUAL "") add_definitions(${BL_DEFINITIONS})
find_path(BLC_CORE_INCLUDE_DIRS blc_tools.h HINTS blc) include_directories(include ${BL_INCLUDE_DIRS})
find_path(BLC_CHANNEL_INCLUDE_DIRS blc_channel.h HINTS blc)
find_library(BLC_CORE_LIBRARIES blc_core)
find_library(BLC_CORE_LIBRARIES blc_channel)
else()
add_subdirectory(${BLAAR_DIR}/blc_core blc_core)
add_subdirectory(${BLAAR_DIR}/blc_channel blc_channel)
endif()
include_directories(include ${BLC_CORE_INCLUDE_DIRS} ${BLC_CHANNEL_INCLUDE_DIRS})
#Both librairies have the same name only the extension will change depending on the OS #Both librairies have the same name only the extension will change depending on the OS
add_executable(${PROJECT_NAME} main.cpp) add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} ${BLC_CORE_LIBRARIES} ${BLC_CHANNEL_LIBRARIES}) target_link_libraries(${PROJECT_NAME} ${BL_LIBRARIES})
#Add a target to generate documentation
#find_package(Doxygen)
#if(DOXYGEN_FOUND)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in doxyfile.doxy) #Replace the CMAKE variables in the Doxyfile
#add_custom_target(doc_${PROJECT_NAME} ALL ${DOXYGEN_EXECUTABLE} doxyfile.doxy COMMENT "Generating API documentation with Doxygen" VERBATIM )
#else(DOXYGEN_FOUND)
#message("You need to install doxygen to generate the doc.")
#endif(DOXYGEN_FOUND)
...@@ -9,12 +9,12 @@ ...@@ -9,12 +9,12 @@
#define SIZE 1024 #define SIZE 1024
static void receive_cb(char *buffer, size_t size, void *arg, blc_server *server){ static void receive_cb(blc_server *server){
struct timeval local_timer, *timer; struct timeval local_timer, *timer;
gettimeofday(&local_timer, NULL); gettimeofday(&local_timer, NULL);
timer=(struct timeval*)buffer; timer=(struct timeval*)server->data;
fprintf(stderr, "Received %lu' bytes, text '%s' after %luµs\n", size, buffer+sizeof(*timer), (local_timer.tv_sec-timer->tv_sec)*1000000+(local_timer.tv_usec-timer->tv_usec)); fprintf(stderr, "Received %lu' bytes, text '%s' after %luµs\n", server->size, server->chars+sizeof(*timer), (local_timer.tv_sec-timer->tv_sec)*1000000+(local_timer.tv_usec-timer->tv_usec));
server->send_back_buffer((void*)"coucou", 6); server->send_back_buffer((void*)"coucou", 6);
} }
......
...@@ -11,27 +11,12 @@ ...@@ -11,27 +11,12 @@
cmake_minimum_required(VERSION 2.6) cmake_minimum_required(VERSION 2.6)
project(t_net_writer) project(t_net_writer)
add_definitions(-Wall -Wno-multichar)
find_package(blc_network REQUIRED)
add_definitions(${BL_DEFINITIONS})
if (BLAAR_DIR) include_directories(${BL_INCLUDE_DIRS})
add_subdirectory(${BLAAR_DIR}/blc_core blc_core)
message(${BLC_CORE_INCLUDE_DIRS})
include_directories(${BLC_CORE_INCLUDE_DIRS})
else()
message("Outside blaar dir not yet managed")
endif()
add_executable(${PROJECT_NAME} main.cpp) add_executable(${PROJECT_NAME} main.cpp)
target_link_libraries(${PROJECT_NAME} ${BLC_CORE_LIBRARIES}) target_link_libraries(${PROJECT_NAME} ${BL_LIBRARIES})
#Add a target to generate documentation
#find_package(Doxygen)
#if(DOXYGEN_FOUND)
#configure_file(${CMAKE_CURRENT_SOURCE_DIR}/doxyfile.in doxyfile.doxy) #Replace the CMAKE variables in the Doxyfile
#add_custom_target(doc_${PROJECT_NAME} ALL ${DOXYGEN_EXECUTABLE} doxyfile.doxy COMMENT "Generating API documentation with Doxygen" VERBATIM )
#else(DOXYGEN_FOUND)
#message("You need to install doxygen to generate the doc.")
#endif(DOXYGEN_FOUND)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment