Skip to content

Commit 5a71436

Browse files
committed
vc 2017 setup
1 parent bc320a5 commit 5a71436

File tree

8 files changed

+139
-27
lines changed

8 files changed

+139
-27
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/.vs

CMakeLists.txt

Lines changed: 17 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,29 @@
1-
cmake_minimum_required (VERSION 3.0)
1+
cmake_minimum_required(VERSION 3.7)
22

3-
project (sdk-dslink-cpp)
3+
project (sdk-dslink-cpp-poc)
44

5-
set_property (GLOBAL PROPERTY USE_FOLDERS ON)
5+
set(CMAKE_CXX_STANDARD 11)
66

7-
if (WIN32)
8-
9-
#-------------------------------------------------
10-
# Boost
11-
#
12-
13-
set (Boost_DEBUG ON)
14-
set (BOOST_ROOT C:\\local\\boost_1_64_0)
15-
set (BOOST_INCLUDEDIR ${BOOST_ROOT}\\include\\boost-1_64)
7+
set (Boost_DEBUG ON)
168

179
set (Boost_NO_SYSTEM_PATHS ON)
18-
set (Boost_USE_STATIC_LIBS ON)
10+
set (Boost_USE_STATIC_LIBS OFF)
1911
set (Boost_USE_MULTITHREAD ON)
2012
set (Boost_USE_STATIC_RUNTIME OFF)
2113

22-
set (BOOST_LIBS system)
23-
24-
find_package (Boost 1.64.0 REQUIRED COMPONENTS ${BOOST_LIBS})
25-
if (Boost_FOUND)
26-
include_directories (${Boost_INCLUDE_DIRS})
27-
link_directories (${Boost_LIBRARY_DIRS})
28-
endif (Boost_FOUND)
2914

30-
set (USED_LIBS ${BOOST_LIBRARIES})
15+
find_package(OpenSSL REQUIRED)
16+
# include_directories(${OPENSSL_INCLUDE_DIR})
17+
set(EXTRA_LIBS ${EXTRA_LIBS} ${OPENSSL_LIBRARIES})
3118

32-
#-------------------------------------------------
33-
# Build
34-
#
19+
find_package(Boost 1.6 REQUIRED system)
20+
include_directories(${Boost_INCLUDE_DIRS})
21+
set(EXTRA_LIBS ${EXTRA_LIBS} ${Boost_LIBRARIES})
3522

36-
# add_executable (bt_main bt_main.cpp)
37-
# target_link_libraries (bt_main ${USED_LIBS})
23+
set (SOURCE_FILES
24+
message.cpp
25+
connection.cpp)
26+
add_executable(xyz ${SOURCE_FILES})
27+
target_link_libraries(xyz ${EXTRA_LIBS})
3828

39-
endif (WIN32)
29+
# target_compile_features(client PRIVATE cxx_range_for)

CMakeSettings.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
// See https://go.microsoft.com//fwlink//?linkid=834763 for more information about this file.
3+
"configurations": [
4+
// {
5+
// "name": "x86-Debug",
6+
// "generator": "Visual Studio 15 2017",
7+
// "configurationType": "Debug",
8+
// "buildRoot": "${env.LOCALAPPDATA}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
9+
// "cmakeCommandArgs": "",
10+
// "buildCommandArgs": "-m -v:minimal",
11+
// "ctestCommandArgs": "",
12+
// "variables": [
13+
// {
14+
// "name": "CMAKE_TOOLCHAIN_FILE",
15+
// "value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
16+
// }
17+
// ]
18+
19+
// },
20+
// {
21+
// "name": "x86-Release",
22+
// "generator": "Visual Studio 15 2017",
23+
// "configurationType": "Release",
24+
// "buildRoot": "${env.LOCALAPPDATA}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
25+
// "cmakeCommandArgs": "",
26+
// "buildCommandArgs": "-m -v:minimal",
27+
// "ctestCommandArgs": "",
28+
// "variables": [
29+
// {
30+
// "name": "CMAKE_TOOLCHAIN_FILE",
31+
// "value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
32+
// }
33+
// ]
34+
35+
// },
36+
{
37+
"name": "x64-Debug",
38+
"generator": "Visual Studio 15 2017 Win64",
39+
"configurationType": "Debug",
40+
"buildRoot": "${env.LOCALAPPDATA}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
41+
"cmakeCommandArgs": "",
42+
"buildCommandArgs": "-m -v:minimal",
43+
"ctestCommandArgs": "",
44+
"variables": [
45+
{
46+
"name": "CMAKE_TOOLCHAIN_FILE",
47+
"value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
48+
}
49+
]
50+
51+
},
52+
{
53+
"name": "x64-Release",
54+
"generator": "Visual Studio 15 2017 Win64",
55+
"configurationType": "Release",
56+
"buildRoot": "${env.LOCALAPPDATA}\\CMakeBuild\\${workspaceHash}\\build\\${name}",
57+
"cmakeCommandArgs": "",
58+
"buildCommandArgs": "-m -v:minimal",
59+
"ctestCommandArgs": "",
60+
"variables": [
61+
{
62+
"name": "CMAKE_TOOLCHAIN_FILE",
63+
"value": "C:\\vcpkg\\scripts\\buildsystems\\vcpkg.cmake"
64+
}
65+
]
66+
67+
}
68+
]
69+
}

README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
## Windows 10 Setup
2+
3+
1. install visual studio 2017
4+
1. clone `https://github.com/Microsoft/vcpkg.git`
5+
into C:\vcpkg
6+
1. run `.\bootstrap-vcpkg.bat` in vcpkg folder
7+
1. install packages
8+
```
9+
.\vcpkg install boost:x64-windows
10+
.\vcpkg install boost::x64-windows-static
11+
12+
.\vcpkg install openssl:x64-windows
13+
.\vcpkg install openssl:x64-windows-static
14+
```
15+
1. run `.\vcpkg integrate install`
16+
1. In visual studio, use `file-open-folder..` instead of creating project
17+
18+

connection.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include "connection.h"
2+
3+
bool Connection::send(boost::asio::const_buffer buffer)
4+
{
5+
return false;
6+
}
7+
8+
int main() {
9+
Connection conn;
10+
11+
return 0;
12+
}

connection.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//#pragma once
2+
3+
#include <boost/asio.hpp>
4+
5+
class Connection {
6+
bool send(boost::asio::const_buffer);
7+
};
8+

message.cpp

Whitespace-only changes.

message.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#pragma once
2+
3+
enum MessageType {
4+
5+
};
6+
7+
class Message {
8+
};
9+
10+
class MessageHeader {
11+
};
12+
13+
class MessageFactory {
14+
};

0 commit comments

Comments
 (0)