Skip to content

Commit

Permalink
Generate metadata header from project info.
Browse files Browse the repository at this point in the history
  • Loading branch information
alamaison committed May 14, 2015
1 parent 2038c7b commit 1ce8794
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 31 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@ HunterGate(

project(swish VERSION 0.8.2)

set(SWISH_FRIENDLY_NAME "Swish")
set(SWISH_DESCRIPTION "Easy SFTP for Windows Explorer")
set(SWISH_COPYRIGHT "Copyright (C) 2006-2015 Alexander Lamaison and contributors")

#include(max_warnings)

include_directories(
Expand Down Expand Up @@ -74,8 +78,6 @@ configure_file(
${CMAKE_CURRENT_BINARY_DIR}/appcast.xml
@ONLY)

set(SWISH_COPYRIGHT "Copyright (C) 2006-2015 Alexander Lamaison and Contributors")

configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/setup_conf.xml.in
${CMAKE_CURRENT_BINARY_DIR}/setup_conf.xml
Expand Down
1 change: 0 additions & 1 deletion build/making_a_release.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ Update version number in:
- top-level CMakeLists.txt
- wix/swish.wxs
- wix/wix.wixproj
- swish/versions/metadata.h (x1 and copyright date)

Add notable changes to NEWS.

Expand Down
12 changes: 11 additions & 1 deletion swish/versions/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,18 @@ add_custom_target(git_version
-P ${CMAKE_CURRENT_SOURCE_DIR}/configure_git_version.cmake
VERBATIM)

set(METADATA_TEMPLATE "${CMAKE_CURRENT_SOURCE_DIR}/metadata.h.in")
set(METADATA_GENERATED_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/swish/versions/metadata.h")

configure_file(
${METADATA_TEMPLATE}
${METADATA_GENERATED_OUTPUT}
@ONLY)
set_source_files_properties(
${METADATA_GENERATED_OUTPUT} PROPERTIES GENERATED TRUE)

set(SOURCES
metadata.h
${METADATA_GENERATED_OUTPUT}
version.cpp
version.hpp)

Expand Down
36 changes: 9 additions & 27 deletions swish/versions/metadata.h → swish/versions/metadata.h.in
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/**
@file
C-like interface to Swish meta-data.
@if license
/*
Copyright (C) 2009-2012 Vaclav Slavik
Copyright (C) 2013, 2014 Alexander Lamaison <awl03@doc.ic.ac.uk>
Copyright (C) 2013, 2014, 2015 Alexander Lamaison <swish@lammy.co.uk>

Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
Expand All @@ -25,8 +19,6 @@
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
@endif
*/

// Based on winsparkle-version.h.
Expand All @@ -37,25 +29,15 @@
// IMPORTANT: The version information in this file must be digestable by the
// resource (RC) compiler. No C++ allowed.

#define SWISH_MAJOR_VERSION 0
#define SWISH_MINOR_VERSION 8
#define SWISH_BUGFIX_VERSION 2

#define SWISH_MAKE_STRING(x) #x

// Have to indirect via this helper macro to get version numbers expanded out
#define SWISH_MAKE_VERSION_STRING(a,b,c) \
SWISH_MAKE_STRING(a) "." SWISH_MAKE_STRING(b) "." SWISH_MAKE_STRING(c)

#define SWISH_VERSION_STRING \
SWISH_MAKE_VERSION_STRING(SWISH_MAJOR_VERSION, \
SWISH_MINOR_VERSION, \
SWISH_BUGFIX_VERSION)
#define SWISH_MAJOR_VERSION @swish_VERSION_MAJOR@
#define SWISH_MINOR_VERSION @swish_VERSION_MINOR@
#define SWISH_BUGFIX_VERSION @swish_VERSION_PATCH@
#define SWISH_VERSION_STRING "@swish_VERSION@"

#define SWISH_PROGRAM_NAME "Swish"
#define SWISH_PROGRAM_NAME "@SWISH_FRIENDLY_NAME@"

#define SWISH_COPYRIGHT "Copyright (C) 2007-2014 Alexander Lamaison and contributers."
#define SWISH_COPYRIGHT "@SWISH_COPYRIGHT@"

#define SWISH_DESCRIPTION "Easy SFTP for Windows Explorer"
#define SWISH_DESCRIPTION "@SWISH_DESCRIPTION@"

#endif

0 comments on commit 1ce8794

Please sign in to comment.