Skip to content

Commit ef7aa06

Browse files
Merge pull request #9 from NikolasK-source/main
Release v1.1.1
2 parents b93c5cf + 019d7a3 commit ef7aa06

File tree

4 files changed

+14
-13
lines changed

4 files changed

+14
-13
lines changed

CMakeLists.txt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ cmake_minimum_required(VERSION 3.13.4 FATAL_ERROR)
44
# ======================================================================================================================
55

66
# project
7-
project(Modbus_TCP_client_shm LANGUAGES CXX VERSION 1.1.0)
7+
project(Modbus_TCP_client_shm LANGUAGES CXX VERSION 1.1.1)
88

99
# settings
10-
set(Target "Modbus_TCP_client_shm") # Executable name (without file extension!)
10+
set(Target "modbus-tcp-client-shm") # Executable name (without file extension!)
1111
set(STANDARD 17) # C++ Standard
1212
set(ARCHITECTURE "native") # CPU architecture to optimize for (only relevant if OPTIMIZE_FOR_ARCHITECTURE is ON)
1313

@@ -41,6 +41,7 @@ endif()
4141

4242
# add executable
4343
add_executable(${Target})
44+
install(TARGETS ${Target})
4445

4546
# set source and libraries directory
4647
add_subdirectory("src")
@@ -53,9 +54,12 @@ set_target_properties(${Target} PROPERTIES
5354
CXX_EXTENSIONS ${COMPILER_EXTENSIONS}
5455
)
5556

56-
# project version and name
57+
# compiler definitions
5758
target_compile_definitions(${Target} PUBLIC "PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}\"")
5859
target_compile_definitions(${Target} PUBLIC "PROJECT_NAME=\"${CMAKE_PROJECT_NAME}\"")
60+
target_compile_definitions(${Target} PUBLIC "COMPILER_INFO=\"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\"")
61+
target_compile_definitions(${Target} PUBLIC "SYSTEM_INFO=\"${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR}\"")
62+
5963

6064
# options that are valid for gcc and clang
6165
function(commonopts)
@@ -177,7 +181,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
177181
clangwarn()
178182
else()
179183
target_compile_options(${Target} PUBLIC -w)
180-
endif()
184+
endif()
181185

182186
elseif(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
183187
# compiler specific defines

network.koesling.modbus-tcp-client-shm.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id: network.koesling.modbus-tcp-client-shm
22
runtime: org.freedesktop.Platform
33
runtime-version: '21.08'
44
sdk: org.freedesktop.Sdk
5-
command: Modbus_TCP_client_shm
5+
command: modbus-tcp-client-shm
66
finish-args:
77
- --device=shm
88
- --share=network
@@ -16,9 +16,7 @@ modules:
1616
- cmake --build build
1717

1818
# install
19-
- mkdir -p "${FLATPAK_DEST}/bin"
20-
- cp build/Modbus_TCP_client_shm ${FLATPAK_DEST}/bin
21-
- ls -lah ${FLATPAK_DEST}
19+
- install -D -m 755 -t ${FLATPAK_DEST}/bin build/modbus-tcp-client-shm
2220
sources:
2321
- type: git
2422
branch: release

network.koesling.test-modbus-tcp-client-shm.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ id: network.koesling.test-modbus-tcp-client-shm
22
runtime: org.freedesktop.Platform
33
runtime-version: '21.08'
44
sdk: org.freedesktop.Sdk
5-
command: Modbus_TCP_client_shm
5+
command: modbus-tcp-client-shm
66
finish-args:
77
- --device=shm
88
- --share=network
@@ -16,9 +16,7 @@ modules:
1616
- cmake --build build
1717

1818
# install
19-
- mkdir -p "${FLATPAK_DEST}/bin"
20-
- cp build/Modbus_TCP_client_shm ${FLATPAK_DEST}/bin
21-
- ls -lah ${FLATPAK_DEST}
19+
- install -D -m 755 -t ${FLATPAK_DEST}/bin build/modbus-tcp-client-shm
2220
sources:
2321
- type: dir
2422
path: .

src/main.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,8 @@ int main(int argc, char **argv) {
165165

166166
// print usage
167167
if (args.count("version")) {
168-
std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION
168+
std::cout << PROJECT_NAME << ' ' << PROJECT_VERSION << " (compiled with " << COMPILER_INFO << " on "
169+
<< SYSTEM_INFO << ')'
169170
#ifndef OS_LINUX
170171
<< "-nonlinux"
171172
#endif

0 commit comments

Comments
 (0)