Add version system
This commit is contained in:
parent
97727d05d4
commit
3977d85fee
@ -8,3 +8,8 @@ set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /entry:mainCRTStartup")
|
|||||||
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
|
||||||
set_property(TARGET WatchfulEye PROPERTY WIN32_EXECUTABLE FALSE)
|
set_property(TARGET WatchfulEye PROPERTY WIN32_EXECUTABLE FALSE)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
find_package(Git)
|
||||||
|
execute_process(COMMAND ${GIT_EXECUTABLE} describe OUTPUT_VARIABLE APPVERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
configure_file(src/version.h.in version.h)
|
||||||
|
target_include_directories(WatchfulEye PUBLIC "${PROJECT_BINARY_DIR}/WatchfulEye")
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
// Watchful Eye main file
|
// Watchful Eye main file
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#include "version.h"
|
||||||
|
|
||||||
int main(int argc, char* argv[]) {
|
int main(int argc, char* argv[]) {
|
||||||
std::cout << "Watchful Eye\n";
|
std::cout << "Watchful Eye " APPVERSION "\n";
|
||||||
|
|
||||||
std::cin.get();
|
std::cin.get();
|
||||||
return EXIT_SUCCESS;
|
return EXIT_SUCCESS;
|
||||||
|
|||||||
2
WatchfulEye/src/version.h.in
Normal file
2
WatchfulEye/src/version.h.in
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
// Version configured header file
|
||||||
|
#define APPVERSION "@APPVERSION@"
|
||||||
Loading…
x
Reference in New Issue
Block a user