Merge branch 'develop' into myk_title_launch
commit
d48f4844d6
@ -1,38 +1,32 @@
|
|||||||
project(package_windows)
|
project(package_windows)
|
||||||
|
|
||||||
if(WIN32)
|
option(BUILD_DFLAUNCH "Whether to build the Steam launcher exectuable (requires Steam SDK)." OFF)
|
||||||
if (BUILD_DFLAUNCH)
|
|
||||||
if ((DEFINED ENV{steam_username}) AND (DEFINED ENV{steam_password}))
|
|
||||||
# download Steam SDK
|
|
||||||
set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam)
|
|
||||||
file(DOWNLOAD "https://partner.steamgames.com/downloads/steamworks_sdk_156.zip"
|
|
||||||
${STEAMAPI_DIR}/steamworks_sdk_156.zip
|
|
||||||
EXPECTED_HASH MD5=af5a579990dbe5ae4c1b0689260d001b
|
|
||||||
USERPWD $ENV{steam_username}:$ENV{steam_password}
|
|
||||||
STATUS STEAM_SDK_DOWNLOAD_STATUS
|
|
||||||
SHOW_PROGRESS
|
|
||||||
)
|
|
||||||
list(GET STEAM_SDK_DOWNLOAD_STATUS 0 STEAM_SDK_DL_STATUS_CODE)
|
|
||||||
list(GET STEAM_SDK_DOWNLOAD_STATUS 1 STEAM_SDK_DL_ERROR_MESSAGE)
|
|
||||||
if (NOT (${STEAM_SDK_DL_STATUS_CODE} EQUAL 0))
|
|
||||||
message(FATAL_ERROR "Steam SDK download: " ${STEAM_SDK_DL_ERROR_MESSAGE})
|
|
||||||
else ()
|
|
||||||
message(STATUS "Steam SDK download: " ${STEAM_SDK_DL_ERROR_MESSAGE})
|
|
||||||
file(ARCHIVE_EXTRACT
|
|
||||||
INPUT ${STEAMAPI_DIR}/steamworks_sdk_156.zip
|
|
||||||
DESTINATION ${STEAMAPI_DIR})
|
|
||||||
set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib")
|
|
||||||
set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam")
|
|
||||||
set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll")
|
|
||||||
endif()
|
|
||||||
else()
|
|
||||||
message(SEND_ERROR "Need to set steam_username and steam_password in environment to download Steamworks SDK")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
include_directories(${STEAMAPI_SOURCE_DIR})
|
if(WIN32 AND BUILD_DFLAUNCH)
|
||||||
link_libraries(${STEAMAPI_LIBRARY})
|
# builder must manually download Steam SDK
|
||||||
add_executable(launchdf WIN32 launchdf.cpp)
|
set (STEAMAPI_DIR ${dfhack_SOURCE_DIR}/depends/steam)
|
||||||
install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION})
|
set (STEAMAPI_VER 156)
|
||||||
install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION})
|
set (STEAMAPI_ZIP_EXPECTED_HASH af5a579990dbe5ae4c1b0689260d001b)
|
||||||
|
set (STEAMSDK_ZIP ${STEAMAPI_DIR}/steamworks_sdk_${STEAMAPI_VER}.zip)
|
||||||
|
|
||||||
|
set (STEAM_SDK_HASH "NOT FOUND")
|
||||||
|
file(MD5 ${STEAMSDK_ZIP} STEAM_SDK_HASH)
|
||||||
|
if (NOT (${STEAM_SDK_HASH} STREQUAL ${STEAMAPI_ZIP_EXPECTED_HASH}))
|
||||||
|
message(FATAL_ERROR "You need the Steamworks SDK at ${STEAMSDK_ZIP} to build launchdf.exe. Please disable the BUILD_DFLAUNCH CMake option or download the Steam SDK from: https://partner.steamgames.com/downloads/steamworks_sdk_${STEAMAPI_VER}.zip")
|
||||||
|
endif()
|
||||||
|
if (${STEAMSDK_ZIP} IS_NEWER_THAN ${STEAMAPI_DIR}/sdk)
|
||||||
|
file(ARCHIVE_EXTRACT
|
||||||
|
INPUT ${STEAMSDK_ZIP}
|
||||||
|
DESTINATION ${STEAMAPI_DIR})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
set(STEAMAPI_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.lib")
|
||||||
|
set(STEAMAPI_SOURCE_DIR "${STEAMAPI_DIR}/sdk/public/steam")
|
||||||
|
set(STEAMAPI_SHARED_LIBRARY "${STEAMAPI_DIR}/sdk/redistributable_bin/win64/steam_api64.dll")
|
||||||
|
|
||||||
|
include_directories(${STEAMAPI_SOURCE_DIR})
|
||||||
|
link_libraries(${STEAMAPI_LIBRARY})
|
||||||
|
add_executable(launchdf WIN32 launchdf.cpp)
|
||||||
|
install(TARGETS launchdf DESTINATION ${DFHACK_DATA_DESTINATION})
|
||||||
|
install(FILES ${STEAMAPI_SHARED_LIBRARY} DESTINATION ${DFHACK_DATA_DESTINATION})
|
||||||
endif()
|
endif()
|
||||||
|
@ -1 +1 @@
|
|||||||
Subproject commit 2a646f9c7204253cae70bbfb5ed194182e0ac373
|
Subproject commit 0f02ade81771a7c24a4bbd6cfd7969704288f94b
|
Loading…
Reference in New Issue