Moved version num to cmake, so it is available both at build and runtime

This commit is contained in:
Matt Hill
2014-05-08 18:06:31 -05:00
parent 9550a37d03
commit 05df80e5e2
2 changed files with 11 additions and 3 deletions

View File

@@ -3,6 +3,17 @@ project(src)
cmake_minimum_required (VERSION 2.6) cmake_minimum_required (VERSION 2.6)
# Set the OpenALPR version in cmake, and also add it as a DEFINE for the code to access
SET(OPENALPR_MAJOR_VERSION "1")
SET(OPENALPR_MINOR_VERSION "1")
SET(OPENALPR_PATCH_VERSION "0")
SET(OPENALPR_VERSION ${OPENALPR_MAJOR_VERSION}.${OPENALPR_MINOR_VERSION}.${OPENALPR_PATCH_VERSION})
add_definitions( -DOPENALPR_MAJOR_VERSION=${OPENALPR_MAJOR_VERSION})
add_definitions( -DOPENALPR_MINOR_VERSION=${OPENALPR_MINOR_VERSION})
add_definitions( -DOPENALPR_PATCH_VERSION=${OPENALPR_PATCH_VERSION})
SET(OpenCV_DIR "${CMAKE_SOURCE_DIR}/../libraries/opencv/") SET(OpenCV_DIR "${CMAKE_SOURCE_DIR}/../libraries/opencv/")
SET(Tesseract_DIR "${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr") SET(Tesseract_DIR "${CMAKE_SOURCE_DIR}/../libraries/tesseract-ocr")

View File

@@ -20,9 +20,6 @@
#define OPENALPR_CONSTANTS_H #define OPENALPR_CONSTANTS_H
#define OPENALPR_MAJOR_VERSION 1
#define OPENALPR_MINOR_VERSION 1
#define OPENALPR_PATCH_VERSION 0
#define CONFIG_FILE "/openalpr.conf" #define CONFIG_FILE "/openalpr.conf"
#define KEYPOINTS_DIR "/keypoints" #define KEYPOINTS_DIR "/keypoints"