CMake Build: Less file creating during configure

Change-Id: I263853f0a903d81a8d869bc4f5683e1a1b0078e2
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Cristian Adam
2020-02-28 13:31:40 +01:00
parent 3c4acafdb6
commit 6d169ae7aa

View File

@@ -382,14 +382,12 @@ function(enable_pch target)
endfunction() endfunction()
if (NOT TARGET QtCreatorPchGui AND NOT TARGET QtCreatorPchConsole) if (NOT TARGET QtCreatorPchGui AND NOT TARGET QtCreatorPchConsole)
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c_cpp.in "/*empty file*/") file(GENERATE
configure_file( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c
${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c_cpp.in CONTENT "/*empty file*/")
${CMAKE_CURRENT_BINARY_DIR}/empty_pch.cpp) file(GENERATE
configure_file( OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/empty_pch.cpp
${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c_cpp.in CONTENT "/*empty file*/")
${CMAKE_CURRENT_BINARY_DIR}/empty_pch.c)
_add_pch_target(QtCreatorPchGui _add_pch_target(QtCreatorPchGui
"${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets) "${PROJECT_SOURCE_DIR}/src/shared/qtcreator_gui_pch.h" Qt5::Widgets)
_add_pch_target(QtCreatorPchConsole _add_pch_target(QtCreatorPchConsole
@@ -728,9 +726,10 @@ function(add_qtc_plugin target_name)
string(REGEX REPLACE "^.*=" "" json_value ${_arg_PLUGIN_JSON_IN}) string(REGEX REPLACE "^.*=" "" json_value ${_arg_PLUGIN_JSON_IN})
string(REPLACE "$$${json_key}" "${json_value}" plugin_json_in ${plugin_json_in}) string(REPLACE "$$${json_key}" "${json_value}" plugin_json_in ${plugin_json_in})
endif() endif()
file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/${name}.json.cmakein" ${plugin_json_in}) string(CONFIGURE "${plugin_json_in}" plugin_json)
file(GENERATE
configure_file("${CMAKE_CURRENT_BINARY_DIR}/${name}.json.cmakein" "${name}.json") OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${name}.json"
CONTENT "${plugin_json}")
endif() endif()
add_library(${target_name} SHARED ${_arg_SOURCES}) add_library(${target_name} SHARED ${_arg_SOURCES})