Skip to content

Commit 2cd37a8

Browse files
add beta tag to version number
1 parent fd1d142 commit 2cd37a8

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

CMakeLists.txt

Lines changed: 9 additions & 2 deletions
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(Modbus_TCP_client_shm LANGUAGES CXX VERSION 1.2.3)
7+
project(Modbus_TCP_client_shm LANGUAGES CXX VERSION 1.3.0)
88

99
# settings
1010
set(Target "modbus-tcp-client-shm") # Executable name (without file extension!)
@@ -23,6 +23,8 @@ option(CLANG_TIDY "use clang-tidy" OFF)
2323
option(OPTIMIZE_FOR_ARCHITECTURE "enable optimizations for specified architecture" OFF)
2424
option(LTO_ENABLED "enable interprocedural and link time optimizations" ON)
2525
option(COMPILER_EXTENSIONS "enable compiler specific C++ extensions" OFF)
26+
option(BETA_VERSION "version is a beta version" ON)
27+
set(BETA_VERSION_NR 1)
2628

2729
# ======================================================================================================================
2830
# ======================================================================================================================
@@ -55,7 +57,12 @@ set_target_properties(${Target} PROPERTIES
5557
)
5658

5759
# compiler definitions
58-
target_compile_definitions(${Target} PUBLIC "PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}\"")
60+
if(BETA_VERSION)
61+
target_compile_definitions(${Target} PUBLIC "PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}-beta${BETA_VERSION_NR}\"")
62+
else()
63+
target_compile_definitions(${Target} PUBLIC "PROJECT_VERSION=\"${CMAKE_PROJECT_VERSION}\"")
64+
endif()
65+
5966
target_compile_definitions(${Target} PUBLIC "PROJECT_NAME=\"${CMAKE_PROJECT_NAME}\"")
6067
target_compile_definitions(${Target} PUBLIC "COMPILER_INFO=\"${CMAKE_CXX_COMPILER_ID} ${CMAKE_CXX_COMPILER_VERSION}\"")
6168
target_compile_definitions(${Target} PUBLIC "SYSTEM_INFO=\"${CMAKE_SYSTEM_NAME} ${CMAKE_SYSTEM_VERSION} ${CMAKE_HOST_SYSTEM_PROCESSOR}\"")

0 commit comments

Comments
 (0)