diff options
author | David Faure <faure@kde.org> | 2016-03-20 11:52:27 +0100 |
---|---|---|
committer | David Faure <faure@kde.org> | 2016-04-03 22:41:42 +0200 |
commit | f7c1e8d57f84d0883a2a7683fd59ecc990a03de1 (patch) | |
tree | 2bbdf78eda98a1c7c5a5c6130255f07d6e3ddbc1 /modules | |
parent | c6495e75fc6114314512427bce5e202c1ad648c6 (diff) | |
download | extra-cmake-modules-f7c1e8d57f84d0883a2a7683fd59ecc990a03de1.tar.gz extra-cmake-modules-f7c1e8d57f84d0883a2a7683fd59ecc990a03de1.tar.bz2 |
ecm_qt_declare_logging_category: improve error message when using without including
If one subdir in the project includes this file, all others can use the function
but they don't see the value of the variable, which leads to a strange error
CMake Error at ECM/modules/ECMQtDeclareLoggingCategory.cmake:114 (configure_file):
configure_file input location <srcdir> is a directory but a file was expected.
Happened in KIO, with kio/gui doing include+function call, and then adding
function call in kio/widgets.
REVIEW: 127432
Diffstat (limited to 'modules')
-rw-r--r-- | modules/ECMQtDeclareLoggingCategory.cmake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/modules/ECMQtDeclareLoggingCategory.cmake b/modules/ECMQtDeclareLoggingCategory.cmake index b7f1ad39..c125949a 100644 --- a/modules/ECMQtDeclareLoggingCategory.cmake +++ b/modules/ECMQtDeclareLoggingCategory.cmake @@ -108,6 +108,10 @@ function(ecm_qt_declare_logging_category sources_var) string(REPLACE "::" "_" GUARD_NAME "${ARG_IDENTIFIER}_H") string(TOUPPER "${GUARD_NAME}" GUARD_NAME) + if (NOT _ECM_QT_DECLARE_LOGGING_CATEGORY_TEMPLATE_CPP) + message(FATAL_ERROR "You must include(ECMQtDeclareLoggingCategory) before using ecm_qt_declare_logging_category") + endif() + configure_file("${_ECM_QT_DECLARE_LOGGING_CATEGORY_TEMPLATE_CPP}" "${cpp_filename}") configure_file("${_ECM_QT_DECLARE_LOGGING_CATEGORY_TEMPLATE_H}" "${ARG_HEADER}") |