aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleix Pol <aleixpol@kde.org>2016-11-07 00:53:06 +0100
committerAleix Pol <aleixpol@kde.org>2016-11-07 12:51:26 +0100
commitab9d76d7c012aa1a07a942cf50f33616bd49605f (patch)
tree8a260293648b42002156f53e4f78ecd3d5d1eee8
parent187235b7a296bb7e01e51ef8b160ec08d8e7e000 (diff)
downloadkconfig-ab9d76d7c012aa1a07a942cf50f33616bd49605f.tar.gz
kconfig-ab9d76d7c012aa1a07a942cf50f33616bd49605f.tar.bz2
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
-rw-r--r--KF5ConfigMacros.cmake10
1 files changed, 8 insertions, 2 deletions
diff --git a/KF5ConfigMacros.cmake b/KF5ConfigMacros.cmake
index c615bb00..f365c78f 100644
--- a/KF5ConfigMacros.cmake
+++ b/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)