summaryrefslogtreecommitdiff
path: root/soh
diff options
context:
space:
mode:
authorth-2021 <90853655+th-2021@users.noreply.github.com>2022-10-04 01:13:29 +0200
committerGitHub <noreply@github.com>2022-10-04 01:13:29 +0200
commitf1070a2e74716b3e475fc4e78a7edf3f7dac0aa2 (patch)
tree3b775cadea2814a2b723a6f154b961bf02b93808 /soh
parent02c0caff4fff3ab922e844ccd0fb875f163df2d7 (diff)
set version in build.c from CmakeLists.txt version info (#1678)
Diffstat (limited to 'soh')
-rw-r--r--soh/CMakeLists.txt11
-rw-r--r--soh/macosx/Info.plist.in (renamed from soh/macosx/Info.plist)6
-rw-r--r--soh/src/boot/build.c4
-rw-r--r--soh/src/boot/build.c.in5
4 files changed, 15 insertions, 11 deletions
diff --git a/soh/CMakeLists.txt b/soh/CMakeLists.txt
index 7fbb80a73..372e64d80 100644
--- a/soh/CMakeLists.txt
+++ b/soh/CMakeLists.txt
@@ -95,6 +95,8 @@ set(PROJECT_NAME soh)
################################################################################
# Source groups
################################################################################
+configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c.in ${CMAKE_BINARY_DIR}/build.c @ONLY)
+
set(Header_Files
"resource.h"
)
@@ -395,7 +397,7 @@ endif()
set(Source_Files__src__boot
"src/boot/assert.c"
"src/boot/boot_main.c"
- "src/boot/build.c"
+ "${CMAKE_BINARY_DIR}/build.c"
"src/boot/idle.c"
"src/boot/is_debug.c"
"src/boot/logutils.c"
@@ -2039,6 +2041,7 @@ find_program(CURL NAMES curl DOC "Path to the curl program. Used to download fi
execute_process(COMMAND ${CURL} -sSfL https://raw.githubusercontent.com/gabomdq/SDL_GameControllerDB/master/gamecontrollerdb.txt -o ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt OUTPUT_VARIABLE RESULT)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
+configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/macosx/Info.plist.in ${CMAKE_BINARY_DIR}/macosx/Info.plist @ONLY)
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT ship)
elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS")
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION . COMPONENT ship)
@@ -2057,8 +2060,8 @@ if(CMAKE_SYSTEM_NAME MATCHES "NintendoSwitch")
nx_generate_nacp(Ship.nacp
NAME "Ship of Harkinian"
- AUTHOR "Harbour Masters"
- VERSION "4.0.0"
+ AUTHOR "${PROJECT_TEAM}"
+ VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
)
nx_create_nro(soh
@@ -2075,7 +2078,7 @@ wut_create_rpx(${PROJECT_NAME})
wut_create_wuhb(${PROJECT_NAME}
NAME "Ship of Harkinian"
SHORTNAME "SoH"
- AUTHOR "Harbour Masters"
+ AUTHOR "${PROJECT_TEAM}"
ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg
)
diff --git a/soh/macosx/Info.plist b/soh/macosx/Info.plist.in
index 800d42eeb..b44948b36 100644
--- a/soh/macosx/Info.plist
+++ b/soh/macosx/Info.plist.in
@@ -9,7 +9,7 @@
<key>CFBundleExecutable</key>
<string>soh</string>
<key>CFBundleGetInfoString</key>
- <string>4.0.1</string>
+ <string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleIconFile</key>
<string>soh.icns</string>
<key>CFBundleIdentifier</key>
@@ -22,11 +22,11 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>4.0.1</string>
+ <string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleSignature</key>
<string>ZOoT</string>
<key>CFBundleVersion</key>
- <string>4.0.1</string>
+ <string>@CMAKE_PROJECT_VERSION@</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright 2022 HarbourMasters.</string>
<key>LSMinimumSystemVersion</key>
diff --git a/soh/src/boot/build.c b/soh/src/boot/build.c
deleted file mode 100644
index 0fb6d64ad..000000000
--- a/soh/src/boot/build.c
+++ /dev/null
@@ -1,4 +0,0 @@
-const char gBuildVersion[] = "ZHORA BRAVO (4.0.1)";
-const char gBuildTeam[] = "github.com/harbourmasters";
-const char gBuildDate[] = __DATE__ " " __TIME__;
-const char gBuildMakeOption[] = "";
diff --git a/soh/src/boot/build.c.in b/soh/src/boot/build.c.in
new file mode 100644
index 000000000..6bf50e39f
--- /dev/null
+++ b/soh/src/boot/build.c.in
@@ -0,0 +1,5 @@
+const char gBuildVersion[] = "@PROJECT_BUILD_NAME@ (@CMAKE_PROJECT_VERSION_MAJOR@.@CMAKE_PROJECT_VERSION_MINOR@.@CMAKE_PROJECT_VERSION_PATCH@)";
+const char gBuildTeam[] = "@PROJECT_TEAM@";
+const char gBuildDate[] = __DATE__ " " __TIME__;
+const char gBuildMakeOption[] = "";
+