mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-15 12:16:40 +08:00
Modules: Use file(CONFIGURE) instead of CMakeConfigurableFile.in
When this was implemented, file(CONFIGURE) wasn't yet available until CMake 3.18.
This commit is contained in:
@@ -125,9 +125,12 @@ function (QT4_CREATE_MOC_COMMAND infile outfile moc_flags moc_options moc_target
|
|||||||
set(targetincludes)
|
set(targetincludes)
|
||||||
set(targetdefines)
|
set(targetdefines)
|
||||||
else()
|
else()
|
||||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${_moc_parameters}")
|
file(
|
||||||
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
|
CONFIGURE
|
||||||
"${_moc_parameters_file}" @ONLY)
|
OUTPUT "${_moc_parameters_file}"
|
||||||
|
CONTENT "${_moc_parameters}\n"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(_moc_extra_parameters_file @${_moc_parameters_file})
|
set(_moc_extra_parameters_file @${_moc_parameters_file})
|
||||||
|
@@ -883,10 +883,12 @@ function(add_jar _TARGET_NAME)
|
|||||||
# Create the list of files to compile.
|
# Create the list of files to compile.
|
||||||
set(_JAVA_SOURCES_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_sources)
|
set(_JAVA_SOURCES_FILE ${CMAKE_JAVA_CLASS_OUTPUT_PATH}/java_sources)
|
||||||
string(REPLACE ";" "\"\n\"" _JAVA_COMPILE_STRING "\"${_JAVA_COMPILE_FILES}\"")
|
string(REPLACE ";" "\"\n\"" _JAVA_COMPILE_STRING "\"${_JAVA_COMPILE_FILES}\"")
|
||||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${_JAVA_COMPILE_STRING}")
|
file(
|
||||||
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
|
CONFIGURE
|
||||||
"${_JAVA_SOURCES_FILE}" @ONLY)
|
OUTPUT "${_JAVA_SOURCES_FILE}"
|
||||||
unset(CMAKE_CONFIGURABLE_FILE_CONTENT)
|
CONTENT "${_JAVA_COMPILE_STRING}\n"
|
||||||
|
@ONLY
|
||||||
|
)
|
||||||
list (APPEND _JAVA_SOURCES_FILELISTS "@${_JAVA_SOURCES_FILE}")
|
list (APPEND _JAVA_SOURCES_FILELISTS "@${_JAVA_SOURCES_FILE}")
|
||||||
endif()
|
endif()
|
||||||
if (_JAVA_COMPILE_FILELISTS)
|
if (_JAVA_COMPILE_FILELISTS)
|
||||||
|
@@ -831,14 +831,13 @@ template<> struct ${prefix_arg}StaticAssert<true>{};
|
|||||||
foreach(compiler ${_WCD_COMPILERS})
|
foreach(compiler ${_WCD_COMPILERS})
|
||||||
foreach(_lang ${_langs})
|
foreach(_lang ${_langs})
|
||||||
if(compiler_file_content_${compiler}_${_lang})
|
if(compiler_file_content_${compiler}_${_lang})
|
||||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_}")
|
|
||||||
string(APPEND CMAKE_CONFIGURABLE_FILE_CONTENT "${compiler_file_content_${compiler}_${_lang}}")
|
|
||||||
|
|
||||||
set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h")
|
set(compile_file_name "${_WCD_OUTPUT_DIR}${prefix_arg}_COMPILER_INFO_${compiler}_${_lang}.h")
|
||||||
set(full_path "${main_file_dir}/${compile_file_name}")
|
set(full_path "${main_file_dir}/${compile_file_name}")
|
||||||
list(APPEND ${_WCD_OUTPUT_FILES_VAR} ${full_path})
|
list(APPEND ${_WCD_OUTPUT_FILES_VAR} ${full_path})
|
||||||
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
|
file(
|
||||||
"${full_path}"
|
CONFIGURE
|
||||||
|
OUTPUT "${full_path}"
|
||||||
|
CONTENT "${compiler_file_content_}${compiler_file_content_${compiler}_${_lang}}\n"
|
||||||
@ONLY
|
@ONLY
|
||||||
)
|
)
|
||||||
endif()
|
endif()
|
||||||
@@ -852,9 +851,5 @@ template<> struct ${prefix_arg}StaticAssert<true>{};
|
|||||||
endif()
|
endif()
|
||||||
string(APPEND file_content "\n#endif")
|
string(APPEND file_content "\n#endif")
|
||||||
|
|
||||||
set(CMAKE_CONFIGURABLE_FILE_CONTENT ${file_content})
|
file(CONFIGURE OUTPUT "${file_arg}" CONTENT "${file_content}\n" @ONLY)
|
||||||
configure_file("${CMAKE_ROOT}/Modules/CMakeConfigurableFile.in"
|
|
||||||
"${file_arg}"
|
|
||||||
@ONLY
|
|
||||||
)
|
|
||||||
endfunction()
|
endfunction()
|
||||||
|
Reference in New Issue
Block a user