From 7746c312375e0a5498e0745bed54f7e3556000ba Mon Sep 17 00:00:00 2001 From: "Fletcher T. Penney" Date: Mon, 16 Jan 2017 11:52:41 -0500 Subject: [PATCH] CHANGED: Include license and project name information in 'version.h' --- CMakeLists.txt | 11 ++++++++--- README.md | 6 +++--- templates/version.h.in | 9 +++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6f6a228..2daf0a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,14 +8,14 @@ cmake_minimum_required (VERSION 2.6) set (My_Project_Title "C-Template") set (My_Project_Description "Boilerplate c project with cmake support, CuTest unit testing, and more.") set (My_Project_Author "Fletcher T. Penney") -set (My_Project_Revised_Date "2016-12-02") +set (My_Project_Revised_Date "2017-01-16") set (My_Project_Version_Major 1) set (My_Project_Version_Minor 0) -set (My_Project_Version_Patch 4) +set (My_Project_Version_Patch 5) set (My_Project_Version "${My_Project_Version_Major}.${My_Project_Version_Minor}.${My_Project_Version_Patch}") -set (My_Project_Copyright_Date "2015-2016") +set (My_Project_Copyright_Date "2015-2017") set (My_Project_Copyright "Copyright © ${My_Project_Copyright_Date} ${My_Project_Author}.") string(TOUPPER ${My_Project_Title} My_Project_Title_Caps ) @@ -127,6 +127,11 @@ file(READ ${PROJECT_SOURCE_DIR}/LICENSE.txt My_Project_License) string(REGEX REPLACE "\n" "\n\t" My_Project_License_Indent ${My_Project_License}) +string(REGEX REPLACE "\"" "\\\\\"" My_Project_License_Escaped ${My_Project_License_Indent}) + +string(REGEX REPLACE "\n" "\\\\n\"\\\\\n\"" My_Project_License_Literal ${My_Project_License_Escaped}) + + configure_file ( "${PROJECT_SOURCE_DIR}/templates/template.c.in" "${PROJECT_BINARY_DIR}/template.c" diff --git a/README.md b/README.md index eeb13da..a3fa6a2 100644 --- a/README.md +++ b/README.md @@ -4,9 +4,9 @@ | ---------- | ------------------------- | | Title: | C-Template | | Author: | Fletcher T. Penney | -| Date: | 2016-12-02 | -| Copyright: | Copyright © 2015-2016 Fletcher T. Penney. | -| Version: | 1.0.4 | +| Date: | 2017-01-16 | +| Copyright: | Copyright © 2015-2017 Fletcher T. Penney. | +| Version: | 1.0.5 | ## Introduction ## diff --git a/templates/version.h.in b/templates/version.h.in index 2d5f974..4d05e45 100644 --- a/templates/version.h.in +++ b/templates/version.h.in @@ -18,9 +18,14 @@ **/ -#ifndef FILE_@My_Project_Title_Caps@_VERSION_H -#define FILE_@My_Project_Title_Caps@_VERSION_H +#ifndef FILE_@My_Project_Title_Caps@_H +#define FILE_@My_Project_Title_Caps@_H + +#define @My_Project_Title_Caps@_NAME "@My_Project_Title@" #define @My_Project_Title_Caps@_VERSION "@My_Project_Version@" +#define @My_Project_Title_Caps@_COPYRIGHT "@My_Project_Copyright@" + +#define @My_Project_Title_Caps@_LICENSE "\t@My_Project_License_Literal@" #endif -- 2.40.0