From fad21d10983aa9a61b724eb75832c1624d2b262c Mon Sep 17 00:00:00 2001 From: Christian Dywan Date: Sun, 19 Jul 2015 18:25:09 -0400 Subject: Use find_file to locate execinfo.h It may not be available in a particular libc. --- CMakeLists.txt | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'CMakeLists.txt') diff --git a/CMakeLists.txt b/CMakeLists.txt index 168c95bf..28225ad4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,11 @@ if (UNIX) if (SIGNAL) add_definitions("-DHAVE_SIGNAL_H") endif () + + find_file (EXEC_INFO execinfo.h) + if (EXEC_INFO) + set(VALAFLAGS ${VALAFLAGS} -D HAVE_EXECINFO_H) + endif () endif () find_library (X11 X11) @@ -101,17 +106,6 @@ else () add_definitions("-DHAVE_OSX=0") endif () -# Check if execinfo.h header exists -string(FIND ${CMAKE_SYSTEM_NAME} "BSD" BEGIN) -if (${BEGIN} GREATER 0) - string(SUBSTRING ${CMAKE_SYSTEM_NAME} ${BEGIN} 3 BSD) -else() - set(BSD 0) -endif() -if (UNIX AND NOT BSD AND NOT DFLY) - set(VALAFLAGS ${VALAFLAGS} -D HAVE_EXECINFO_H) -endif () - find_package(PkgConfig) pkg_check_modules(DEPS REQUIRED libxml-2.0>=2.6 -- cgit v1.2.1