From 80a6e55c27f74617de86b62667066609f9cf2a47 Mon Sep 17 00:00:00 2001 From: Jean-Paul Chaput Date: Mon, 3 Dec 2012 08:38:59 +0000 Subject: [PATCH] Forgot this one, for FreeBSD. --- bootstrap/cmake_modules/FindLibexecinfo.cmake | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 bootstrap/cmake_modules/FindLibexecinfo.cmake diff --git a/bootstrap/cmake_modules/FindLibexecinfo.cmake b/bootstrap/cmake_modules/FindLibexecinfo.cmake new file mode 100644 index 00000000..ecdd4bfe --- /dev/null +++ b/bootstrap/cmake_modules/FindLibexecinfo.cmake @@ -0,0 +1,46 @@ +# Try to find LibExecinfo functionality +# Once done this will define +# +# LIBEXECINFO_FOUND - system has LibExecinfo +# LIBEXECINFO_INCLUDE_DIR - LibExecinfo include directory +# LIBEXECINFO_LIBRARIES - Libraries needed to use LibExecinfo +# +# TODO: This will enable translations only if Gettext functionality is +# present in libc. Must have more robust system for release, where Gettext +# functionality can also reside in standalone Gettext library, or the one +# embedded within kdelibs (cf. gettext.m4 from Gettext source). + +# Copyright (c) 2006, Chusslove Illich, +# Copyright (c) 2007, Alexander Neundorf, +# +# Redistribution and use is allowed according to the terms of the BSD license. +# For details see the accompanying COPYING-CMAKE-SCRIPTS file. + +if(LIBEXECINFO_INCLUDE_DIR AND LIBEXECINFO_LIB_FOUND) + set(LibExecinfo_FIND_QUIETLY TRUE) +endif(LIBEXECINFO_INCLUDE_DIR AND LIBEXECINFO_LIB_FOUND) + +find_path(LIBEXECINFO_INCLUDE_DIR execinfo.h) + +set(LIBEXECINFO_LIB_FOUND FALSE) + +if(LIBEXECINFO_INCLUDE_DIR) + include(CheckFunctionExists) + check_function_exists(backtrace LIBEXECINFO_LIBC_HAS_LIBEXECINFO_BACKTRACE) + + if (LIBEXECINFO_LIBC_HAS_LIBEXECINFO_BACKTRACE) + set(LIBEXECINFO_LIBRARIES) + set(LIBEXECINFO_LIB_FOUND TRUE) + else (LIBEXECINFO_LIBC_HAS_LIBEXECINFO_BACKTRACE) + find_library(LIBEXECINFO_LIBRARIES NAMES execinfo libexecinfo ) + if(LIBEXECINFO_LIBRARIES) + set(LIBEXECINFO_LIB_FOUND TRUE) + endif(LIBEXECINFO_LIBRARIES) + endif (LIBEXECINFO_LIBC_HAS_LIBEXECINFO_BACKTRACE) + +endif(LIBEXECINFO_INCLUDE_DIR) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(LibExecinfo DEFAULT_MSG LIBEXECINFO_INCLUDE_DIR LIBEXECINFO_LIB_FOUND) + +mark_as_advanced(LIBEXECINFO_INCLUDE_DIR LIBEXECINFO_LIBRARIES LIBEXECINFO_LIBC_HAS_LIBEXECINFO_BACKTRACE LIBEXECINFO_LIB_FOUND) \ No newline at end of file