Remove dead code
Change-Id: Iac7c7c77744b43772faf3402566685a674ab8ff3 Reviewed-by: Alexandru Croitor <alexandru.croitor@qt.io> Reviewed-by: Qt CMake Build Bot Reviewed-by: Leander Beernaert <leander.beernaert@qt.io>
This commit is contained in:
parent
408cdf006a
commit
85e3bb7aea
@ -1916,77 +1916,6 @@ function(qt_add_qmltypes_target target)
|
||||
)
|
||||
endfunction()
|
||||
|
||||
# Create a custom target that will ensure all js and qml files are processed
|
||||
# by the qmlcachegen tool during build. The generated jsc/qmlc files will
|
||||
# also be added to list of files to be installed.
|
||||
#
|
||||
# TARGET_PATH: QML target path
|
||||
# QML_FILES: List of QML Files
|
||||
#
|
||||
# Note: This will only run on non static builds.
|
||||
#
|
||||
function(add_qmlcachegen_target target)
|
||||
if (NOT QT_BUILD_SHARED_LIBS)
|
||||
# Do nothing for static builds since the QML files are embedded into
|
||||
# the executable.
|
||||
return()
|
||||
endif()
|
||||
|
||||
if (NOT TARGET ${QT_CMAKE_EXPORT_NAMESPACE}::qmlcachegen)
|
||||
message(FATAL_ERROR "Could not locate qmlcachegen tool. \
|
||||
Please add QmlTools to your find_package command."
|
||||
)
|
||||
endif()
|
||||
|
||||
qt_parse_all_arguments(arg "add_qmlcachegen_target"
|
||||
"" "TARGET_PATH" "QML_FILES" ${ARGN}
|
||||
)
|
||||
|
||||
set(cache_dir "${QT_BUILD_DIR}/${INSTALL_QMLDIR}/${arg_TARGET_PATH}")
|
||||
|
||||
foreach(qml_file IN LISTS arg_QML_FILES)
|
||||
if("${qml_file}" MATCHES "\.m?js$" OR "${qml_file}" MATCHES "\.qml$")
|
||||
if(NOT IS_ABSOLUTE ${qml_file})
|
||||
get_filename_component(qml_file ${qml_file} ABSOLUTE)
|
||||
endif()
|
||||
file(RELATIVE_PATH qmlc_file "${CMAKE_CURRENT_SOURCE_DIR}" "${qml_file}")
|
||||
set(qmlc_file "${cache_dir}/${qmlc_file}c")
|
||||
list(APPEND qmlc_files ${qmlc_file})
|
||||
add_custom_command(OUTPUT "${qmlc_file}"
|
||||
DEPENDS
|
||||
${qml_file}
|
||||
COMMAND
|
||||
${QT_CMAKE_EXPORT_NAMESPACE}::qmlcachegen -o ${qmlc_file} ${qml_file}
|
||||
COMMENT
|
||||
"Generating QML Cache for ${qml_file}"
|
||||
)
|
||||
endif()
|
||||
endforeach()
|
||||
|
||||
if(qmlc_files)
|
||||
set(qmlcachegen_target "${target}_qmlcachegen")
|
||||
# Add custom target which depends on all the qmlc files and then add
|
||||
# that target as a dependency of ${target}. This will guarantee
|
||||
# that the qmlc file get generated.
|
||||
add_custom_target(${qmlcachegen_target}
|
||||
DEPENDS ${qmlc_files}
|
||||
)
|
||||
|
||||
add_dependencies(${target} ${qmlcachegen_target})
|
||||
|
||||
if (QT_WILL_INSTALL)
|
||||
# Only install on non-prefix builds, since the file does not exist
|
||||
# at configuration time. Furthermore, the cached qml files are
|
||||
# generated in the destination location for non-prefix builds.
|
||||
qt_copy_or_install(
|
||||
FILES ${qmlc_files}
|
||||
DESTINATION ${INSTALL_QMLDIR}/${arg_TARGET_PATH}
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
endfunction()
|
||||
|
||||
function(qt_install_qml_files target)
|
||||
|
||||
qt_parse_all_arguments(arg "qt_install_qml_files"
|
||||
|
Loading…
Reference in New Issue
Block a user