mirror of
https://github.com/overte-org/overte.git
synced 2025-07-10 19:58:48 +02:00
append file jsdoc json file to resources.rcc resource file
This commit is contained in:
parent
08b712281f
commit
898c99e5b8
2 changed files with 27 additions and 31 deletions
|
@ -1,7 +1,7 @@
|
||||||
|
|
||||||
function(GENERATE_QRC)
|
function(GENERATE_QRC)
|
||||||
set(oneValueArgs OUTPUT PREFIX PATH)
|
set(oneValueArgs OUTPUT PREFIX PATH)
|
||||||
set(multiValueArgs GLOBS)
|
set(multiValueArgs CUSTOM_PATHS GLOBS)
|
||||||
cmake_parse_arguments(GENERATE_QRC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
cmake_parse_arguments(GENERATE_QRC "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN} )
|
||||||
if ("${GENERATE_QRC_PREFIX}" STREQUAL "")
|
if ("${GENERATE_QRC_PREFIX}" STREQUAL "")
|
||||||
set(QRC_PREFIX_PATH /)
|
set(QRC_PREFIX_PATH /)
|
||||||
|
@ -20,6 +20,13 @@ function(GENERATE_QRC)
|
||||||
endforeach()
|
endforeach()
|
||||||
endforeach()
|
endforeach()
|
||||||
|
|
||||||
|
foreach(CUSTOM_PATH ${GENERATE_QRC_CUSTOM_PATHS})
|
||||||
|
string(REPLACE "=" ";" CUSTOM_PATH ${CUSTOM_PATH})
|
||||||
|
list(GET CUSTOM_PATH 0 IMPORT_PATH)
|
||||||
|
list(GET CUSTOM_PATH 1 LOCAL_PATH)
|
||||||
|
set(QRC_CONTENTS "${QRC_CONTENTS}<file alias=\"${LOCAL_PATH}\">${IMPORT_PATH}</file>\n")
|
||||||
|
endforeach()
|
||||||
|
|
||||||
set(GENERATE_QRC_DEPENDS ${ALL_FILES} PARENT_SCOPE)
|
set(GENERATE_QRC_DEPENDS ${ALL_FILES} PARENT_SCOPE)
|
||||||
configure_file("${HF_CMAKE_DIR}/templates/resources.qrc.in" ${GENERATE_QRC_OUTPUT})
|
configure_file("${HF_CMAKE_DIR}/templates/resources.qrc.in" ${GENERATE_QRC_OUTPUT})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
|
@ -11,9 +11,22 @@ function(JOIN VALUES GLUE OUTPUT)
|
||||||
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
set (${OUTPUT} "${_TMP_STR}" PARENT_SCOPE)
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
|
set(CUSTOM_INTERFACE_QRC_PATHS "")
|
||||||
|
|
||||||
|
function(ADD_CUSTOM_QRC_PATH CUSTOM_PATHS_VAR IMPORT_PATH LOCAL_PATH)
|
||||||
|
list(APPEND ${CUSTOM_PATHS_VAR} "${IMPORT_PATH}=${LOCAL_PATH}")
|
||||||
|
set(${CUSTOM_PATHS_VAR} ${${CUSTOM_PATHS_VAR}} PARENT_SCOPE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
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")
|
||||||
|
endif ()
|
||||||
|
|
||||||
set(RESOURCES_QRC ${CMAKE_CURRENT_BINARY_DIR}/resources.qrc)
|
set(RESOURCES_QRC ${CMAKE_CURRENT_BINARY_DIR}/resources.qrc)
|
||||||
set(RESOURCES_RCC ${CMAKE_CURRENT_SOURCE_DIR}/compiledResources/resources.rcc)
|
set(RESOURCES_RCC ${CMAKE_CURRENT_SOURCE_DIR}/compiledResources/resources.rcc)
|
||||||
generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources GLOBS *)
|
generate_qrc(OUTPUT ${RESOURCES_QRC} PATH ${CMAKE_CURRENT_SOURCE_DIR}/resources CUSTOM_PATHS ${CUSTOM_INTERFACE_QRC_PATHS} GLOBS *)
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT ${RESOURCES_RCC}
|
OUTPUT ${RESOURCES_RCC}
|
||||||
|
@ -53,8 +66,6 @@ file(GLOB_RECURSE INTERFACE_SRCS "src/*.cpp" "src/*.h")
|
||||||
GroupSources("src")
|
GroupSources("src")
|
||||||
list(APPEND INTERFACE_SRCS ${RESOURCES_RCC})
|
list(APPEND INTERFACE_SRCS ${RESOURCES_RCC})
|
||||||
|
|
||||||
find_npm()
|
|
||||||
|
|
||||||
# Add SpeechRecognizer if on Windows or OS X, otherwise remove
|
# Add SpeechRecognizer if on Windows or OS X, otherwise remove
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# Use .cpp and .h files as is.
|
# Use .cpp and .h files as is.
|
||||||
|
@ -165,6 +176,11 @@ else ()
|
||||||
add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM})
|
add_executable(${TARGET_NAME} ${INTERFACE_SRCS} ${QM})
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
if (BUILD_TOOLS AND NPM_EXECUTABLE)
|
||||||
|
# require JSDoc to be build before interface is deployed (Console Auto-complete)
|
||||||
|
add_dependencies(resources jsdoc)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_dependencies(${TARGET_NAME} resources)
|
add_dependencies(${TARGET_NAME} resources)
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
|
@ -276,11 +292,6 @@ endif()
|
||||||
# assume we are using a Qt build without bearer management
|
# assume we are using a Qt build without bearer management
|
||||||
add_definitions(-DQT_NO_BEARERMANAGEMENT)
|
add_definitions(-DQT_NO_BEARERMANAGEMENT)
|
||||||
|
|
||||||
if (BUILD_TOOLS)
|
|
||||||
# require JSDoc to be build before interface is deployed (Console Auto-complete)
|
|
||||||
add_dependencies(${TARGET_NAME} jsdoc)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
# link in required OS X frameworks and include the right GL headers
|
# link in required OS X frameworks and include the right GL headers
|
||||||
find_library(OpenGL OpenGL)
|
find_library(OpenGL OpenGL)
|
||||||
|
@ -296,38 +307,18 @@ if (APPLE)
|
||||||
|
|
||||||
set(SCRIPTS_INSTALL_DIR "${INTERFACE_INSTALL_APP_PATH}/Contents/Resources")
|
set(SCRIPTS_INSTALL_DIR "${INTERFACE_INSTALL_APP_PATH}/Contents/Resources")
|
||||||
|
|
||||||
if (BUILD_TOOLS AND NPM_EXECUTABLE)
|
|
||||||
set(EXTRA_COPY_COMMANDS
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E make_directory
|
|
||||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources/auto-complete"
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
|
||||||
"${CMAKE_SOURCE_DIR}/tools/jsdoc/out/hifiJSDoc.json"
|
|
||||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources/auto-complete"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# copy script files beside the executable
|
# copy script files beside the executable
|
||||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
"${CMAKE_SOURCE_DIR}/scripts"
|
"${CMAKE_SOURCE_DIR}/scripts"
|
||||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources/scripts"
|
"$<TARGET_FILE_DIR:${TARGET_NAME}>/../Resources/scripts"
|
||||||
|
|
||||||
${EXTRA_COPY_COMMANDS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# 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()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
if (BUILD_TOOLS AND NPM_EXECUTABLE)
|
|
||||||
set(EXTRA_COPY_COMMANDS
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E make_directory
|
|
||||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/auto-complete"
|
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy
|
|
||||||
"${CMAKE_SOURCE_DIR}/tools/jsdoc/out/hifiJSDoc.json"
|
|
||||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/resources/auto-complete"
|
|
||||||
)
|
|
||||||
endif()
|
|
||||||
# copy the resources files beside the executable
|
# copy the resources files beside the executable
|
||||||
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
add_custom_command(TARGET ${TARGET_NAME} POST_BUILD
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
COMMAND "${CMAKE_COMMAND}" -E copy_if_different
|
||||||
|
@ -344,8 +335,6 @@ else()
|
||||||
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
COMMAND "${CMAKE_COMMAND}" -E copy_directory
|
||||||
"${CMAKE_SOURCE_DIR}/scripts"
|
"${CMAKE_SOURCE_DIR}/scripts"
|
||||||
"$<TARGET_FILE_DIR:${TARGET_NAME}>/scripts"
|
"$<TARGET_FILE_DIR:${TARGET_NAME}>/scripts"
|
||||||
|
|
||||||
${EXTRA_COPY_COMMANDS}
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# link target to external libraries
|
# link target to external libraries
|
||||||
|
|
Loading…
Reference in a new issue