forked from qt-creator/qt-creator
CMake Build: Ensure valid destinations for generated files
- Make the build system aware that empty_pch.c/.cpp are generated files to prevent invalid access from _add_pch_target. - Force the creation of the translation output directory before copying qm files into it. Change-Id: Iaff5e5ebdbfec7e89a47d277d95f9dec760a5b6b Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -349,6 +349,11 @@ function(enable_pch target)
|
||||
file(GENERATE
|
||||
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.cpp
|
||||
CONTENT "/*empty file*/")
|
||||
set_source_files_properties(
|
||||
${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/empty_pch.cpp
|
||||
PROPERTIES GENERATED TRUE)
|
||||
|
||||
_add_pch_target(QtCreatorPchGui
|
||||
"${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets)
|
||||
_add_pch_target(QtCreatorPchConsole
|
||||
|
||||
@@ -138,6 +138,8 @@ function(add_translation_targets file_prefix)
|
||||
add_custom_target("${_arg_ALL_QM_TARGET}" ALL COMMENT "Generate .qm-files")
|
||||
endif()
|
||||
|
||||
file(MAKE_DIRECTORY ${_arg_OUTPUT_DIRECTORY})
|
||||
|
||||
foreach(l IN ITEMS ${_arg_LANGUAGES})
|
||||
set(_ts_file "${CMAKE_CURRENT_SOURCE_DIR}/${file_prefix}_${l}.ts")
|
||||
set(_qm_file "${_arg_OUTPUT_DIRECTORY}/${file_prefix}_${l}.qm")
|
||||
|
||||
Reference in New Issue
Block a user