Merge pull request #66 from birarda/console-dev

some initial packaging work and console fixes
This commit is contained in:
Ryan Huffman 2016-01-14 10:17:24 -08:00
commit 196161fe93
24 changed files with 328 additions and 191 deletions

View file

@ -30,20 +30,28 @@ set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUG")
if (WIN32)
add_definitions(-DNOMINMAX -D_CRT_SECURE_NO_WARNINGS)
# set path for Microsoft SDKs
# if get build error about missing 'glu32' this path is likely wrong
# Uncomment the line with 8.1 if running Windows 8.1
if (NOT WINDOW_SDK_PATH)
set(DEBUG_DISCOVERED_SDK_PATH TRUE)
endif()
# sets path for Microsoft SDKs
# if you get build error about missing 'glu32' this path is likely wrong
if (MSVC10)
set(WINDOW_SDK_PATH "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1 ")
set(WINDOW_SDK_PATH "C:\\Program Files\\Microsoft SDKs\\Windows\\v7.1 " CACHE PATH "Windows SDK PATH")
elseif (MSVC12)
if ("${CMAKE_SIZEOF_VOID_P}" EQUAL "8")
set(WINDOW_SDK_FOLDER "x64")
else()
set(WINDOW_SDK_FOLDER "x86")
endif()
set(WINDOW_SDK_PATH "C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${WINDOW_SDK_FOLDER}")
set(WINDOW_SDK_PATH "C:\\Program Files (x86)\\Windows Kits\\8.1\\Lib\\winv6.3\\um\\${WINDOW_SDK_FOLDER}" CACHE PATH "Windows SDK PATH")
endif ()
message (WINDOW_SDK_PATH= ${WINDOW_SDK_PATH})
if (DEBUG_DISCOVERED_SDK_PATH)
message(STATUS "The discovered Windows SDK path is ${WINDOW_SDK_PATH}")
endif ()
set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${WINDOW_SDK_PATH})
# /wd4351 disables warning C4351: new behavior: elements of array will be default initialized
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP /wd4351")
@ -201,6 +209,8 @@ if (NOT DEFINED SERVER_ONLY)
set(SERVER_ONLY 0)
endif()
set_packaging_parameters()
# add subdirectories for all targets
if (NOT ANDROID)
add_subdirectory(assignment-client)
@ -232,5 +242,4 @@ if (HIFI_MEMORY_DEBUGGING)
endif (UNIX)
endif ()
include_application_version()
generate_installers()

View file

@ -3,12 +3,11 @@ set(TARGET_NAME assignment-client)
setup_hifi_project(Core Gui Network Script Quick Widgets WebSockets)
# link in the shared libraries
link_hifi_libraries(
audio avatars octree environment gpu model fbx entities
link_hifi_libraries(
audio avatars octree environment gpu model fbx entities
networking animation recording shared script-engine embedded-webserver
controllers physics
)
include_application_version()
package_libraries_for_deployment()
consolidate_stack_components()
consolidate_installer_components()

View file

@ -0,0 +1,33 @@
macro(CONSOLIDATE_INSTALLER_COMPONENTS)
if (DEPLOY_PACKAGE AND WIN32)
# Copy icon files for interface and stack manager
if (TARGET_NAME STREQUAL "interface")
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/icon/${INTERFACE_ICON}")
set (ICON_DESTINATION_NAME "interface.ico")
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/package-bundle/${ICON_DESTINATION_NAME}
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/package-bundle
)
elseif (TARGET_NAME STREQUAL "package-console")
set (ICON_FILE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/resources/${CONSOLE_ICON}")
set (ICON_DESTINATION_NAME "console.ico")
# add a command to copy the folder produced by electron-packager to package-bundle
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/package-bundle/${ICON_DESTINATION_NAME}
COMMAND "${CMAKE_COMMAND}" -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGED_CONSOLE_FOLDER} ${CMAKE_BINARY_DIR}/package-bundle
)
else ()
# add a command to copy the fixed up binary and libraries to package-bundle
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/package-bundle
)
endif ()
endif ()
endmacro()

View file

@ -1,28 +0,0 @@
macro(CONSOLIDATE_STACK_COMPONENTS)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE)
if (WIN32)
# Copy icon files for interface and stack manager
if (TARGET_NAME STREQUAL "interface" OR TARGET_NAME STREQUAL "stack-manager")
if (TARGET_NAME STREQUAL "interface")
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/icon/${INTERFACE_ICON}")
set (ICON_DESTINATION_NAME "interface.ico")
else ()
set (ICON_FILE_PATH "${PROJECT_SOURCE_DIR}/assets/${STACK_MANAGER_ICON}")
set (ICON_DESTINATION_NAME "stack-manager.ico")
endif ()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy ${ICON_FILE_PATH} ${CMAKE_BINARY_DIR}/package-bundle/${ICON_DESTINATION_NAME}
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/package-bundle
)
else ()
add_custom_command(
TARGET ${TARGET_NAME} POST_BUILD
COMMAND "${CMAKE_COMMAND}" -E copy_directory $<TARGET_FILE_DIR:${TARGET_NAME}> ${CMAKE_BINARY_DIR}/package-bundle
)
endif ()
endif ()
endif ()
endmacro()

View file

@ -1,4 +1,4 @@
#
#
# GenerateInstallers.cmake
# cmake/macros
#
@ -7,10 +7,10 @@
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
#
macro(GENERATE_INSTALLERS)
if (DEFINED DEPLOY_PACKAGE AND DEPLOY_PACKAGE AND WIN32)
if (DEPLOY_PACKAGE AND WIN32)
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/package-bundle")
find_program(MAKENSIS_COMMAND makensis PATHS [HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\NSIS])
if (NOT MAKENSIS_COMMAND)
@ -26,5 +26,7 @@ macro(GENERATE_INSTALLERS)
COMMAND set INSTALLER_DIRECTORY=${INSTALLER_DIRECTORY}
COMMAND CMD /C "\"${MAKENSIS_COMMAND}\" ${CMAKE_SOURCE_DIR}/tools/nsis/release.nsi"
)
set_target_properties(build-package PROPERTIES EXCLUDE_FROM_ALL TRUE FOLDER "Installer")
endif ()
endmacro()
endmacro()

View file

@ -1,5 +1,5 @@
#
# IncludeApplicationVersion.cmake
#
# SetPackagingParameters.cmake
# cmake/macros
#
# Created by Leonardo Murillo on 07/14/2015.
@ -7,36 +7,42 @@
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
macro(INCLUDE_APPLICATION_VERSION)
#
# We are relying on Jenkins defined environment variables to determine the origin of this build
# and will only package if this is a PR or Release build
# This macro checks some Jenkins defined environment variables to determine the origin of this build
# and decides how targets should be packaged.
macro(SET_PACKAGING_PARAMETERS)
if (DEFINED ENV{JOB_ID})
set(DEPLOY_PACKAGE 1)
set(BUILD_SEQ $ENV{JOB_ID})
set(BUILD_TAGGED_BETA FALSE)
set(INSTALLER_COMPANY "High Fidelity")
set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}")
set(INSTALLER_NAME "interface-win64-${BUILD_SEQ}.exe")
set(INTERFACE_ICON "interface.ico")
set(STACK_MANAGER_ICON "icon.ico")
set(CONSOLE_ICON "console.ico")
elseif (DEFINED ENV{ghprbPullId})
set(DEPLOY_PACKAGE 1)
set(BUILD_TAGGED_BETA TRUE)
set(BUILD_SEQ "PR-$ENV{ghprbPullId}")
set(INSTALLER_COMPANY "High Fidelity - PR")
set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}\\${BUILD_SEQ}")
set(INSTALLER_NAME "pr-interface-win64-${BUILD_SEQ}.exe")
set(INTERFACE_ICON "interface-beta.ico")
set(STACK_MANAGER_ICON "icon-beta.ico")
set(CONSOLE_ICON "console-beta.ico")
else ()
set(BUILD_SEQ "dev")
set(BUILD_TAGGED_BETA TRUE)
set(INSTALLER_COMPANY "High Fidelity - Dev")
set(INSTALLER_DIRECTORY "${INSTALLER_COMPANY}")
set(INSTALLER_NAME "dev-interface-win64.exe")
set(INTERFACE_ICON "interface-beta.ico")
set(STACK_MANAGER_ICON "icon-beta.ico")
set(CONSOLE_ICON "console-beta.ico")
endif ()
configure_file("${MACRO_DIR}/ApplicationVersion.h.in" "${PROJECT_BINARY_DIR}/includes/ApplicationVersion.h")
include_directories("${PROJECT_BINARY_DIR}/includes")
endmacro(INCLUDE_APPLICATION_VERSION)
# create a header file our targets can use to find out the application version
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/includes")
configure_file("${MACRO_DIR}/ApplicationVersion.h.in" "${CMAKE_BINARY_DIR}/includes/ApplicationVersion.h")
endmacro(SET_PACKAGING_PARAMETERS)

View file

@ -1,36 +1,39 @@
#
#
# SetupHifiProject.cmake
#
#
# Copyright 2013 High Fidelity, Inc.
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
#
macro(SETUP_HIFI_PROJECT)
project(${TARGET_NAME})
# grab the implemenation and header files
file(GLOB TARGET_SRCS src/*)
file(GLOB SRC_SUBDIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*)
foreach(DIR ${SRC_SUBDIRS})
if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/src/${DIR}")
file(GLOB DIR_CONTENTS "src/${DIR}/*")
set(TARGET_SRCS ${TARGET_SRCS} "${DIR_CONTENTS}")
endif ()
endforeach()
if (DEFINED BUILD_BUNDLE AND BUILD_BUNDLE AND APPLE)
add_executable(${TARGET_NAME} MACOSX_BUNDLE ${TARGET_SRCS} ${AUTOMTC_SRC} ${AUTOSCRIBE_SHADER_LIB_SRC})
else ()
add_executable(${TARGET_NAME} ${TARGET_SRCS} ${AUTOMTC_SRC} ${AUTOSCRIBE_SHADER_LIB_SRC})
endif()
# include the generated application version header
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/includes")
set(${TARGET_NAME}_DEPENDENCY_QT_MODULES ${ARGN})
list(APPEND ${TARGET_NAME}_DEPENDENCY_QT_MODULES Core)
# find these Qt modules and link them to our own target
find_package(Qt5 COMPONENTS ${${TARGET_NAME}_DEPENDENCY_QT_MODULES} REQUIRED)
@ -44,7 +47,7 @@ macro(SETUP_HIFI_PROJECT)
foreach(QT_MODULE ${${TARGET_NAME}_DEPENDENCY_QT_MODULES})
target_link_libraries(${TARGET_NAME} Qt5::${QT_MODULE})
endforeach()
target_glm()
endmacro()

View file

@ -1,20 +1,28 @@
#
#
# Copyright 2015 High Fidelity, Inc.
# Created by Bradley Austin Davis on 2015/10/10
#
# Distributed under the Apache License, Version 2.0.
# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
#
#
macro(TARGET_NSIGHT)
if (WIN32)
if (USE_NSIGHT)
if (WIN32 AND USE_NSIGHT)
# grab the global CHECKED_FOR_NSIGHT_ONCE property
get_property(NSIGHT_CHECKED GLOBAL PROPERTY CHECKED_FOR_NSIGHT_ONCE)
if (NOT NSIGHT_CHECKED)
# try to find the Nsight package and add it to the build if we find it
find_package(NSIGHT)
if (NSIGHT_FOUND)
include_directories(${NSIGHT_INCLUDE_DIRS})
add_definitions(-DNSIGHT_FOUND)
target_link_libraries(${TARGET_NAME} "${NSIGHT_LIBRARIES}")
endif ()
endif()
endif (WIN32)
endmacro()
# set the global CHECKED_FOR_NSIGHT_ONCE property so that we only debug that we couldn't find it once
set_property(GLOBAL PROPERTY CHECKED_FOR_NSIGHT_ONCE TRUE)
endif ()
if (NSIGHT_FOUND)
include_directories(${NSIGHT_INCLUDE_DIRS})
add_definitions(-DNSIGHT_FOUND)
target_link_libraries(${TARGET_NAME} "${NSIGHT_LIBRARIES}")
endif ()
endif ()
endmacro()

3
console/.gitignore vendored
View file

@ -1,3 +1,4 @@
High\ Fidelity-*/
Server\ Console-*/
server-console-*/
npm-debug.log
logs/

View file

@ -1,15 +1,24 @@
set(PACKAGING_TARGET_NAME package-console)
set(TARGET_NAME package-console)
# add a target that when built will produce an executable of console for this platform
if (APPLE)
set(PACKAGE_COMMAND package-darwin)
elseif (WIN32)
set(PACKAGE_COMMAND package-win)
elseif (UNIX)
set(PACKAGE_COMMAND package-linux)
endif ()
if (BUILD_TAGGED_BETA)
set(BETA_OPTION "--beta")
endif()
add_custom_target(${PACKAGING_TARGET_NAME}
COMMAND npm run-script ${PACKAGE_COMMAND}
# add a target that will package the console
add_custom_target(${TARGET_NAME}
COMMAND npm run packager -- --out ${CMAKE_CURRENT_BINARY_DIR} ${BETA_OPTION}
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
# set the packaged console folder depending on platform, so we can copy it
if (APPLE)
set(PACKAGED_CONSOLE_FOLDER "Server\\ Console-darwin-x64")
elseif (WIN32)
set(PACKAGED_CONSOLE_FOLDER "server-console-win32-x64")
elseif (UNIX)
set(PACKAGED_CONSOLE_FOLDER "server-console-linux-x64")
endif ()
set_target_properties(${TARGET_NAME} PROPERTIES EXCLUDE_FROM_ALL TRUE FOLDER "Installer")
consolidate_installer_components()

View file

@ -20,9 +20,7 @@
"scripts": {
"start": "electron . --local-debug-builds --debug",
"local-release": "electron . --local-release-builds --debug",
"package-darwin": "electron-packager . High\\ Fidelity --overwrite --platform=darwin --arch=x64 --version=0.35.4 --icon=resources/console.icns",
"package-win": "electron-packager . High\\ Fidelity --overwrite --platform=win32 --arch=x64 --version=0.35.4 --icon=resources/console.ico",
"package-linux": "electron-packager . High\\ Fidelity --overwrite --platform=linux --arch=x64 --version=0.35.4"
"packager": "node packager.js"
},
"dependencies": {
"extend": "^3.0.0",

57
console/packager.js Normal file
View file

@ -0,0 +1,57 @@
var packager = require('electron-packager')
var osType = require('os').type();
var platform = null;
if (osType == "Darwin" || osType == "Linux") {
platform = osType.toLowerCase();
} else if (osType == "Windows_NT") {
platform = "win32"
}
var argv = require('yargs').argv;
// check which icon we should use, beta or regular
var iconName = argv.beta ? "console-beta" : "console"
// setup the common options for the packager
var options = {
dir: __dirname,
name: "server-console",
version: "0.35.4",
overwrite: true,
prune: true,
arch: "x64",
platform: platform,
icon: "resources/" + iconName
}
const EXEC_NAME = "server-console";
const SHORT_NAME = "Server Console";
const FULL_NAME = "High Fidelity Server Console";
// setup per OS options
if (osType == "Darwin") {
options["name"] = SHORT_NAME
} else if (osType == "Windows_NT") {
options["version-string"] = {
CompanyName: "High Fidelity, Inc.",
FileDescription: SHORT_NAME,
ProductName: FULL_NAME,
OriginalFilename: EXEC_NAME + ".exe"
}
}
// check if we were passed a custom out directory, pass it along if so
if (argv.out) {
options.out = argv.out
}
// call the packager to produce the executable
packager(options, function(error, appPath) {
if (error) {
console.error("There was an error writing the packaged console: " + error.message);
process.exit(1);
} else {
console.log("Wrote new app to " + appPath);
}
});

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 320 KiB

View file

@ -10,6 +10,7 @@ var shell = require('shell');
var os = require('os');
var childProcess = require('child_process');
var path = require('path');
const dialog = require('electron').dialog;
var hfprocess = require('./modules/hf-process.js');
var Process = hfprocess.Process;
@ -24,7 +25,6 @@ var path = require('path');
const TRAY_FILENAME = (osType == "Darwin" ? "console-tray-Template.png" : "console-tray.png");
const TRAY_ICON = path.join(__dirname, '../resources/' + TRAY_FILENAME);
const APP_ICON = path.join(__dirname, '../resources/console.png');
// print out uncaught exceptions in the console
process.on('uncaughtException', console.log.bind(console));
@ -55,8 +55,40 @@ if (argv.localDebugBuilds || argv.localReleaseBuilds) {
acPath = pathFinder.discoveredPath("assignment-client", argv.localReleaseBuilds);
}
function binaryMissingMessage(displayName, executableName, required) {
var message = "The " + displayName + " executable was not found.\n";
if (required) {
message += "It is required for the Server Console to run.\n\n";
} else {
message += "\n";
}
if (debug) {
message += "Please ensure there is a compiled " + displayName + " in a folder named build in this checkout.\n\n";
message += "It was expected to be found at one of the following paths:\n";
var paths = pathFinder.searchPaths(executableName, argv.localReleaseBuilds);
message += paths.join("\n");
} else {
message += "It is expected to be found beside this executable.\n"
message += "You may need to re-install the Server Console.";
}
return message;
}
// if at this point any of the paths are null, we're missing something we wanted to find
// TODO: show an error for the binaries that couldn't be found
if (!dsPath) {
dialog.showErrorBox("Domain Server Not Found", binaryMissingMessage("domain-server", "domain-server", true));
app.quit();
}
if (!acPath) {
dialog.showErrorBox("Assignment Client Not Found", binaryMissingMessage("assignment-client", "assignment-client", true))
app.quit();
}
function openFileBrowser(path) {
if (osType == "Windows_NT") {
@ -82,6 +114,7 @@ function startInterface(url) {
}
var tray = null;
var logPath = null;
var homeServer = null;
const GO_HOME_INDEX = 0;
@ -90,11 +123,20 @@ const RESTART_INDEX = 3;
const STOP_INDEX = 4;
const SETTINGS_INDEX = 5;
function goHomeClicked() {
if (interfacePath) {
startInterface('hifi://localhost');
} else {
// show an error to say that we can't go home without an interface instance
dialog.showErrorBox("Client Not Found", binaryMissingMessage("High Fidelity Client", "Interface", false));
}
}
function buildMenuArray(serverState) {
var menuArray = [
{
label: 'Go Home',
click: function() { startInterface('hifi://localhost'); },
click: goHomeClicked,
enabled: false
},
{
@ -183,15 +225,19 @@ app.on('ready', function() {
app.dock.hide()
}
var logPath = path.join(app.getAppPath(), 'logs');
logPath = path.join(app.getAppPath(), 'logs');
// Create tray icon
tray = new Tray(TRAY_ICON);
tray.setToolTip('High Fidelity');
tray.setToolTip('High Fidelity Server Console');
tray.on('click', function() {
tray.popUpContextMenu(tray.menu);
});
updateTrayMenu(ProcessGroupStates.STOPPED);
if (interfacePath && dsPath && acPath) {
if (dsPath && acPath) {
homeServer = new ProcessGroup('home', [
new Process('domain-server', dsPath),
new Process('ac-monitor', acPath, ['-n6', '--log-directory', logPath])

View file

@ -1,54 +1,49 @@
var fs = require('fs');
exports.discoveredPath = function (name, preferRelease) {
var path = "../build/" + name + "/";
function binaryFromPath(name, path) {
function platformExtension(name) {
if (name == "Interface") {
if (process.platform == "darwin") {
return ".app/Contents/MacOS/" + name
} else if (process.platform == "win32") {
return ".exe"
} else {
return ""
}
exports.searchPaths = function(name, preferRelease) {
function platformExtension(name) {
if (name == "Interface") {
if (process.platform == "darwin") {
return ".app/Contents/MacOS/" + name
} else if (process.platform == "win32") {
return ".exe"
} else {
return process.platform == "win32" ? ".exe" : ""
return ""
}
} else {
return process.platform == "win32" ? ".exe" : ""
}
}
var extension = platformExtension(name);
var fullPath = path + name + extension;
var extension = platformExtension(name);
var basePath = "../build/" + name + "/";
try {
var stats = fs.lstatSync(fullPath);
return [
basePath + name + extension,
basePath + (preferRelease ? "Release/" : "Debug/") + name + extension
];
}
if (stats.isFile() || (stats.isDirectory() && extension == ".app")) {
console.log("Found " + name + " at " + fullPath);
return fullPath;
exports.discoveredPath = function (name, preferRelease) {
function binaryFromPaths(name, paths) {
for (var i = 0; i < paths.length; i++) {
var path = paths[i];
try {
var stats = fs.lstatSync(path);
if (stats.isFile() || (stats.isDirectory() && extension == ".app")) {
console.log("Found " + name + " at " + path);
return path;
}
} catch (e) {
console.warn("Executable with name " + name + " not found at path " + path);
}
} catch (e) {
console.warn("Executable with name " + name + " not found at path " + fullPath);
}
return null;
}
// does the executable exist at this path already?
// if so assume we're on a platform that doesn't have Debug/Release
// folders and just use the discovered executable
var matchingBinary = binaryFromPath(name, path);
if (matchingBinary == null) {
if (preferRelease) {
// check if we can find the executable in a Release folder below this path
matchingBinary = binaryFromPath(name, path + "Release/");
} else {
// check if we can find the executable in a Debug folder below this path
matchingBinary = binaryFromPath(name, path + "Debug/");
}
}
return matchingBinary;
// attempt to find a binary at the usual paths, return null if it doesn't exist
return binaryFromPaths(name, this.searchPaths(name, preferRelease));
}

View file

@ -36,6 +36,5 @@ if (UNIX)
target_link_libraries(${TARGET_NAME} ${CMAKE_DL_LIBS})
endif (UNIX)
include_application_version()
package_libraries_for_deployment()
consolidate_stack_components()
consolidate_installer_components()

View file

@ -20,12 +20,10 @@ find_package(Qt5LinguistTools REQUIRED)
find_package(Qt5LinguistToolsMacros)
if (WIN32)
add_definitions(-D_USE_MATH_DEFINES) # apparently needed to get M_PI and other defines from cmath/math.h
add_definitions(-DWINDOWS_LEAN_AND_MEAN) # needed to make sure windows doesn't go to crazy with its defines
add_definitions(-D_USE_MATH_DEFINES) # apparently needed to get M_PI and other defines from cmath/math.h
add_definitions(-DWINDOWS_LEAN_AND_MEAN) # needed to make sure windows doesn't go to crazy with its defines
endif()
include_application_version()
# grab the implementation and header files from src dirs
file(GLOB_RECURSE INTERFACE_SRCS "src/*.cpp" "src/*.h")
GroupSources("src")
@ -45,8 +43,8 @@ else ()
list(REMOVE_ITEM INTERFACE_SRCS ${SPEECHRECOGNIZER_CPP})
endif ()
find_package(Qt5 COMPONENTS
Gui Multimedia Network OpenGL Qml Quick Script Svg
find_package(Qt5 COMPONENTS
Gui Multimedia Network OpenGL Qml Quick Script Svg
WebChannel WebEngine WebEngineWidgets WebKitWidgets WebSockets)
# grab the ui files in resources/ui
@ -69,19 +67,19 @@ if (APPLE)
set(MACOSX_BUNDLE_BUNDLE_NAME Interface)
set(MACOSX_BUNDLE_GUI_IDENTIFIER io.highfidelity.Interface)
if (UPPER_CMAKE_BUILD_TYPE MATCHES RELEASE OR UPPER_CMAKE_BUILD_TYPE MATCHES RELWITHDEBINFO)
set(ICON_FILENAME "interface.icns")
else ()
set(ICON_FILENAME "interface-beta.icns")
endif ()
# set how the icon shows up in the Info.plist file
SET(MACOSX_BUNDLE_ICON_FILE "${ICON_FILENAME}")
# set where in the bundle to put the resources file
SET_SOURCE_FILES_PROPERTIES(${CMAKE_CURRENT_SOURCE_DIR}/icon/${ICON_FILENAME} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
set(DISCOVERED_RESOURCES "")
# use the add_resources_to_os_x_bundle macro to recurse into resources
@ -89,7 +87,7 @@ if (APPLE)
# append the discovered resources to our list of interface sources
list(APPEND INTERFACE_SRCS ${DISCOVERED_RESOURCES})
set(INTERFACE_SRCS ${INTERFACE_SRCS} "${CMAKE_CURRENT_SOURCE_DIR}/icon/${ICON_FILENAME}")
endif()
@ -102,7 +100,9 @@ else()
add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM})
endif()
# These are external plugins, but we need to do the 'add dependency' here so that their
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/includes")
# These are external plugins, but we need to do the 'add dependency' here so that their
# binary directories get added to the fixup path
add_dependency_external_projects(sixense)
add_dependency_external_projects(sdl2)
@ -121,11 +121,14 @@ if (WIN32)
endif()
# link required hifi libraries
link_hifi_libraries(shared octree environment gpu gl procedural model render
recording fbx networking model-networking entities avatars
audio audio-client animation script-engine physics
link_hifi_libraries(shared octree environment gpu gl procedural model render
recording fbx networking model-networking entities avatars
audio audio-client animation script-engine physics
render-utils entities-renderer ui auto-updater
controllers plugins display-plugins input-plugins )
controllers plugins display-plugins input-plugins)
# include the binary directory of render-utils for shader includes
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/libraries/render-utils")
#fixme find a way to express faceshift as a plugin
target_bullet()
@ -138,34 +141,34 @@ endif()
# perform standard include and linking for found externals
foreach(EXTERNAL ${OPTIONAL_EXTERNALS})
if (${${EXTERNAL}_UPPERCASE}_REQUIRED)
find_package(${EXTERNAL} REQUIRED)
else ()
find_package(${EXTERNAL})
endif ()
if (${${EXTERNAL}_UPPERCASE}_FOUND AND NOT DISABLE_${${EXTERNAL}_UPPERCASE})
add_definitions(-DHAVE_${${EXTERNAL}_UPPERCASE})
# include the library directories (ignoring warnings)
if (NOT ${${EXTERNAL}_UPPERCASE}_INCLUDE_DIRS)
set(${${EXTERNAL}_UPPERCASE}_INCLUDE_DIRS ${${${EXTERNAL}_UPPERCASE}_INCLUDE_DIR})
endif ()
include_directories(SYSTEM ${${${EXTERNAL}_UPPERCASE}_INCLUDE_DIRS})
# perform the system include hack for OS X to ignore warnings
if (APPLE)
foreach(EXTERNAL_INCLUDE_DIR ${${${EXTERNAL}_UPPERCASE}_INCLUDE_DIRS})
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${EXTERNAL_INCLUDE_DIR}")
endforeach()
endif ()
if (NOT ${${EXTERNAL}_UPPERCASE}_LIBRARIES)
set(${${EXTERNAL}_UPPERCASE}_LIBRARIES ${${${EXTERNAL}_UPPERCASE}_LIBRARY})
endif ()
if (NOT APPLE OR NOT ${${EXTERNAL}_UPPERCASE} MATCHES "SIXENSE")
target_link_libraries(${TARGET_NAME} ${${${EXTERNAL}_UPPERCASE}_LIBRARIES})
elseif (APPLE AND NOT INSTALLER_BUILD)
@ -179,13 +182,13 @@ include_directories("${PROJECT_SOURCE_DIR}/src")
target_link_libraries(
${TARGET_NAME}
Qt5::Gui Qt5::Network Qt5::Multimedia Qt5::OpenGL
Qt5::Qml Qt5::Quick Qt5::Script Qt5::Svg
Qt5::Gui Qt5::Network Qt5::Multimedia Qt5::OpenGL
Qt5::Qml Qt5::Quick Qt5::Script Qt5::Svg
Qt5::WebChannel Qt5::WebEngine Qt5::WebEngineWidgets Qt5::WebKitWidgets
)
# Issue causes build failure unless we add this directory.
# See https://bugreports.qt.io/browse/QTBUG-43351
# Issue causes build failure unless we add this directory.
# See https://bugreports.qt.io/browse/QTBUG-43351
if (WIN32)
add_paths_to_fixup_libs(${Qt5_DIR}/../../../plugins/qtwebengine)
endif()
@ -199,7 +202,7 @@ if (APPLE)
find_library(AppKit AppKit)
target_link_libraries(${TARGET_NAME} ${OpenGL} ${AppKit})
# install command for OS X bundle
INSTALL(TARGETS ${TARGET_NAME}
BUNDLE DESTINATION "${CMAKE_CURRENT_BINARY_DIR}/install" COMPONENT Runtime
@ -229,4 +232,4 @@ if (WIN32)
endif()
package_libraries_for_deployment()
consolidate_stack_components()
consolidate_installer_components()

View file

@ -22,11 +22,11 @@
#include <RenderArgs.h>
#include <ViewFrustum.h>
#include "../../libraries/render-utils/stars_vert.h"
#include "../../libraries/render-utils/stars_frag.h"
#include <stars_vert.h>
#include <stars_frag.h>
#include "../../libraries/render-utils/standardTransformPNTC_vert.h"
#include "../../libraries/render-utils/starsGrid_frag.h"
#include <standardTransformPNTC_vert.h>
#include <starsGrid_frag.h>
//static const float TILT = 0.23f;
static const float TILT = 0.0f;

View file

@ -2,6 +2,8 @@ set(TARGET_NAME networking)
setup_hifi_library(Network)
link_hifi_libraries(shared)
target_include_directories(${TARGET_NAME} PRIVATE "${CMAKE_BINARY_DIR}/includes")
if (WIN32)
# we need ws2_32.lib on windows, but it's static so we don't bubble it up
target_link_libraries(${TARGET_NAME} ws2_32.lib)
@ -31,4 +33,3 @@ endif (UNIX)
# append tbb includes to our list of includes to bubble
target_include_directories(${TARGET_NAME} SYSTEM PUBLIC ${TBB_INCLUDE_DIRS})
include_application_version()

View file

@ -19,7 +19,6 @@
#include <QtCore/QThread>
#include <QtNetwork/QHostInfo>
#include <ApplicationVersion.h>
#include <LogHandler.h>
#include <UUID.h>

View file

@ -19,8 +19,6 @@ add_custom_target("test-extensions"
list(APPEND ALL_TEST_TARGETS "test-extensions")
set_target_properties("test-extensions" PROPERTIES FOLDER "Tests")
message(STATUS "ALL_TEST_TARGETS = ${ALL_TEST_TARGETS}")
# Create the all-tests build target.
# The dependency list (ALL_TEST_TARGETS) is generated from setup_hifi_testcase invocations in the CMakeLists.txt
# files in the test subdirs. Note: since variables normally do *not* persist into parent scope, we use a hack:
@ -28,7 +26,7 @@ message(STATUS "ALL_TEST_TARGETS = ${ALL_TEST_TARGETS}")
# list(APPEND ALL_TEST_TARGETS ${targets_to_add...}) # appends to a local list var (copied from parent scope)
# set (ALL_TEST_TARGETS "${ALL_TEST_TARGETS}" PARENT_SCOPE) # copies this back to parent scope
#
add_custom_target("all-tests"
add_custom_target("all-tests"
COMMAND ctest .
DEPENDS "${ALL_TEST_TARGETS}")
set_target_properties("all-tests" PROPERTIES FOLDER "hidden/test-targets")

View file

@ -24,11 +24,11 @@
!define company "$%INSTALLER_COMPANY%"
!define install_directory "$%INSTALLER_DIRECTORY%"
; Executables and icons for GUI applications that will be added as shortcuts.
; Executables and icons for GUI applications that will be added as shortcuts.
!define interface_exec "interface.exe"
!define stack_manager_exec "stack-manager.exe"
!define console_exec "server-console.exe"
!define interface_icon "interface.ico"
!define stack_manager_icon "stack-manager.ico"
!define console_icon "server-console.ico"
; Registry entries
!define regkey "Software\${install_directory}"
@ -76,7 +76,7 @@ Section /o "Default Content Set" "CONTENT"
Delete "$ChosenInstallDir\content.exe"
SectionEnd
Section "Registry Entries and Procotol Handler" "REGISTRY"
Section "Registry Entries and Protocol Handler" "REGISTRY"
SetRegView 64
SectionIn RO
WriteRegStr HKLM "${regkey}" "Install_Dir" "$ChosenInstallDir"
@ -100,36 +100,35 @@ SectionEnd
Section "Base Files" "BASE"
SectionIn RO
SetOutPath $ChosenInstallDir
File /r /x assignment-client.* /x domain-server.* /x interface.* /x stack-manager.* "${installer_srcdir}\"
File /r /x assignment-client.* /x domain-server.* /x interface.* /x server-console.* "${installer_srcdir}\"
SectionEnd
Section "HighFidelity Interface" "CLIENT"
Section "High Fidelity Interface" "CLIENT"
SetOutPath $ChosenInstallDir
File /a "${installer_srcdir}\interface.*"
File /a "${installer_srcdir}\${interface_icon}"
SectionEnd
Section "HighFidelity Server" "SERVER"
Section "High Fidelity Server" "SERVER"
SetOutPath $ChosenInstallDir
File /a "${installer_srcdir}\stack-manager.*"
File /a "${installer_srcdir}\server-console.*"
File /a "${installer_srcdir}\domain-server.*"
File /a "${installer_srcdir}\assignment-client.*"
File /a "${installer_srcdir}\${stack_manager_icon}"
SectionEnd
Section "Start Menu Shortcuts" "SHORTCUTS"
SetShellVarContext all
CreateDirectory "${startmenu_company}"
SetOutPath $ChosenInstallDir
CreateShortCut "${startmenu_company}\Client.lnk" "$ChosenInstallDir\${interface_exec}" "" "$ChosenInstallDir\${interface_icon}"
CreateShortCut "${startmenu_company}\Home Server.lnk" "$ChosenInstallDir\${stack_manager_exec}" "" "$ChosenInstallDir\${stack_manager_icon}"
CreateShortCut "${startmenu_company}\High Fidelity.lnk" "$ChosenInstallDir\${interface_exec}" "" "$ChosenInstallDir\${interface_icon}"
CreateShortCut "${startmenu_company}\Server Console.lnk" "$ChosenInstallDir\${console_exec}" "" "$ChosenInstallDir\${console_icon}"
CreateShortCut "${startmenu_company}\Uninstall ${company}.lnk" "$ChosenInstallDir\${uninstaller}"
SectionEnd
Section "Uninstall"
SetRegView 64
Delete "$INSTDIR\${uninstaller}"
Delete "$SMSTARTUP\High Fidelity Home Server.lnk"
Delete "$SMSTARTUP\High Fidelity Server Console.lnk"
RMDir /r "$INSTDIR"
RMDir /r "${startmenu_company}"
RMDir /r "$0"
@ -170,11 +169,11 @@ Function HandleCheckBoxes
${NSD_GetState} $ServerCheckBox $ServerCheckBox_state
${If} $ServerCheckBox_state == ${BST_CHECKED}
SetOutPath $ChosenInstallDir
ExecShell "" '"$ChosenInstallDir\stack-manager.exe"'
ExecShell "" '"$ChosenInstallDir\${console_exec}"'
${EndIf}
${NSD_GetState} $RunOnStartupCheckBox $RunOnStartupCheckBox_state
${If} $ServerCheckBox_state == ${BST_CHECKED}
CreateShortCut "$SMSTARTUP\High Fidelity Home Server.lnk" "$ChosenInstallDir\${stack_manager_exec}" "" "$ChosenInstallDir\${stack_manager_icon}"
CreateShortCut "$SMSTARTUP\High Fidelity Server Console.lnk" "$ChosenInstallDir\${console_exec}" "" "$ChosenInstallDir\${console_icon}"
${EndIf}
${EndIf}
FunctionEnd