Add versioning system
This commit is contained in:
parent
73445af2e7
commit
581db91157
@ -7,3 +7,9 @@ set_property(TARGET NothinFancy PROPERTY CXX_STANDARD 20)
|
||||
# Use precompiled header
|
||||
target_precompile_headers(NothinFancy PUBLIC "src/pch.h")
|
||||
target_include_directories(NothinFancy PUBLIC "src/")
|
||||
|
||||
# Generate version.h
|
||||
find_package(Git)
|
||||
execute_process(COMMAND ${GIT_EXECUTABLE} describe OUTPUT_VARIABLE NFVERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
configure_file(src/version.h.in version.h)
|
||||
target_include_directories(NothinFancy PUBLIC "${PROJECT_BINARY_DIR}/NothinFancy")
|
||||
|
@ -1,9 +1,11 @@
|
||||
// NF startup
|
||||
#include "pch.h"
|
||||
|
||||
#include "version.h"
|
||||
|
||||
namespace nf {
|
||||
void test() {
|
||||
std::cout << "NothinFancy\n";
|
||||
void startEngine() {
|
||||
std::cout << std::format("Nothin' Fancy {}\n", NFVERSION);
|
||||
std::cin.get();
|
||||
}
|
||||
}
|
||||
|
@ -2,5 +2,5 @@
|
||||
#pragma once
|
||||
|
||||
namespace nf {
|
||||
void test();
|
||||
void startEngine();
|
||||
}
|
||||
|
2
NothinFancy/src/version.h.in
Normal file
2
NothinFancy/src/version.h.in
Normal file
@ -0,0 +1,2 @@
|
||||
// Version configured header
|
||||
#define NFVERSION "@NFVERSION@"
|
@ -2,6 +2,6 @@
|
||||
#include "nf.h"
|
||||
|
||||
int main(int argc, char* argv[]) {
|
||||
nf::test();
|
||||
nf::startEngine();
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user