aboutsummaryrefslogtreecommitdiff
path: root/modules/ECMQtDeclareLoggingCategory.cmake
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2016-03-20 11:52:27 +0100
committerDavid Faure <faure@kde.org>2016-04-03 22:41:42 +0200
commitf7c1e8d57f84d0883a2a7683fd59ecc990a03de1 (patch)
tree2bbdf78eda98a1c7c5a5c6130255f07d6e3ddbc1 /modules/ECMQtDeclareLoggingCategory.cmake
parentc6495e75fc6114314512427bce5e202c1ad648c6 (diff)
downloadextra-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/ECMQtDeclareLoggingCategory.cmake')
-rw-r--r--modules/ECMQtDeclareLoggingCategory.cmake4
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}")