summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2016-11-12 16:32:53 (GMT)
committerDavid Faure <faure@kde.org>2016-11-12 16:32:53 (GMT)
commitb2b0d944eab6937089e5156c7e1000618b9543ab (patch)
tree768ea91c087bd2e8ee2971bcd430e28e7fe635d0
parentf117a0f3ca2ba19839e575ea9cbcc882447f9098 (diff)
Provide compile error when compiling the ical test program fails.v16.11.80
Makes debugging much easier (in my case, this failed in zanshin with g++: error: unrecognized command line option ‘-std=c++14’)
-rw-r--r--cmake/FindLibIcal.cmake7
1 files changed, 6 insertions, 1 deletions
diff --git a/cmake/FindLibIcal.cmake b/cmake/FindLibIcal.cmake
index 3565b41..59d7550 100644
--- a/cmake/FindLibIcal.cmake
+++ b/cmake/FindLibIcal.cmake
@@ -59,6 +59,7 @@ if(LibIcal_INCLUDE_DIRS AND LibIcal_LIBRARIES)
${CMAKE_BINARY_DIR}
${FIND_LibIcal_VERSION_SOURCE_FILE}
CMAKE_FLAGS "${FIND_LibIcal_VERSION_ADD_INCLUDES}"
+ COMPILE_OUTPUT_VARIABLE FIND_LibIcal_Compile_Output
RUN_OUTPUT_VARIABLE LibIcal_VERSION)
endif()
@@ -78,7 +79,11 @@ if(LibIcal_INCLUDE_DIRS AND LibIcal_LIBRARIES)
else()
if(NOT CMAKE_CROSSCOMPILING)
- message(FATAL_ERROR "Unable to compile or run the libical version detection program.")
+ if (NOT COMPILE_RESULT)
+ message(FATAL_ERROR "Unable to compile the libical version detection program: ${FIND_LibIcal_Compile_Output}")
+ else()
+ message(FATAL_ERROR "Unable to run the libical version detection program: it returned ${RUN_RESULT}.")
+ endif()
endif()
endif()