Write out a module description file
Write out a file with some JSON data to describe a module. This file contains information on how that module has been built. Change-Id: I8a604692663cbb7b76b96b97124130e30b822e4b Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
This commit is contained in:
parent
f8c1909320
commit
1c2db89027
11
cmake/ModuleDescription.json.in
Normal file
11
cmake/ModuleDescription.json.in
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"module_name": "${target}",
|
||||||
|
"version": "${CMAKE_PROJECT_VERSION}",
|
||||||
|
"built_with": {
|
||||||
|
"compiler_id": "${CMAKE_CXX_COMPILER_ID}",
|
||||||
|
"compiler_target": "${CMAKE_CXX_COMPILER_TARGET}",
|
||||||
|
"compiler_version": "${CMAKE_CXX_COMPILER_VERSION}",
|
||||||
|
"cross_compiled": ${cross_compilation},
|
||||||
|
"target_system": "${CMAKE_SYSTEM_NAME}"
|
||||||
|
}
|
||||||
|
}
|
@ -174,6 +174,7 @@ qt_internal_export_modern_cmake_config_targets_file(TARGETS ${__export_targets}
|
|||||||
|
|
||||||
## Install some QtBase specific CMake files:
|
## Install some QtBase specific CMake files:
|
||||||
qt_copy_or_install(FILES
|
qt_copy_or_install(FILES
|
||||||
|
cmake/ModuleDescription.json.in
|
||||||
cmake/QtBuild.cmake
|
cmake/QtBuild.cmake
|
||||||
cmake/QtCompilerFlags.cmake
|
cmake/QtCompilerFlags.cmake
|
||||||
cmake/QtCompilerOptimization.cmake
|
cmake/QtCompilerOptimization.cmake
|
||||||
|
@ -35,6 +35,7 @@ set(INSTALL_SYSCONFDIR "etc/xdg" CACHE PATH
|
|||||||
"Settings used by Qt programs [PREFIX/etc/xdg]")
|
"Settings used by Qt programs [PREFIX/etc/xdg]")
|
||||||
set(INSTALL_EXAMPLESDIR "examples" CACHE PATH "Examples [PREFIX/examples]")
|
set(INSTALL_EXAMPLESDIR "examples" CACHE PATH "Examples [PREFIX/examples]")
|
||||||
set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]")
|
set(INSTALL_TESTSDIR "tests" CACHE PATH "Tests [PREFIX/tests]")
|
||||||
|
set(INSTALL_DESCRIPTIONSDIR "${INSTALL_DATADIR}/modules" CACHE PATH "Module description files directory")
|
||||||
|
|
||||||
# The variables might have already been set in QtBuildInternalsExtra.cmake if the file is included
|
# The variables might have already been set in QtBuildInternalsExtra.cmake if the file is included
|
||||||
# while building a new module and not QtBase. In that case, stop overriding the value.
|
# while building a new module and not QtBase. In that case, stop overriding the value.
|
||||||
@ -63,6 +64,23 @@ SET(CMAKE_INSTALL_RPATH "${_default_install_rpath}" CACHE PATH "RPATH for instal
|
|||||||
# which point to directories outside the build tree to the install RPATH
|
# which point to directories outside the build tree to the install RPATH
|
||||||
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
|
||||||
|
|
||||||
|
# Generate a module description file based on the template in ModuleDescription.json.in
|
||||||
|
function(qt_describe_module target)
|
||||||
|
set(path_suffix "${INSTALL_DESCRIPTIONSDIR}")
|
||||||
|
qt_path_join(build_dir ${QT_BUILD_DIR} ${path_suffix})
|
||||||
|
qt_path_join(install_dir ${QT_INSTALL_DIR} ${path_suffix})
|
||||||
|
|
||||||
|
set(descfile_in "${QT_CMAKE_DIR}/ModuleDescription.json.in")
|
||||||
|
set(descfile_out "${build_dir}/${target}.json")
|
||||||
|
set(cross_compilation "false")
|
||||||
|
if(CMAKE_CROSSCOMPILE)
|
||||||
|
set(cross_compilation "true")
|
||||||
|
endif()
|
||||||
|
configure_file("${descfile_in}" "${descfile_out}")
|
||||||
|
|
||||||
|
qt_install(FILES "${descfile_out}" DESTINATION "${install_dir}")
|
||||||
|
endfunction()
|
||||||
|
|
||||||
function(qt_setup_tool_path_command)
|
function(qt_setup_tool_path_command)
|
||||||
if(NOT WIN32)
|
if(NOT WIN32)
|
||||||
return()
|
return()
|
||||||
@ -1632,6 +1650,8 @@ set(QT_CMAKE_EXPORT_NAMESPACE ${QT_CMAKE_EXPORT_NAMESPACE})")
|
|||||||
if(NOT ${arg_NO_PRIVATE_MODULE})
|
if(NOT ${arg_NO_PRIVATE_MODULE})
|
||||||
target_include_directories("${target_private}" INTERFACE ${interface_includes})
|
target_include_directories("${target_private}" INTERFACE ${interface_includes})
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
qt_describe_module(${target})
|
||||||
endfunction()
|
endfunction()
|
||||||
|
|
||||||
function(qt_export_tools module_name)
|
function(qt_export_tools module_name)
|
||||||
|
Loading…
Reference in New Issue
Block a user