From 3f20f6ec6691a0b6fad8e4cdfa5a9d047bd80fc3 Mon Sep 17 00:00:00 2001 From: Dale Glass Date: Tue, 29 Dec 2020 01:15:07 +0100 Subject: [PATCH] Generate all files in the build dir, don't touch source dir This makes it so that RCC files and jsdoc are both generated into the build directory. --- hifi_qt.py | 2 +- interface/CMakeLists.txt | 12 ++++++------ tools/jsdoc/CMakeLists.txt | 4 +++- tools/jsdoc/plugins/hifiJSONExport.js | 18 ++++++++++++++++-- tools/nitpick/CMakeLists.txt | 2 +- 5 files changed, 27 insertions(+), 11 deletions(-) diff --git a/hifi_qt.py b/hifi_qt.py index 078f80c38d..f832d5f940 100644 --- a/hifi_qt.py +++ b/hifi_qt.py @@ -196,7 +196,7 @@ endif() print("https://github.com/vircadia/vircadia/tree/master/tools/qt-builder") print("") print("Alternatively, you can try building against the system Qt by setting the VIRCADIA_USE_SYSTEM_QT environment variable.") - print("You'll need to install the development packages, and to have Qt 5.15.0 or newer. ") + print("You'll need to install the development packages, and to have Qt 5.15.0 or later.") def writeConfig(self): print("Writing cmake config to {}".format(self.configFilePath)) diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index a2a29ed4ba..8ada51561f 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -22,11 +22,11 @@ set(CUSTOM_INTERFACE_QRC_PATHS "") find_npm() if (BUILD_TOOLS AND NPM_EXECUTABLE) - add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_SOURCE_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") + add_custom_qrc_path(CUSTOM_INTERFACE_QRC_PATHS "${CMAKE_BINARY_DIR}/tools/jsdoc/out/hifiJSDoc.json" "auto-complete/hifiJSDoc.json") endif () set(RESOURCES_QRC ${CMAKE_CURRENT_BINARY_DIR}/resources.qrc) -set(RESOURCES_RCC ${CMAKE_CURRENT_SOURCE_DIR}/compiledResources/resources.rcc) +set(RESOURCES_RCC ${CMAKE_CURRENT_BINARY_DIR}/resources.rcc) generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources CUSTOM_PATHS ${CUSTOM_INTERFACE_QRC_PATHS} GLOBS *) if (ANDROID) @@ -345,7 +345,7 @@ if (APPLE) "${RESOURCES_DEV_DIR}/scripts" # copy JSDoc files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${CMAKE_SOURCE_DIR}/tools/jsdoc/out" + "${CMAKE_CURRENT_BINARY_DIR}/tools/jsdoc" "${RESOURCES_DEV_DIR}/jsdoc" # copy the resources files beside the executable COMMAND "${CMAKE_COMMAND}" -E copy_if_different @@ -408,9 +408,9 @@ else() "${PROJECT_SOURCE_DIR}/resources/serverless/redirect.json" "${RESOURCES_DEV_DIR}/serverless/redirect.json" # copy JSDoc files beside the executable - COMMAND "${CMAKE_COMMAND}" -E copy_directory - "${CMAKE_SOURCE_DIR}/tools/jsdoc/out" - "${INTERFACE_EXEC_DIR}/jsdoc" +# COMMAND "${CMAKE_COMMAND}" -E copy_directory +# "${CMAKE_CURRENT_BINARY_DIR}/tools/jsdoc/out" +# "${INTERFACE_EXEC_DIR}/jsdoc" ) # link target to external libraries diff --git a/tools/jsdoc/CMakeLists.txt b/tools/jsdoc/CMakeLists.txt index 1c4333983f..3c8245f0d9 100644 --- a/tools/jsdoc/CMakeLists.txt +++ b/tools/jsdoc/CMakeLists.txt @@ -5,9 +5,11 @@ add_custom_target(${TARGET_NAME}) find_npm() set(JSDOC_WORKING_DIR ${CMAKE_SOURCE_DIR}/tools/jsdoc) +set(JSDOC_OUTPUT_DIR ${CMAKE_CURRENT_BINARY_DIR}) + file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/node_modules/.bin/jsdoc JSDOC_PATH) file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/config.json JSDOC_CONFIG_PATH) -file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/out OUTPUT_DIR) +file(TO_NATIVE_PATH ${JSDOC_OUTPUT_DIR}/out OUTPUT_DIR) file(TO_NATIVE_PATH ${JSDOC_WORKING_DIR}/root.js NATIVE_JSDOC_WORKING_DIR) add_custom_command(TARGET ${TARGET_NAME} diff --git a/tools/jsdoc/plugins/hifiJSONExport.js b/tools/jsdoc/plugins/hifiJSONExport.js index e609b30ad5..057aaecda3 100644 --- a/tools/jsdoc/plugins/hifiJSONExport.js +++ b/tools/jsdoc/plugins/hifiJSONExport.js @@ -1,8 +1,22 @@ exports.handlers = { processingComplete: function(e) { const pathTools = require('path'); - var outputFolder = pathTools.join(__dirname, '../out'); + var outputFolder; var doclets = e.doclets.map(doclet => Object.assign({}, doclet)); + + var argv = process.argv; + for(var i=0; i