1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-22 10:42:29 +01:00

Fix steam deploy options

Fix options being regular variables
Fix macos invalid time command
Add prints messages for all cmake options and defines
This commit is contained in:
Elias Steurer 2021-08-16 11:00:53 +02:00
parent 79e3c39721
commit cbd49b8613
2 changed files with 21 additions and 9 deletions

View File

@ -7,9 +7,10 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(SCREENPLAY_STEAM_DEPLOY OFF)
set(SCREENPLAY_STEAM ON)
set(TESTS_ENABLED OFF)
option(SCREENPLAY_STEAM_DEPLOY OFF "Steam build settings. Disables steam_app.txt copy step, that is only needed for development.")
option(SCREENPLAY_STEAM ON "For FOSS distribution so we do not bundle proprietary code.")
option(TESTS_ENABLED OFF)
file(MAKE_DIRECTORY ${CMAKE_ARCHIVE_OUTPUT_DIRECTORY})
@ -35,10 +36,9 @@ find_package(Git REQUIRED)
if(WIN32)
set(date_command "CMD")
set(date_arg "/c date /t")
elseif(APPLE)
set(date_command "date")
set(date_arg " +%y.%m.%d")
set(date_arg "")
elseif(UNIX)
set(date_command "date")
set(date_arg "")
@ -48,13 +48,13 @@ execute_process(
COMMAND ${date_command} ${date_arg}
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE BUILD_DATE
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(
COMMAND "${GIT_EXECUTABLE}" describe --always
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
OUTPUT_VARIABLE GIT_COMMIT_HASH
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE)
add_compile_definitions(COMPILE_INFO="${BUILD_DATE} + ${GIT_COMMIT_HASH}")
@ -78,3 +78,15 @@ endif()
if(WIN32)
add_subdirectory(ScreenPlaySysInfo)
endif()
message(STATUS "[DEFINE] BUILD_DATE = ${BUILD_DATE}")
message(STATUS "[DEFINE] GIT_COMMIT_HASH = ${GIT_COMMIT_HASH}")
message(STATUS "[PROJECT] CMAKE_TOOLCHAIN_FILE = ${CMAKE_TOOLCHAIN_FILE}")
message(STATUS "[PROJECT] VCPKG_PATH = ${VCPKG_PATH}")
message(STATUS "[PROJECT] VCPKG_ARCH = ${VCPKG_ARCH}")
message(STATUS "[PROJECT] CMAKE_PREFIX_PATH = ${CMAKE_PREFIX_PATH}")
message(STATUS "[PROJECT] VCPKG_TARGET_TRIPLET = ${VCPKG_TARGET_TRIPLET}")
message(STATUS "[OPTION] SCREENPLAY_STEAM_DEPLOY = ${SCREENPLAY_STEAM_DEPLOY}")
message(STATUS "[OPTION] SCREENPLAY_STEAM = ${SCREENPLAY_STEAM}")
message(STATUS "[OPTION] TESTS_ENABLED = ${TESTS_ENABLED}")

View File

@ -91,7 +91,7 @@ if(APPLE)
COMMENT "Copying steam library into ScreenPlay.app bundle"
COMMAND ${CMAKE_COMMAND} -E copy ${steam_bin} ${workshop_install_dir})
if(NOT SCREENPLAY_STEAM_DEPLOY)
if(NOT ${SCREENPLAY_STEAM_DEPLOY})
add_custom_command(
TARGET workshopplugin
POST_BUILD
@ -100,7 +100,7 @@ if(APPLE)
endif()
else()
if(NOT SCREENPLAY_STEAM_DEPLOY)
if(NOT ${SCREENPLAY_STEAM_DEPLOY})
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/steam_appid.txt ${CMAKE_BINARY_DIR}/bin/steam_appid.txt COPYONLY)
endif()
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/qmldir ${WORKSHOP_PLUGIN_DIR}/qmldir COPYONLY)