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.
This commit is contained in:
Dale Glass 2020-12-29 01:15:07 +01:00
parent 45f2b672b5
commit 3f20f6ec66
5 changed files with 27 additions and 11 deletions

View file

@ -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))

View file

@ -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

View file

@ -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}

View file

@ -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<argv.length; i++) {
if (argv[i] === '-d') {
outputFolder = argv[i+1];
break;
}
}
if (!outputFolder) {
console.log("Output folder not found, specify it with -d");
process.exit(1);
}
const fs = require('fs');
if (!fs.existsSync(outputFolder)) {
fs.mkdirSync(outputFolder);
@ -13,7 +27,7 @@ exports.handlers = {
return console.log(err);
}
console.log("The Vircadia JSDoc JSON was saved!");
console.log("The Vircadia JSDoc JSON was saved into " + outputFolder + "!");
});
}
};

View file

@ -6,7 +6,7 @@ set(CUSTOM_NITPICK_QRC_PATHS "")
find_npm()
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_NITPICK_QRC_PATHS} GLOBS *)
add_custom_command(