Skip to content

Commit 0852021

Browse files
CMakify sample (#8)
1 parent da16d21 commit 0852021

File tree

9 files changed

+20
-163
lines changed

9 files changed

+20
-163
lines changed

CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,8 @@ if(BUILD_TESTING)
4747
add_subdirectory(test)
4848
endif()
4949

50+
if(BUILD_SAMPLES)
51+
add_subdirectory(samples/HubConnectionSample)
52+
endif()
53+
5054
install(DIRECTORY include/ DESTINATION include/)

CMakeSettings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"inheritEnvironments": [ "msvc_x64_x64" ],
88
"buildRoot": "${projectDir}\\out\\build\\${name}",
99
"installRoot": "${projectDir}\\out\\install\\${name}",
10-
"cmakeCommandArgs": "",
10+
"cmakeCommandArgs": "-DBUILD_SAMPLES=true",
1111
"buildCommandArgs": "-v",
1212
"ctestCommandArgs": "",
1313
"cmakeToolchain": "${projectDir}\\submodules\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake",
@@ -19,7 +19,7 @@
1919
"configurationType": "Release",
2020
"buildRoot": "${projectDir}\\out\\build\\${name}",
2121
"installRoot": "${projectDir}\\out\\install\\${name}",
22-
"cmakeCommandArgs": "",
22+
"cmakeCommandArgs": "-DBUILD_SAMPLES=true",
2323
"buildCommandArgs": "-v",
2424
"ctestCommandArgs": "",
2525
"cmakeToolchain": "${projectDir}\\submodules\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake",

include/signalrclient/http_client.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ namespace signalr
1919
class http_request
2020
{
2121
public:
22+
http_request()
23+
: method(http_method::GET), timeout(std::chrono::seconds(120))
24+
{ }
25+
2226
http_method method;
2327
std::map<std::string, std::string> headers;
2428
std::string content;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
set (SOURCES
2+
HubConnectionSample.cpp
3+
)
4+
5+
include_directories(
6+
../../include/signalrclient)
7+
8+
add_executable (HubConnectionSample ${SOURCES})
9+
10+
target_link_libraries(HubConnectionSample signalrclient)

samples/HubConnectionSample/HubConnectionSample.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
// Copyright (c) .NET Foundation. All rights reserved.
22
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
33

4-
#include "stdafx.h"
5-
64
#include <iostream>
75
#include <sstream>
86
#include "hub_connection.h"

samples/HubConnectionSample/HubConnectionSample.vcxproj

Lines changed: 0 additions & 118 deletions
This file was deleted.

samples/HubConnectionSample/HubConnectionSample.vcxproj.filters

Lines changed: 0 additions & 33 deletions
This file was deleted.

samples/HubConnectionSample/stdafx.cpp

Lines changed: 0 additions & 4 deletions
This file was deleted.

samples/HubConnectionSample/stdafx.h

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)