set version in build.c from CmakeLists.txt version info (#1678)

This commit is contained in:
th-2021 2022-10-04 01:13:29 +02:00 committed by GitHub
parent 02c0caff4f
commit f1070a2e74
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 17 deletions

View File

@ -22,7 +22,7 @@ endif()
if (CPACK_GENERATOR MATCHES "Bundle") if (CPACK_GENERATOR MATCHES "Bundle")
set(CPACK_BUNDLE_NAME "soh") set(CPACK_BUNDLE_NAME "soh")
set(CPACK_BUNDLE_PLIST "../soh/macosx/Info.plist") set(CPACK_BUNDLE_PLIST "macosx/Info.plist")
set(CPACK_BUNDLE_ICON "macosx/soh.icns") set(CPACK_BUNDLE_ICON "macosx/soh.icns")
set(CPACK_BUNDLE_STARTUP_COMMAND "../soh/macosx/soh-macos.sh") set(CPACK_BUNDLE_STARTUP_COMMAND "../soh/macosx/soh-macos.sh")
set(CPACK_BUNDLE_APPLE_CERT_APP "-") set(CPACK_BUNDLE_APPLE_CERT_APP "-")

View File

@ -6,11 +6,10 @@ set(CMAKE_CXX_STANDARD 20 CACHE STRING "The C++ standard to use")
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.15" CACHE STRING "Minimum OS X deployment version" FORCE)
project(Ship C CXX) project(Ship LANGUAGES C CXX
VERSION 4.0.1)
set(PROJECT_VERSION_MAJOR "4") set(PROJECT_BUILD_NAME "ZHORA BRAVO" CACHE STRING "")
set(PROJECT_VERSION_MINOR "0") set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "")
set(PROJECT_VERSION_PATCH "1")
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh) set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh)
add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>) add_compile_options($<$<CXX_COMPILER_ID:MSVC>:/MP>)

View File

@ -95,6 +95,8 @@ set(PROJECT_NAME soh)
################################################################################ ################################################################################
# Source groups # Source groups
################################################################################ ################################################################################
configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/src/boot/build.c.in ${CMAKE_BINARY_DIR}/build.c @ONLY)
set(Header_Files set(Header_Files
"resource.h" "resource.h"
) )
@ -395,7 +397,7 @@ endif()
set(Source_Files__src__boot set(Source_Files__src__boot
"src/boot/assert.c" "src/boot/assert.c"
"src/boot/boot_main.c" "src/boot/boot_main.c"
"src/boot/build.c" "${CMAKE_BINARY_DIR}/build.c"
"src/boot/idle.c" "src/boot/idle.c"
"src/boot/is_debug.c" "src/boot/is_debug.c"
"src/boot/logutils.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) 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") 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) INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION ../MacOS COMPONENT ship)
elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS") elseif(NOT "${CMAKE_SYSTEM_NAME}" MATCHES "NintendoSwitch|CafeOS")
INSTALL(FILES ${CMAKE_BINARY_DIR}/gamecontrollerdb.txt DESTINATION . COMPONENT ship) 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 nx_generate_nacp(Ship.nacp
NAME "Ship of Harkinian" NAME "Ship of Harkinian"
AUTHOR "Harbour Masters" AUTHOR "${PROJECT_TEAM}"
VERSION "4.0.0" VERSION "${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}"
) )
nx_create_nro(soh nx_create_nro(soh
@ -2075,7 +2078,7 @@ wut_create_rpx(${PROJECT_NAME})
wut_create_wuhb(${PROJECT_NAME} wut_create_wuhb(${PROJECT_NAME}
NAME "Ship of Harkinian" NAME "Ship of Harkinian"
SHORTNAME "SoH" SHORTNAME "SoH"
AUTHOR "Harbour Masters" AUTHOR "${PROJECT_TEAM}"
ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg ICON ${CMAKE_CURRENT_SOURCE_DIR}/icon.jpg
) )

View File

@ -9,7 +9,7 @@
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>soh</string> <string>soh</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>4.0.1</string> <string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleIconFile</key> <key>CFBundleIconFile</key>
<string>soh.icns</string> <string>soh.icns</string>
<key>CFBundleIdentifier</key> <key>CFBundleIdentifier</key>
@ -22,11 +22,11 @@
<key>CFBundlePackageType</key> <key>CFBundlePackageType</key>
<string>APPL</string> <string>APPL</string>
<key>CFBundleShortVersionString</key> <key>CFBundleShortVersionString</key>
<string>4.0.1</string> <string>@CMAKE_PROJECT_VERSION@</string>
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>ZOoT</string> <string>ZOoT</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.0.1</string> <string>@CMAKE_PROJECT_VERSION@</string>
<key>NSHumanReadableCopyright</key> <key>NSHumanReadableCopyright</key>
<string>Copyright 2022 HarbourMasters.</string> <string>Copyright 2022 HarbourMasters.</string>
<key>LSMinimumSystemVersion</key> <key>LSMinimumSystemVersion</key>

View File

@ -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[] = "";

5
soh/src/boot/build.c.in Normal file
View File

@ -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[] = "";