Skip to content

Commit

Permalink
Use full version numbering by default.
Browse files Browse the repository at this point in the history
Version numbers including patch and tweaks are now
standard. That means versions can be MAJOR.MINOR.PATCH.TWEAK

See https://cmake.org/cmake/help/latest/command/project.html for some
more details.
  • Loading branch information
bsamseth committed Nov 25, 2018
1 parent 5300921 commit 506179c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
13 changes: 4 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@

cmake_minimum_required(VERSION 3.1.3)

# Set project name here.
project(CPP_BOILERPLATE)
enable_language(C CXX)

# Set version number (change as needed). These definitions are available
# by including "exampleConfig.h" in the source.
# See exampleConfig.h.in for some more details.
set(PROJECT_VERSION_MAJOR 1)
set(PROJECT_VERSION_MINOR 0)
# Set project name, version and laguages here. (change as needed)
# Version numbers are available by including "exampleConfig.h" in
# the source. See exampleConfig.h.in for some more details.
project(CPP_BOILERPLATE VERSION 1.2.3.4 LANGUAGES C CXX)


# Include stuff. No change needed.
Expand Down
4 changes: 4 additions & 0 deletions app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ int main() {
<< PROJECT_VERSION_MAJOR
<< "."
<< PROJECT_VERSION_MINOR
<< "."
<< PROJECT_VERSION_PATCH
<< "."
<< PROJECT_VERSION_TWEAK
<< std::endl;
std::system("cat ../LICENCE");

Expand Down
2 changes: 2 additions & 0 deletions include/exampleConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@
*/
#define PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@
#define PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@
#define PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@
#define PROJECT_VERSION_TWEAK @PROJECT_VERSION_TWEAK@

0 comments on commit 506179c

Please sign in to comment.