Skip to content

Commit f81b50c

Browse files
committed
Add quick install all dependencies scripts
1 parent 037efa9 commit f81b50c

File tree

8 files changed

+95
-7
lines changed

8 files changed

+95
-7
lines changed

.gitignore

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
.idea
2-
build
3-
cmake-build-debug
42
.vscode
53
.vs
6-
CMakeSettings.json
74
.cache
5+
build
6+
cmake-build-debug
7+
CMakeSettings.json
8+
CMakeUserPresets.json
9+
vcpkg_installled

conanfile.txt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
[requires]
2-
gtest/1.10.0
3-
openssl/1.1.1t
4-
#c-ares/1.17.1
5-
spdlog/1.12.0
2+
spdlog/1.13.0
3+
c-ares/1.26.0
4+
gtest/1.14.0
5+
openssl/3.2.0
6+
#botan/3.2.0
67

78
[generators]
9+
CMakeDeps
810
CMakeToolchain
911

1012
[options]

deps.macos-12.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
# This script is used to install dependencies on MacOS 12.0 or newer
4+
# botan v3
5+
brew install googletest spdlog c-ares openssl@3 botan

deps.rockylinux-9.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
# This script is used to install dependencies on RockyLinux 9 or newer
4+
dnf install epel-release -y
5+
dnf update
6+
dnf install gtest-devel spdlog-devel fmt-devel c-ares-devel openssl-devel -y

deps.ubuntu-20.04.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
# This script is used to install dependencies on Ubuntu 20.04 or newer
4+
5+
# Installing packages might fail as the github image becomes outdated
6+
sudo apt update
7+
sudo apt install libgtest-dev libspdlog-dev libfmt-dev libc-ares-dev openssl libssl-dev -y

deps.windows.conan.ps1

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# This script is used for windows VS2022
2+
3+
# If not found python
4+
if (!(Get-Command python -ErrorAction SilentlyContinue)){
5+
Write-Host -ForegroundColor:Red "Install python first !!!"
6+
exit
7+
}
8+
9+
# If not found conan,Install conan
10+
if (!(Get-Command conan -ErrorAction SilentlyContinue)){
11+
pip install conan
12+
}
13+
14+
conan profile detect --force
15+
16+
# Install Release
17+
conan install . --output-folder=build --build=missing `
18+
--settings=build_type=Release --settings=compiler="msvc" --settings=compiler.version=193 --settings=compiler.runtime="dynamic" --settings=compiler.cppstd=14
19+
20+
# Install Debug
21+
conan install . --output-folder=build --build=missing `
22+
--settings=build_type=Debug --settings=compiler="msvc" --settings=compiler.version=193 --settings=compiler.runtime="dynamic" --settings=compiler.cppstd=14

deps.windows.vcpkg.ps1

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# This script is used for windows VS2022
2+
3+
$current_path= (Get-Location).path
4+
5+
# If not found vckpkg,Install vcpkg
6+
if (!(Get-Command vcpkg -ErrorAction SilentlyContinue)) {
7+
Write-Host -ForegroundColor:Yellow "If it is the first time to install vcpkg, it may take several minutes. Please wait..."
8+
9+
cd c:\
10+
git clone https://github.com/Microsoft/vcpkg.git
11+
cd vcpkg
12+
.\bootstrap-vcpkg.bat
13+
14+
$path = [Environment]::GetEnvironmentVariable('Path', 'Machine')
15+
$newpath = 'c:\vcpkg;' + $path
16+
[Environment]::SetEnvironmentVariable('Path', $newpath, 'Machine')
17+
[Environment]::SetEnvironmentVariable('VCPKG_ROOT', 'c:\vcpkg', 'Machine')
18+
}
19+
20+
if (!(Get-Command vcpkg -ErrorAction SilentlyContinue)) {
21+
Write-Host -ForegroundColor:Red "Install vcpkg failed !!!"
22+
23+
} else {
24+
cd $current_path
25+
# update baseline
26+
# vcpkg x-update-baseline --add-initial-baseline
27+
vcpkg install
28+
29+
Write-Host -ForegroundColor:Green "Now, you can use CMake by -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%/scripts/buildsystems/vcpkg.cmake"
30+
}

vcpkg.json

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"name": "trantor",
3+
"version-semver": "1.5.17",
4+
"description": "A non-blocking I/O cross-platform TCP network library, using C++14",
5+
"homepage": "https://github.com/an-tao/trantor",
6+
"license": "BSD-2-Clause",
7+
"dependencies": [
8+
"spdlog",
9+
"c-ares",
10+
"openssl",
11+
"botan",
12+
"gtest"
13+
]
14+
}

0 commit comments

Comments
 (0)