From: Rolf Eike Beer Date: Fri, 1 Jul 2016 17:04:06 +0000 (+0200) Subject: Simplify FindExecInfo X-Git-Tag: travis-deploy-test~411 X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=commitdiff_plain;h=3be4dcd0386965097be6a29fa30d4541118aa654 Simplify FindExecInfo * Do not set EXECINFO_INCLUDES to empty it it is NOTFOUND, it is only used when EXECINFO_FOUND is set, which is the expected behavior * Simplify checking for the find_path() and find_library() result, CMake considers a variable false if its value is VARNAME-NOTFOUND Resolves GH-222. --- diff --git a/cmake/FindExecInfo.cmake b/cmake/FindExecInfo.cmake index 94a5b881..f8599a6a 100644 --- a/cmake/FindExecInfo.cmake +++ b/cmake/FindExecInfo.cmake @@ -7,15 +7,13 @@ find_path(EXECINFO_INCLUDES "execinfo.h") -if(EXECINFO_INCLUDES STREQUAL "EXECINFO_INCLUDES-NOTFOUND") - set(EXECINFO_INCLUDES "") -else() +if(EXECINFO_INCLUDES) # We found the header file's include dir. # Now determine if it's built-in or not, by searching the library file. find_library(EXECINFO_LIBRARIES "execinfo") - if(EXECINFO_LIBRARIES STREQUAL "EXECINFO_LIBRARIES-NOTFOUND") + if(NOT EXECINFO_LIBRARIES) # Built-in, no further action is needed set(EXECINFO_LIBRARIES "") message(STATUS "Found execinfo (built-in)")