Skip to content

Commit 4d830df

Browse files
Merge branch 'main' into release
Release 1.0.3
2 parents 6436e65 + 7d59682 commit 4d830df

8 files changed

Lines changed: 98 additions & 27 deletions

File tree

.gitignore

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
# general
22
build*
3-
docs/
3+
docs/*
4+
5+
!docs/index.md
6+
!docs/_config.yml
47

58
# editor files
69

CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.13.4 FATAL_ERROR)
44
# ======================================================================================================================
55

66
# project
7-
project(SHM_Random LANGUAGES CXX VERSION 1.0.2)
7+
project(SHM_Random LANGUAGES CXX VERSION 1.0.3)
88

99
# settings
1010
set(Target "SHM_Random") # Executable name (without file extension!)
@@ -57,6 +57,7 @@ set_target_properties(${Target} PROPERTIES
5757

5858
# project version
5959
target_compile_definitions(${Target} PUBLIC "PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}\"")
60+
target_compile_definitions(${Target} PUBLIC "PROJECT_NAME=\"${CMAKE_PROJECT_NAME}\"")
6061

6162
# options that are valid for gcc and clang
6263
function(commonopts)

docs/_config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
theme: jekyll-theme-cayman

docs/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# Shared Memory Random

src/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,13 @@
22
# ======================================================================================================================
33

44
target_sources(${Target} PRIVATE main.cpp)
5+
target_sources(${Target} PRIVATE license.cpp)
56

67

78
# ---------------------------------------- header files (*.jpp, *.h, ...) ----------------------------------------------
89
# ======================================================================================================================
910

11+
target_sources(${Target} PRIVATE license.hpp)
1012

1113

1214
# ---------------------------------------- subdirectories --------------------------------------------------------------

src/license.cpp

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
/*
2+
* Copyright (C) 2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#include "license.hpp"
7+
8+
void print_licenses(std::ostream &o) {
9+
o << "This Application (" << PROJECT_NAME << ' ' << PROJECT_VERSION "): " << std::endl;
10+
o << std::endl;
11+
o << " MIT License" << std::endl;
12+
o << std::endl;
13+
o << " Copyright (c) 2021-2022 Nikolas Koesling" << std::endl;
14+
o << std::endl;
15+
o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
16+
o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
17+
o << " in the Software without restriction, including without limitation the rights" << std::endl;
18+
o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
19+
o << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
20+
o << " furnished to do so, subject to the following conditions:" << std::endl;
21+
o << std::endl;
22+
o << " The above copyright notice and this permission notice shall be included in all" << std::endl;
23+
o << " copies or substantial portions of the Software." << std::endl;
24+
o << std::endl;
25+
o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
26+
o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
27+
o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
28+
o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
29+
o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
30+
o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl;
31+
o << " SOFTWARE." << std::endl;
32+
o << std::endl;
33+
o << std::endl;
34+
o << "cxxopts Library (https://github.com/jarro2783/cxxopts)" << std::endl;
35+
o << std::endl;
36+
o << " MIT License" << std::endl;
37+
o << std::endl;
38+
o << " Copyright (c) 2014 Jarryd Beck" << std::endl;
39+
o << std::endl;
40+
o << " Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
41+
o << " of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
42+
o << " in the Software without restriction, including without limitation the rights" << std::endl;
43+
o << " to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
44+
o << " copies of the Software, and to permit persons to whom the Software is" << std::endl;
45+
o << " furnished to do so, subject to the following conditions:" << std::endl;
46+
o << std::endl;
47+
o << " The above copyright notice and this permission notice shall be included in" << std::endl;
48+
o << " all copies or substantial portions of the Software." << std::endl;
49+
o << std::endl;
50+
o << " THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
51+
o << " IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
52+
o << " FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
53+
o << " AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
54+
o << " LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
55+
o << " OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN" << std::endl;
56+
o << " THE SOFTWARE." << std::endl;
57+
}

src/license.hpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
* Copyright (C) 2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#pragma once
7+
8+
#include <ostream>
9+
10+
/**
11+
* \brief print licences
12+
* @param o output stream used to print licenses
13+
*/
14+
void print_licenses(std::ostream &o);

src/main.cpp

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
/*
2+
* Copyright (C) 2021-2022 Nikolas Koesling <nikolas@koesling.info>.
3+
* This program is free software. You can redistribute it and/or modify it under the terms of the MIT License.
4+
*/
5+
6+
#include "license.hpp"
7+
18
#include <csignal>
29
#include <cxxopts.hpp>
310
#include <fcntl.h>
@@ -55,7 +62,9 @@ int main(int argc, char **argv) {
5562
("h,help",
5663
"print usage")
5764
("v,version",
58-
"print version information");
65+
"print version information")
66+
("license",
67+
"show licenses");
5968
// clang-format on
6069

6170
cxxopts::ParseResult args;
@@ -72,34 +81,17 @@ int main(int argc, char **argv) {
7281
std::cout << std::endl;
7382
std::cout << "This application uses the following libraries:" << std::endl;
7483
std::cout << " - cxxopts by jarro2783 (https://github.com/jarro2783/cxxopts)" << std::endl;
75-
std::cout << std::endl;
76-
std::cout << std::endl;
77-
std::cout << "MIT License:" << std::endl;
78-
std::cout << std::endl;
79-
std::cout << "Copyright (c) 2021-2022 Nikolas Koesling" << std::endl;
80-
std::cout << std::endl;
81-
std::cout << "Permission is hereby granted, free of charge, to any person obtaining a copy" << std::endl;
82-
std::cout << "of this software and associated documentation files (the \"Software\"), to deal" << std::endl;
83-
std::cout << "in the Software without restriction, including without limitation the rights" << std::endl;
84-
std::cout << "to use, copy, modify, merge, publish, distribute, sublicense, and/or sell" << std::endl;
85-
std::cout << "copies of the Software, and to permit persons to whom the Software is" << std::endl;
86-
std::cout << "furnished to do so, subject to the following conditions:" << std::endl;
87-
std::cout << std::endl;
88-
std::cout << "The above copyright notice and this permission notice shall be included in all" << std::endl;
89-
std::cout << "copies or substantial portions of the Software." << std::endl;
90-
std::cout << std::endl;
91-
std::cout << "THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR" << std::endl;
92-
std::cout << "IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY," << std::endl;
93-
std::cout << "FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE" << std::endl;
94-
std::cout << "AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER" << std::endl;
95-
std::cout << "LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM," << std::endl;
96-
std::cout << "OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE" << std::endl;
97-
std::cout << "SOFTWARE." << std::endl;
9884
exit(EX_OK);
9985
}
10086

10187
if (args.count("version")) {
102-
std::cout << exe_name << ' ' << PROJECT_VERSION << std::endl;
88+
std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION << std::endl;
89+
exit(EX_OK);
90+
}
91+
92+
// print licenses
93+
if (args.count("license")) {
94+
print_licenses(std::cout);
10395
exit(EX_OK);
10496
}
10597

0 commit comments

Comments
 (0)