diff --git a/CMakeLists.txt b/CMakeLists.txt index d9605fc734..7b3587161a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -125,6 +125,15 @@ else() set(MOBILE 0) 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 set_from_env(TIMESERVER_URL TIMESERVER_URL "http://timestamp.comodoca.com?td=sha256") @@ -316,10 +325,6 @@ endif() if (BUILD_CLIENT) 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) set_target_properties(Vircadia PROPERTIES FOLDER "Apps") else() @@ -334,6 +339,10 @@ if (BUILD_CLIENT OR BUILD_SERVER) add_subdirectory(server-console) 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 add_subdirectory(tools) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index a62f6d1231..49081389a4 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -196,16 +196,12 @@ if (BUILD_TOOLS AND NPM_EXECUTABLE) add_dependencies(resources jsdoc) endif() -if (WIN32) - add_dependencies(${TARGET_NAME} resources screenshare) +if (WIN32 OR APPLE) + add_dependencies(${TARGET_NAME} resources) endif() -if (APPLE) - add_dependencies(${TARGET_NAME} resources) - # Don't include Screenshare in OSX client-only builds. - if (NOT CLIENT_ONLY) - add_dependencies(${TARGET_NAME} screenshare) - endif() +if (SCREENSHARE) + add_dependencies(${TARGET_NAME} screenshare) endif() if (WIN32) @@ -346,10 +342,6 @@ if (APPLE) COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_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 COMMAND "${CMAKE_COMMAND}" -E copy_directory "${CMAKE_SOURCE_DIR}/tools/jsdoc/out" @@ -376,6 +368,15 @@ if (APPLE) "${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 fixup_interface()