Make sure we don't break compilation with past broken units

Summary: Show a warning together with the old broken behavior

Reviewers: #frameworks, dfaure

Reviewed By: dfaure

Differential Revision: https://phabricator.kde.org/D3287
wilder
Aleix Pol 9 years ago
parent 187235b7a2
commit ab9d76d7c0
  1. 10
      KF5ConfigMacros.cmake

@ -61,8 +61,14 @@ function (KCONFIG_ADD_KCFG_FILES _sources )
string(REGEX MATCH "File=([^\n]+\\.kcfg)\n" "" "${_contents}")
set(_kcfg_FILENAME "${CMAKE_MATCH_1}")
if (NOT _kcfg_FILENAME)
set(_kcfg_FILENAME "${_basename}.kcfg")
message(WARNING "Couldn't read the \"File\" field in ${_tmp_FILE}")
string(REGEX MATCH "File=([^\n]+\\.kcfg).*\n" "" "${_contents}")
if(CMAKE_MATCH_1)
message(WARNING "${_tmp_FILE}: Broken \"File\" field, make sure it's pointing at the right file")
set(_kcfg_FILENAME "${CMAKE_MATCH_1}")
else()
message(WARNING "Couldn't read the \"File\" field in ${_tmp_FILE}")
set(_kcfg_FILENAME "${_basename}.kcfg")
endif()
endif()
set(_src_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.cpp)
set(_header_FILE ${CMAKE_CURRENT_BINARY_DIR}/${_basename}.h)

Loading…
Cancel
Save