Skip to content

Commit cfcf6b7

Browse files
committed
Add support for the required Info.plist to the Tidy console application, thus enabling
notarization support that's now required on macOS. Unlike the similar pull request on the master branch, this one ensures that the proper version is always used, via the same mechanism that CMakeLists uses to set the version.
1 parent f6376f8 commit cfcf6b7

File tree

3 files changed

+27
-0
lines changed

3 files changed

+27
-0
lines changed

CMakeLists.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -441,6 +441,14 @@ if (SUPPORT_CONSOLE_APP)
441441
if (MSVC)
442442
set_target_properties( ${name} PROPERTIES DEBUG_POSTFIX d )
443443
endif ()
444+
if (APPLE)
445+
string(TIMESTAMP CURRENT_YEAR "%Y")
446+
configure_file(
447+
${CMAKE_CURRENT_SOURCE_DIR}/console/Info.plist.in
448+
${CMAKE_CURRENT_BINARY_DIR}/Info.plist
449+
)
450+
target_link_options(${name} PRIVATE LINKER:-sectcreate,__TEXT,__info_plist,Info.plist)
451+
endif ()
444452
if (NOT TIDY_CONSOLE_SHARED)
445453
set_target_properties( ${name} PROPERTIES
446454
COMPILE_FLAGS "-DTIDY_STATIC" )

build/cmake/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ tidy1.xsl
3333
tidy.pc
3434
*.vcproj
3535
.pkg
36+
Info.plist

console/Info.plist.in

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDisplayName</key>
6+
<string>HTML Tidy</string>
7+
<key>CFBundleIdentifier</key>
8+
<string>org.htacg.html-tidy.tidy5</string>
9+
<key>CFBundleInfoDictionaryVersion</key>
10+
<string>6.0</string>
11+
<key>CFBundleShortVersionString</key>
12+
<string>@LIBTIDY_VERSION@</string>
13+
<key>CFBundleVersion</key>
14+
<string>@LIBTIDY_DATE@</string>
15+
<key>NSHumanReadableCopyright</key>
16+
<string>©@CURRENT_YEAR@ HATCG and Contributors</string>
17+
</dict>
18+
</plist>

0 commit comments

Comments
 (0)