From 3be4dcd0386965097be6a29fa30d4541118aa654 Mon Sep 17 00:00:00 2001 From: Rolf Eike Beer Date: Fri, 1 Jul 2016 19:04:06 +0200 Subject: [PATCH] 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. --- cmake/FindExecInfo.cmake | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)") -- 2.20.1