diff --git a/CMakeLists.txt b/CMakeLists.txt index 5a8868b5..4f22a037 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,8 +1,8 @@ cmake_minimum_required(VERSION 3.8) -set(Darknet_MAJOR_VERSION 1) -set(Darknet_MINOR_VERSION 0) -set(Darknet_PATCH_VERSION 0) +set(Darknet_MAJOR_VERSION 0) +set(Darknet_MINOR_VERSION 2) +set(Darknet_PATCH_VERSION 5) set(Darknet_VERSION ${Darknet_MAJOR_VERSION}.${Darknet_MINOR_VERSION}.${Darknet_PATCH_VERSION}) set(CMAKE_VERBOSE_MAKEFILE "FALSE" CACHE BOOL "Create verbose makefile") @@ -41,6 +41,11 @@ foreach(p LIB BIN INCLUDE CMAKE) endif() endforeach() +configure_file( + "${CMAKE_CURRENT_LIST_DIR}/src/version.h.in" + "${CMAKE_CURRENT_LIST_DIR}/src/version.h" +) + set(ENABLE_CUDA "TRUE" CACHE BOOL "Enable CUDA build") if(${CMAKE_VERSION} VERSION_LESS "3.8.0") set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA build" FORCE) diff --git a/src/parser.c b/src/parser.c index 557e07ba..782b5820 100644 --- a/src/parser.c +++ b/src/parser.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "activation_layer.h" #include "activations.h" @@ -32,8 +33,8 @@ #include "softmax_layer.h" #include "utils.h" #include "upsample_layer.h" +#include "version.h" #include "yolo_layer.h" -#include typedef struct{ char *type; @@ -1038,9 +1039,9 @@ void save_weights_upto(network net, char *filename, int cutoff) FILE *fp = fopen(filename, "wb"); if(!fp) file_error(filename); - int major = 0; - int minor = 2; - int revision = 5; + int major = MAJOR_VERSION; + int minor = MINOR_VERSION; + int revision = PATCH_VERSION; fwrite(&major, sizeof(int), 1, fp); fwrite(&minor, sizeof(int), 1, fp); fwrite(&revision, sizeof(int), 1, fp); diff --git a/src/version.h b/src/version.h new file mode 100644 index 00000000..7b103078 --- /dev/null +++ b/src/version.h @@ -0,0 +1,3 @@ +#define MAJOR_VERSION 0 +#define MINOR_VERSION 2 +#define PATCH_VERSION 5 diff --git a/src/version.h.in b/src/version.h.in new file mode 100644 index 00000000..e9081190 --- /dev/null +++ b/src/version.h.in @@ -0,0 +1,3 @@ +#define MAJOR_VERSION @Darknet_MAJOR_VERSION@ +#define MINOR_VERSION @Darknet_MINOR_VERSION@ +#define PATCH_VERSION @Darknet_PATCH_VERSION@