diff --git a/CMake/Packaging-2.cmake b/CMake/Packaging-2.cmake index 2e1183190..c6e501c73 100644 --- a/CMake/Packaging-2.cmake +++ b/CMake/Packaging-2.cmake @@ -22,7 +22,7 @@ endif() if (CPACK_GENERATOR MATCHES "Bundle") 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_STARTUP_COMMAND "../soh/macosx/soh-macos.sh") set(CPACK_BUNDLE_APPLE_CERT_APP "-") diff --git a/CMakeLists.txt b/CMakeLists.txt index 436872372..db2ccbc0d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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) -project(Ship C CXX) - -set(PROJECT_VERSION_MAJOR "4") -set(PROJECT_VERSION_MINOR "0") -set(PROJECT_VERSION_PATCH "1") +project(Ship LANGUAGES C CXX + VERSION 4.0.1) +set(PROJECT_BUILD_NAME "ZHORA BRAVO" CACHE STRING "") +set(PROJECT_TEAM "github.com/harbourmasters" CACHE STRING "") set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT soh) add_compile_options($<$:/MP>) 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 similarity index 88% rename from soh/macosx/Info.plist rename to soh/macosx/Info.plist.in index 800d42eeb..b44948b36 100644 --- a/soh/macosx/Info.plist +++ b/soh/macosx/Info.plist.in @@ -9,7 +9,7 @@ CFBundleExecutable soh CFBundleGetInfoString - 4.0.1 + @CMAKE_PROJECT_VERSION@ CFBundleIconFile soh.icns CFBundleIdentifier @@ -22,11 +22,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 4.0.1 + @CMAKE_PROJECT_VERSION@ CFBundleSignature ZOoT CFBundleVersion - 4.0.1 + @CMAKE_PROJECT_VERSION@ NSHumanReadableCopyright Copyright 2022 HarbourMasters. LSMinimumSystemVersion 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[] = ""; +