sync cmake version with hardcoded version

pull/2828/head
Stefano Sinigardi 6 years ago
parent e647a59f48
commit 1cbdd293f3
  1. 11
      CMakeLists.txt
  2. 9
      src/parser.c
  3. 3
      src/version.h
  4. 3
      src/version.h.in

@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.8) cmake_minimum_required(VERSION 3.8)
set(Darknet_MAJOR_VERSION 1) set(Darknet_MAJOR_VERSION 0)
set(Darknet_MINOR_VERSION 0) set(Darknet_MINOR_VERSION 2)
set(Darknet_PATCH_VERSION 0) set(Darknet_PATCH_VERSION 5)
set(Darknet_VERSION ${Darknet_MAJOR_VERSION}.${Darknet_MINOR_VERSION}.${Darknet_PATCH_VERSION}) set(Darknet_VERSION ${Darknet_MAJOR_VERSION}.${Darknet_MINOR_VERSION}.${Darknet_PATCH_VERSION})
set(CMAKE_VERBOSE_MAKEFILE "FALSE" CACHE BOOL "Create verbose makefile") set(CMAKE_VERBOSE_MAKEFILE "FALSE" CACHE BOOL "Create verbose makefile")
@ -41,6 +41,11 @@ foreach(p LIB BIN INCLUDE CMAKE)
endif() endif()
endforeach() 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") set(ENABLE_CUDA "TRUE" CACHE BOOL "Enable CUDA build")
if(${CMAKE_VERSION} VERSION_LESS "3.8.0") if(${CMAKE_VERSION} VERSION_LESS "3.8.0")
set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA build" FORCE) set(ENABLE_CUDA "FALSE" CACHE BOOL "Enable CUDA build" FORCE)

@ -1,6 +1,7 @@
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h>
#include "activation_layer.h" #include "activation_layer.h"
#include "activations.h" #include "activations.h"
@ -32,8 +33,8 @@
#include "softmax_layer.h" #include "softmax_layer.h"
#include "utils.h" #include "utils.h"
#include "upsample_layer.h" #include "upsample_layer.h"
#include "version.h"
#include "yolo_layer.h" #include "yolo_layer.h"
#include <stdint.h>
typedef struct{ typedef struct{
char *type; char *type;
@ -1038,9 +1039,9 @@ void save_weights_upto(network net, char *filename, int cutoff)
FILE *fp = fopen(filename, "wb"); FILE *fp = fopen(filename, "wb");
if(!fp) file_error(filename); if(!fp) file_error(filename);
int major = 0; int major = MAJOR_VERSION;
int minor = 2; int minor = MINOR_VERSION;
int revision = 5; int revision = PATCH_VERSION;
fwrite(&major, sizeof(int), 1, fp); fwrite(&major, sizeof(int), 1, fp);
fwrite(&minor, sizeof(int), 1, fp); fwrite(&minor, sizeof(int), 1, fp);
fwrite(&revision, sizeof(int), 1, fp); fwrite(&revision, sizeof(int), 1, fp);

@ -0,0 +1,3 @@
#define MAJOR_VERSION 0
#define MINOR_VERSION 2
#define PATCH_VERSION 5

@ -0,0 +1,3 @@
#define MAJOR_VERSION @Darknet_MAJOR_VERSION@
#define MINOR_VERSION @Darknet_MINOR_VERSION@
#define PATCH_VERSION @Darknet_PATCH_VERSION@
Loading…
Cancel
Save