Skip to content

Commit

Permalink
feat: minor fix to packaing for steam
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Pollind <[email protected]>
  • Loading branch information
pollend committed Jan 9, 2025
1 parent 0ef7831 commit 0ec1917
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Linux" OR MINGW)
else()
set(TAR_GZ_DIST "${QFUSION_TAR_GZ_OUTPUT_DIRECTORY}/${QFUSION_CLIENT_NAME}_${TAR_GZ_NAME}")
endif()
add_custom_target(tar_gz COMMAND ${CMAKE_COMMAND} -E tar "cfvz" ${TAR_GZ_DIST} "${CMAKE_HOME_DIRECTORY}/build/")
add_custom_target(tar_gz COMMAND ${CMAKE_COMMAND} -E tar "cfvz" ${TAR_GZ_DIST} "${CMAKE_BINARY_DIR}/warfork-qfusion/")
add_dependencies(tar_gz ${QFUSION_CLIENT_NAME} game ${QFUSION_SERVER_NAME} ${QFUSION_TVSERVER_NAME})
endif()

Expand Down Expand Up @@ -332,7 +332,7 @@ if(USE_PACKAGE_ASSETS)
add_custom_target(deploy ALL
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${CMAKE_COMMAND}
-DBIN_DIR=${CMAKE_BINARY_DIR}
-DBIN_DIR=${CMAKE_BINARY_DIR}/warfork-qfusion
-DASSET_ROOT=${CMAKE_CURRENT_SOURCE_DIR}/../assets
-P ${CMAKE_CURRENT_SOURCE_DIR}/package_assets.cmake
COMMENT "packaging assets ...")
Expand Down
26 changes: 13 additions & 13 deletions source/client/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ add_dependencies(${QFUSION_CLIENT_NAME} angelwrap cgame cin ftlib game ref_gl sn
set(STEAMSHIMPARENT_LIBRARY steamshim_parent)

execute_process(COMMAND git rev-parse HEAD WORKING_DIRECTORY ${CMAKE_HOME_DIRECTORY}/.. OUTPUT_VARIABLE GIT_COMMIT_HASH OUTPUT_STRIP_TRAILING_WHITESPACE)
file(WRITE ${CMAKE_HOME_DIRECTORY}/build/commit.txt ${GIT_COMMIT_HASH})
file(WRITE ${CMAKE_BINARY_DIR}/warfork-qfusion/commit.txt ${GIT_COMMIT_HASH})

file(WRITE ${CMAKE_HOME_DIRECTORY}/build/steam_appid.txt ${QFUSION_GAME_STEAMAPPID})
file(WRITE ${CMAKE_BINARY_DIR}/warfork-qfusion/steam_appid.txt ${QFUSION_GAME_STEAMAPPID})

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_target_properties(${QFUSION_CLIENT_NAME} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${QFUSION_MAC_INFO_PLIST})
Expand All @@ -231,22 +231,22 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set_source_files_properties(${QFUSION_DATA_DIR}/docs PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
endif()

set(BUNDLE_PATH ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/${QFUSION_CLIENT_NAME}.app/Contents)
set(BUNDLE_PATH ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/${QFUSION_CLIENT_NAME}.app/Contents)
set(POST_BUILD_CMDS
cp -r ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/${QFUSION_GAME_DIR}/ ${BUNDLE_PATH}/Resources/${QFUSION_GAME_DIR}/ &&
cp -r ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/libs/ ${BUNDLE_PATH}/Resources/libs/ &&
cp ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/${QFUSION_SERVER_NAME} ${BUNDLE_PATH}/MacOS/ &&
cp ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/wf_steam${CMAKE_EXECUTABLE_SUFFIX} ${BUNDLE_PATH}/Resources/ &&
cp ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/${QFUSION_TVSERVER_NAME} ${BUNDLE_PATH}/MacOS/ &&
cp ${CMAKE_HOME_DIRECTORY}/build/libsteam_api.dylib ${BUNDLE_PATH}/Resources/ &&
cp ${CMAKE_HOME_DIRECTORY}/build/commit.txt ${BUNDLE_PATH}/MacOS/ &&
cp ${CMAKE_HOME_DIRECTORY}/build/steam_appid.txt ${BUNDLE_PATH}/Resources/
cp -r ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/${QFUSION_GAME_DIR}/ ${BUNDLE_PATH}/Resources/${QFUSION_GAME_DIR}/ &&
cp -r ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/libs/ ${BUNDLE_PATH}/Resources/libs/ &&
cp ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/${QFUSION_SERVER_NAME} ${BUNDLE_PATH}/MacOS/ &&
cp ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/wf_steam${CMAKE_EXECUTABLE_SUFFIX} ${BUNDLE_PATH}/Resources/ &&
cp ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/${QFUSION_TVSERVER_NAME} ${BUNDLE_PATH}/MacOS/ &&
cp ${CMAKE_BINARY_DIR}/warfork-qfusion/libsteam_api.dylib ${BUNDLE_PATH}/Resources/ &&
cp ${CMAKE_BINARY_DIR}/warfork-qfusion/commit.txt ${BUNDLE_PATH}/MacOS/ &&
cp ${CMAKE_BINARY_DIR}/warfork-qfusion/steam_appid.txt ${BUNDLE_PATH}/Resources/
)

add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${POST_BUILD_CMDS})
elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_HOME_DIRECTORY}/build/commit.txt ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/)
add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_HOME_DIRECTORY}/build/steam_appid.txt ${CMAKE_HOME_DIRECTORY}/build/$(CONFIGURATION)/)
add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/warfork-qfusion/commit.txt ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/)
add_custom_command(TARGET ${QFUSION_CLIENT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_BINARY_DIR}/warfork-qfusion/steam_appid.txt ${CMAKE_BINARY_DIR}/warfork-qfusion/$(CONFIGURATION)/)
endif()

target_link_libraries(${QFUSION_CLIENT_NAME} PRIVATE CURL::libcurl ${CLIENT_PLATFORM_LIBRARIES} ${DISCORD_LIBRARY} ${STEAMSHIMPARENT_LIBRARY})
Expand Down
4 changes: 2 additions & 2 deletions source/steamshim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ include_directories("${STEAMWORKS_SDK_DIR}/public")

set(STEAMWORKS_LIBRARY steam_api)
# Please note, this is not in the 'libs' directory!
set(STEAMWORKS_OUTPUT_PATH ${CMAKE_HOME_DIRECTORY}/build)
set(STEAMWORKS_OUTPUT_PATH ${CMAKE_BINARY_DIR}/warfork-qfusion)

if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
Expand All @@ -22,7 +22,7 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "Windows")
endif()
set(STEAMWORKS_LIBRARY_EXTENSION .dll)
# This is not a typo, but using Visual Studio's 'Configuration' property!
set(STEAMWORKS_OUTPUT_PATH "${CMAKE_HOME_DIRECTORY}/build/$(Configuration)")
set(STEAMWORKS_OUTPUT_PATH "${CMAKE_BINARY_DIR}/warfork-qfusion/$(Configuration)")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
set(STEAMWORKS_SO_PREFIX lib)
set(STEAMWORKS_LIBRARY_DIR ${STEAMWORKS_SDK_DIR}/redistributable_bin/osx)
Expand Down

0 comments on commit 0ec1917

Please sign in to comment.