Skip to content

Commit c7d247f

Browse files
committed
Fixed issue #66: Github don't identify the repository LICENSE as MIT.
1 parent 56aab7a commit c7d247f

File tree

9 files changed

+41
-28
lines changed

9 files changed

+41
-28
lines changed

CHANGES

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ Changes for 0.5.0
99
* Fixed issue #52: Define a specific property for use as separator for handling multiple file selection.
1010
* Fixed issue #55: Menu name maximum length limit and escape string.
1111
* Fixed issue #61: Support for WIX installer.
12+
* Fixed issue #66: Github don't identify the repository LICENSE as MIT.
1213
* Fixed issue #68: INSTALL.md mentions that 'application does not provides pre-build binaries' which is incorrect.
1314
* Fixed issue #69: Compilation of PACKAGE target fails if Wix Toolset is not installed on system.
1415
* Fixed issue #70: Merge Win32Clipboard library dependency into ShellAnything.

CMakeLists.txt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,10 @@ set(SHELLANYTHING_VERSION_MINOR 5)
7272
set(SHELLANYTHING_VERSION_PATCH 0)
7373
set(SHELLANYTHING_VERSION ${SHELLANYTHING_VERSION_MAJOR}.${SHELLANYTHING_VERSION_MINOR}.${SHELLANYTHING_VERSION_PATCH})
7474

75-
# read license file
76-
file(READ ${CMAKE_SOURCE_DIR}/LICENSE.h LICENSE)
75+
# Create a c++ file header from the project LICENSE file.
76+
# The c++ header will be added to all generated files.
77+
include(MakeCplusplusHeader)
78+
MakeCplusplusHeader(${CMAKE_SOURCE_DIR}/LICENSE LICENSE_CPLUSPLUS_HEADER)
7779

7880
# version.h file
7981
set(SHELLANYTHING_VERSION_HEADER ${CMAKE_BINARY_DIR}/include/shellanything/version.h)
@@ -312,7 +314,7 @@ set(CPACK_NSIS_MENU_LINKS
312314

313315
# Set variables for WIX installer
314316
set(CPACK_WIX_UPGRADE_GUID "EBEF1698-CA72-480A-9FE3-E8A08E7E03ED")
315-
set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/LICENSE.rtf")
317+
set(CPACK_WIX_LICENSE_RTF "${CMAKE_SOURCE_DIR}/resources/wix_license_template.rtf")
316318
set(CPACK_WIX_PRODUCT_ICON "${CMAKE_SOURCE_DIR}/resources/icons/0.2.0.ico")
317319
set(CPACK_WIX_HELP_LINK "https://github.com/end2endzone/ShellAnything")
318320

LICENSE.h

Lines changed: 0 additions & 23 deletions
This file was deleted.

cmake/MakeCplusplusHeader.cmake

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
2+
#! MakeCplusplusHeader : Read the given file content into an output variable wrapping the file content in c++ comments.
3+
#
4+
# \arg:file The path of the file to read.
5+
# \arg:output_variable The path to the output variable that contains the c++ comments.
6+
#
7+
function(MakeCplusplusHeader file output_variable)
8+
set(CPLUSPLUS_COMMENT_HEADER "/*********************************************************************************")
9+
set(CPLUSPLUS_COMMENT_FOOTER " *********************************************************************************/")
10+
11+
# Read the file
12+
file(READ ${file} FILE_CONTENT)
13+
14+
# Remove last \n at the end of the file.
15+
string(STRIP ${FILE_CONTENT} FILE_CONTENT)
16+
17+
# Add " * " at the beginning of each new line
18+
string(REPLACE "\n" "\n * " FILE_CONTENT ${FILE_CONTENT})
19+
20+
# Also add " * " for the first line
21+
set(FILE_CONTENT " * ${FILE_CONTENT}")
22+
23+
# Add header and footer
24+
set(FILE_CONTENT "${CPLUSPLUS_COMMENT_HEADER}\n${FILE_CONTENT}\n${CPLUSPLUS_COMMENT_FOOTER}\n")
25+
26+
# Debug
27+
#FILE(WRITE ${CMAKE_SOURCE_DIR}/MakeCplusplusHeader.h "${FILE_CONTENT}")
28+
29+
# Copy formatted header to the calling scope
30+
set(${output_variable} "${FILE_CONTENT}" PARENT_SCOPE)
31+
endfunction()

src/config.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@LICENSE@
1+
@LICENSE_CPLUSPLUS_HEADER@
22
#ifndef SHELLANYTHING_CONFIG_H
33
#define SHELLANYTHING_CONFIG_H
44

src/resource.rc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
@LICENSE_CPLUSPLUS_HEADER@
12
appicon ICON "@CMAKE_SOURCE_DIR@/resources/icons/0.2.0.ico"

src/version.h.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
@LICENSE@
1+
@LICENSE_CPLUSPLUS_HEADER@
22
#ifndef SHELLANYTHING_VERSION_H
33
#define SHELLANYTHING_VERSION_H
44

src/version.rc.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
@LICENSE_CPLUSPLUS_HEADER@
12
/////////////////////////////////////////////////////////////////////////////
23
//
34
// Constants

0 commit comments

Comments
 (0)