-
Notifications
You must be signed in to change notification settings - Fork 709
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
12 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
#include <stdio.h> | ||
|
||
// provides PROJECT_VERSION | ||
// provides PROJECT_VERSION, PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR | ||
#include "version.h" | ||
|
||
int main() { | ||
printf("This is output from example code v%s:\n", PROJECT_VERSION); | ||
printf("This is output from example code %s\n", PROJECT_VERSION); | ||
printf("The major version number is %i\n", PROJECT_VERSION_MAJOR); | ||
printf("The minor version number is %i\n", PROJECT_VERSION_MINOR); | ||
|
||
printf("Hello CMake world!\n"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
#pragma once | ||
|
||
#define PROJECT_VERSION "@PROJECT_VERSION@" | ||
#define PROJECT_VERSION_MAJOR @PROJECT_VERSION_MAJOR@ | ||
#define PROJECT_VERSION_MINOR @PROJECT_VERSION_MINOR@ | ||
#define PROJECT_VERSION_PATCH @PROJECT_VERSION_PATCH@ | ||
|
||
#define PROJECT_VERSION "v@PROJECT_VERSION@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,13 @@ | ||
program example | ||
|
||
use version, only: PROJECT_VERSION, PROJECT_VERSION_MAJOR | ||
use version, only: PROJECT_VERSION, PROJECT_VERSION_MAJOR, PROJECT_VERSION_MINOR | ||
|
||
implicit none | ||
|
||
print *, "This is output from example code ", PROJECT_VERSION | ||
print *, "The major version number is", PROJECT_VERSION_MAJOR | ||
print *, "The minor version number is", PROJECT_VERSION_MINOR | ||
|
||
print *, "Hello CMake world!" | ||
|
||
end program |