Skip to content

Commit 34e9654

Browse files
chore: update the file
1 parent 9c7562a commit 34e9654

File tree

5 files changed

+64
-26
lines changed

5 files changed

+64
-26
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,4 +92,5 @@ html
9292
libs
9393

9494
ThirdParty
95-
.VSCodeCounter
95+
.VSCodeCounter
96+
private.cmake

CMakeLists.txt

Lines changed: 27 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -214,10 +214,12 @@ if(APPLE)
214214
set(WX_TOOLS_BUNDLE_VERSION ${WXT_VERSION})
215215
set(WXT_SHORT_VERSION "${short_ver}")
216216

217-
string(TIMESTAMP CURRENT_YEAR "%Y")
218-
message(STATUS "Current year: ${CURRENT_YEAR}")
217+
string(TIMESTAMP WXT_CURRENT_YEAR "%Y")
218+
message(STATUS "Current year: ${WXT_CURRENT_YEAR}")
219+
string(TIMESTAMP WXT_BUNDLE_VERSION "%Y%m%d%H%M")
220+
message(STATUS "[wxTools] WXT_BUNDLE_VERSION: ${WXT_BUNDLE_VERSION}")
219221
# cmake-format: off
220-
set(WX_TOOLS_YYYY "${CURRENT_YEAR}" CACHE STRING "The current year")
222+
set(WX_TOOLS_YYYY "${WXT_CURRENT_YEAR}" CACHE STRING "The current year")
221223
# cmake-format: on
222224
set(wxt_entitlements "${CMAKE_SOURCE_DIR}/res/apple/macos/wxTools.entitlements")
223225

@@ -234,6 +236,9 @@ if(APPLE)
234236
# * set(CMAKE_XCODE_ATTRIBUTE_CURRENT_PROJECT_VERSION
235237
set(CMAKE_XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS "${wxt_entitlements}")
236238
# cmake-format: on
239+
else()
240+
set_target_properties(wxTools PROPERTIES XCODE_ATTRIBUTE_CODE_SIGN_ENTITLEMENTS
241+
"${wxt_entitlements}")
237242
endif()
238243

239244
# cmake-format: off
@@ -259,7 +264,7 @@ if(APPLE)
259264
# * MACOSX_BUNDLE_LONG_VERSION_STRING "${WXT_VERSION}"
260265
# * MACOSX_BUNDLE_SHORT_VERSION_STRING "${WXT_SHORT_VERSION}"
261266
# * MACOSX_BUNDLE_INFO_STRING "${CMAKE_PROJECT_DESCRIPTION}"
262-
# * MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2024-${CURRENT_YEAR} x-tools@outlook.com. All rights reserved."
267+
# * MACOSX_BUNDLE_COPYRIGHT "Copyright (C) 2024-${WXT_CURRENT_YEAR} x-tools@outlook.com. All rights reserved."
263268
# * )
264269
# cmake-format: on
265270

@@ -273,15 +278,25 @@ if(APPLE)
273278
# cmake-format: on
274279
add_dependencies(wxTools_pkg_dmg wxTools)
275280

276-
if(FALSE)
277-
# Create pak file
281+
if(TRUE)
282+
283+
if(EXISTS "${CMAKE_SOURCE_DIR}/private.cmake")
284+
include(${CMAKE_SOURCE_DIR}/private.cmake)
285+
message(STATUS "[wxTools-apple] WX_TOOLS_DEV_ID_APP: ${WX_TOOLS_DEV_ID_APP}")
286+
message(STATUS "[wxTools-apple] WX_TOOLS_DEV_ID_INSTALLER: ${WX_TOOLS_DEV_ID_INSTALLER}")
287+
endif()
288+
289+
if(NOT DEFINED WX_TOOLS_DEV_ID_APP OR NOT DEFINED WX_TOOLS_DEV_ID_INSTALLER)
290+
# cmake-format: off
291+
set(WX_TOOLS_DEV_ID_APP "xxx_id_developer" CACHE STRING "The app's developer ID")
292+
set(WX_TOOLS_DEV_ID_INSTALLER "xxx_id_installer" CACHE STRING "The installer's developer ID")
293+
# cmake-format: on
294+
endif()
295+
278296
include(cmake/MacOS/MacOS.cmake)
279-
# cmake-format: off
280-
set(WXTOOLS_DEV_ID_APP "xxx_id_developer" CACHE STRING "The app's developer ID")
281-
set(WXTOOLS_DEV_ID_INSTALLER "xxx_id_installer" CACHE STRING "The installer's developer ID")
282-
wxt_make_pkg(wxTools ${WXTOOLS_DEV_ID_APP} ${WXTOOLS_DEV_ID_INSTALLER})
283-
wxt_make_dmg(wxTools ${WXTOOLS_DEV_ID_APP} ${WXTOOLS_DEV_ID_INSTALLER})
284-
# cmake-format: on
297+
wxt_make_pkg(wxTools ${WX_TOOLS_DEV_ID_APP} ${WX_TOOLS_DEV_ID_INSTALLER})
298+
wxt_make_dmg(wxTools ${WX_TOOLS_DEV_ID_APP} ${WX_TOOLS_DEV_ID_INSTALLER})
299+
285300
endif()
286301
endif()
287302

cmake/MacOS/MacOS.cmake

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ function(wxt_make_pkg target dev_id_app dev_id_installer)
66
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/assets/${target}
77
COMMAND ${CMAKE_COMMAND} -E echo "Developer ID Application: ${dev_id_app}"
88
COMMAND ${CMAKE_COMMAND} -E echo "Developer ID Installer: ${dev_id_installer}"
9-
COMMAND echo "codesign --deep --force --verbose --sign ${dev_id_app} ${target}.app"
10-
COMMAND codesign --deep --force --verbose --sign "${dev_id_app}" "${target}.app"
11-
COMMAND pkgbuild --root ${target}.app --identifier "${WXT_APP_ID}" --version "${WXT_VERSION}" --install-location /Applications/${target}.app ${WXT_ASSETS_NAME}.pkg
9+
COMMAND codesign -f -o runtime -s "${dev_id_app}" -v ${target}.app --deep
10+
COMMAND productbuild --component ${target}.app /Applications --product ${target}.app/Contents/Info.plist ${target}.pkg
11+
COMMAND productsign --sign "${dev_id_installer}" ${target}.pkg ${target}-${WXT_VERSION}-${WXT_BUNDLE_VERSION}-signed.pkg
1212
)
1313
# cmake-format: on
1414
endfunction()
@@ -20,10 +20,8 @@ function(wxt_make_dmg target dev_id_app dev_id_installer)
2020
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/assets/${target}
2121
COMMAND ${CMAKE_COMMAND} -E echo "Developer ID Application: ${dev_id_app}"
2222
COMMAND ${CMAKE_COMMAND} -E echo "Developer ID Installer: ${dev_id_installer}"
23-
COMMAND ${CMAKE_COMMAND} -E echo "codesign --deep --force --verbose --sign ${dev_id_app} ${target}.app"
24-
COMMAND codesign --deep --force --verbose --sign "${dev_id_app}" "${target}.app"
23+
COMMAND codesign -f -o runtime -s "${dev_id_app}" -v ${target}.app --deep
2524
COMMAND hdiutil create -volname "${target}" -srcfolder "${target}.app" -ov -format UDZO "${WXT_ASSETS_NAME}.dmg"
26-
COMMAND codesign --force --sign "${dev_id_installer}" "${target}.dmg"
2725
)
2826
# cmake-format: on
2927
endfunction()

cmake/wxt_tools_git.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,12 @@ function(wxt_git_get_latest_tag working_dir prefix)
1010

1111
# date_version: such as 2025.04.27
1212
# cmake-format: off
13-
string(TIMESTAMP current_year "%Y")
13+
string(TIMESTAMP WXT_CURRENT_YEAR "%Y")
1414
string(TIMESTAMP current_month "%m")
1515
string(TIMESTAMP current_day "%d")
1616
math(EXPR current_month "${current_month} + 0")
1717
math(EXPR current_day "${current_day} + 0")
18-
set(date_version "${current_year}.${current_month}.${current_day}")
18+
set(date_version "${WXT_CURRENT_YEAR}.${current_month}.${current_day}")
1919
set(${prefix}_GIT_TAG "${date_version}" CACHE STRING "Latest git tag" FORCE)
2020
# cmake-format: on
2121

res/apple/macos/wxTools.plist.in

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
33
<plist version="1.0">
44
<dict>
5+
<key>BuildMachineOSBuild</key>
6+
<string>24G90</string>
57
<key>CFBundleDevelopmentRegion</key>
68
<string>English</string>
79
<key>CFBundleExecutable</key>
@@ -23,14 +25,36 @@
2325
<key>CFBundleShortVersionString</key>
2426
<string>${WXT_VERSION}</string>
2527
<key>CFBundleSignature</key>
26-
<string>WXTL</string>
28+
<string>????</string>
29+
<key>CFBundleSupportedPlatforms</key>
30+
<array>
31+
<string>MacOSX</string>
32+
</array>
2733
<key>CFBundleVersion</key>
28-
<string>${WXT_VERSION}</string>
34+
<string>${WXT_BUNDLE_VERSION}</string>
2935
<key>CSResourcesFileMapped</key>
3036
<true/>
31-
<key>NSHumanReadableCopyright</key>
32-
<string>Copyright (C) 2024-${CURRENT_YEAR} x-tools@outlook.com. All rights reserved.</string>
37+
<key>DTCompiler</key>
38+
<string>com.apple.compilers.llvm.clang.1_0</string>
39+
<key>DTPlatformBuild</key>
40+
<string>24F74</string>
41+
<key>DTPlatformName</key>
42+
<string>macosx</string>
43+
<key>DTPlatformVersion</key>
44+
<string>15.5</string>
45+
<key>DTSDKBuild</key>
46+
<string>24F74</string>
47+
<key>DTSDKName</key>
48+
<string>macosx15.5</string>
49+
<key>DTXcode</key>
50+
<string>1640</string>
51+
<key>DTXcodeBuild</key>
52+
<string>16F6</string>
3353
<key>LSApplicationCategoryType</key>
3454
<string>public.app-category.utilities</string>
55+
<key>LSMinimumSystemVersion</key>
56+
<string>12.0</string>
57+
<key>NSHumanReadableCopyright</key>
58+
<string>Copyright (C) 2024-${WXT_CURRENT_YEAR} x-tools@outlook.com. All rights reserved.</string>
3559
</dict>
3660
</plist>

0 commit comments

Comments
 (0)