Skip to content

Commit 5bc1ca5

Browse files
authored
Merge pull request htacg#942 from htacg/mac_info_plist
Link macOS console application with required plist
2 parents f6376f8 + c044ab3 commit 5bc1ca5

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@ HTACG and Contributors</string>
17+
</dict>
18+
</plist>

0 commit comments

Comments
 (0)