Simplify FindExecInfo
authorRolf Eike Beer <kde@opensource.sf-tec.de>
Fri, 1 Jul 2016 17:04:06 +0000 (19:04 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Wed, 7 Sep 2016 19:46:28 +0000 (21:46 +0200)
* 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

index 94a5b88..f8599a6 100644 (file)
@@ -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)")