diff --git a/.gitignore b/.gitignore index 2a4e0f8..4360fac 100644 --- a/.gitignore +++ b/.gitignore @@ -10,10 +10,10 @@ /build.ninja /catch.hpp /cmake_install.cmake -/example_client /html /json.hpp /latex +/libndt-client /libndt.a /rules.ninja /tests diff --git a/CMakeLists.txt b/CMakeLists.txt index 029503b..96e0dc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -129,6 +129,8 @@ target_include_directories( ${CURL_INCLUDE_DIRS} ) target_link_libraries(ndt ${CURL_LIBRARIES}) +add_executable(libndt-client libndt-client.cpp) +target_link_libraries(libndt-client ndt) install( FILES libndt.hpp @@ -141,6 +143,12 @@ install( DESTINATION lib/measurement_kit/ ) +install( + TARGETS + libndt-client + DESTINATION + bin +) if("${WIN32}" OR "${MINGW}") target_link_libraries(ndt ws2_32 "${_EXTRA_LIBS}") if ("${MINGW}") @@ -159,8 +167,6 @@ set(BUILD_TESTING "ON" CACHE BOOL "Whether to build tests") if(${BUILD_TESTING} AND ${LIBNDT_ENABLE_TESTS}) enable_testing() - add_executable(example_client example_client.cpp) - target_link_libraries(example_client ndt) add_executable( tests curlx_test.cpp @@ -176,11 +182,11 @@ if(${BUILD_TESTING} AND ${LIBNDT_ENABLE_TESTS}) if(${CURL_FOUND}) # Some tests require cURL for mlab-ns add_test( NAME simple_download_test - COMMAND example_client --verbose --download + COMMAND libndt-client --verbose --download ) add_test( NAME simple_upload_test - COMMAND example_client --verbose --json --upload + COMMAND libndt-client --verbose --json --upload ) endif() endif() diff --git a/README.md b/README.md index 3fda7e1..ddc02c8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ int main() { See [codedocs.xyz/measurement-kit/libndt]( https://codedocs.xyz/measurement-kit/libndt/) for API documentation. See -[example_client.cpp](example_client.cpp) for a usage example. See +[libndt-client.cpp](libndt-client.cpp) for a usage example. See [libndt.hpp](libndt.hpp) for the full API. ## Clone diff --git a/example_client.cpp b/libndt-client.cpp similarity index 98% rename from example_client.cpp rename to libndt-client.cpp index a3f7b92..9181e0c 100644 --- a/example_client.cpp +++ b/libndt-client.cpp @@ -14,7 +14,7 @@ static void usage() { std::clog << "\n"; - std::clog << "Usage: client [options] []\n"; + std::clog << "Usage: libndt-client [options] []\n"; std::clog << "\n"; std::clog << " --download : run download test\n"; std::clog << " --download-ext : run multi-stream download test\n";