Fix up screenshare conditionals

This commit is contained in:
David Rowe 2021-04-06 15:36:57 +12:00
parent bed6f32c7a
commit 87bb4654ee
2 changed files with 26 additions and 16 deletions

View file

@ -125,6 +125,15 @@ else()
set(MOBILE 0) set(MOBILE 0)
endif() endif()
set(SCREENSHARE 0)
if (WIN32)
set(SCREENSHARE 1)
endif()
if (APPLE AND NOT CLIENT_ONLY)
# Don't include Screenshare in OSX client-only builds.
set(SCREENSHARE 1)
endif()
# Use default time server if none defined in environment # Use default time server if none defined in environment
set_from_env(TIMESERVER_URL TIMESERVER_URL "http://timestamp.comodoca.com?td=sha256") set_from_env(TIMESERVER_URL TIMESERVER_URL "http://timestamp.comodoca.com?td=sha256")
@ -316,10 +325,6 @@ endif()
if (BUILD_CLIENT) if (BUILD_CLIENT)
add_subdirectory(interface) add_subdirectory(interface)
if (NOT APPLE OR NOT CLIENT_ONLY)
# Don't include Screenshare in OSX client-only builds.
add_subdirectory(screenshare)
endif()
if (APPLE) if (APPLE)
set_target_properties(Vircadia PROPERTIES FOLDER "Apps") set_target_properties(Vircadia PROPERTIES FOLDER "Apps")
else() else()
@ -334,6 +339,10 @@ if (BUILD_CLIENT OR BUILD_SERVER)
add_subdirectory(server-console) add_subdirectory(server-console)
endif() endif()
if (SCREENSHARE)
add_subdirectory(screenshare)
endif()
# BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway # BUILD_TOOLS option will be handled inside the tools's CMakeLists.txt because 'scribe' tool is required for build anyway
add_subdirectory(tools) add_subdirectory(tools)

View file

@ -196,16 +196,12 @@ if (BUILD_TOOLS AND NPM_EXECUTABLE)
add_dependencies(resources jsdoc) add_dependencies(resources jsdoc)
endif() endif()
if (WIN32) if (WIN32 OR APPLE)
add_dependencies(${TARGET_NAME} resources screenshare) add_dependencies(${TARGET_NAME} resources)
endif() endif()
if (APPLE) if (SCREENSHARE)
add_dependencies(${TARGET_NAME} resources) add_dependencies(${TARGET_NAME} screenshare)
# Don't include Screenshare in OSX client-only builds.
if (NOT CLIENT_ONLY)
add_dependencies(${TARGET_NAME} screenshare)
endif()
endif() endif()
if (WIN32) if (WIN32)
@ -346,10 +342,6 @@ if (APPLE)
COMMAND "${CMAKE_COMMAND}" -E copy_directory COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_SOURCE_DIR}/scripts" "${CMAKE_SOURCE_DIR}/scripts"
"${RESOURCES_DEV_DIR}/scripts" "${RESOURCES_DEV_DIR}/scripts"
# copy screenshare app to the resource folder
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_CURRENT_BINARY_DIR}/../screenshare/hifi-screenshare-darwin-x64/hifi-screenshare.app"
"${RESOURCES_DEV_DIR}/hifi-screenshare.app"
# copy JSDoc files beside the executable # copy JSDoc files beside the executable
COMMAND "${CMAKE_COMMAND}" -E copy_directory COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_SOURCE_DIR}/tools/jsdoc/out" "${CMAKE_SOURCE_DIR}/tools/jsdoc/out"
@ -376,6 +368,15 @@ if (APPLE)
"${RESOURCES_DEV_DIR}/serverless/redirect.json" "${RESOURCES_DEV_DIR}/serverless/redirect.json"
) )
if (SCREENSHARE)
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
# copy screenshare app to the resource folder
COMMAND "${CMAKE_COMMAND}" -E copy_directory
"${CMAKE_CURRENT_BINARY_DIR}/../screenshare/hifi-screenshare-darwin-x64/hifi-screenshare.app"
"${RESOURCES_DEV_DIR}/hifi-screenshare.app"
)
endif()
# call the fixup_interface macro to add required bundling commands for installation # call the fixup_interface macro to add required bundling commands for installation
fixup_interface() fixup_interface()