freebsd-ports/multimedia/plexhometheater/files/patch-plex__CMakeModules__FindExecinfo.cmake
Adam Weinberger ebbe9bf3b2 Add multimedia/plexhometheater, the frontend to the powerful
Plex media system.

PR:		191413
Submitted by:	woodsb02@gmail.com
2014-08-21 16:55:55 +00:00

40 lines
1.3 KiB
CMake

--- plex/CMakeModules/FindExecinfo.cmake.orig 2014-06-18 13:48:49.013626678 +0000
+++ plex/CMakeModules/FindExecinfo.cmake 2014-06-18 13:53:45.058602542 +0000
@@ -0,0 +1,37 @@
+# -*- cmake -*-
+
+# - Find execinfo
+# Find the execinfo includes and library
+# The problem with this library is that it is built-in in the Linux glib,
+# while on systems like FreeBSD, it is installed separately and thus needs to be linked to.
+# Therefore, we search for the header to see if the it's available in the first place.
+# If it is available, we try to locate the library to figure out whether it is built-in or not.
+
+if(EXECINFO_INCLUDE_DIR)
+ # Already in cache, be silent
+ set(EXECINFO_FIND_QUIETLY TRUE)
+endif(EXECINFO_INCLUDE_DIR)
+
+find_package(PkgConfig)
+if (PKG_CONFIG_FOUND)
+ pkg_check_modules(_EXECINFO libexecinfo)
+endif (PKG_CONFIG_FOUND)
+
+Find_Path(EXECINFO_INCLUDE_DIR
+ NAMES execinfo.h
+ PATHS /usr/include usr/local/include
+ HINTS ${_EXECINFO_INCLUDEDIR}
+)
+
+Find_Library(EXECINFO_LIBRARY
+ NAMES execinfo
+ PATHS /usr/lib usr/local/lib
+ HINTS ${_EXECINFO_LIBDIR}
+)
+
+include(FindPackageHandleStandardArgs)
+find_package_handle_standard_args(EXECINFO DEFAULT_MSG EXECINFO_LIBRARY EXECINFO_INCLUDE_DIR)
+
+IF(EXECINFO_LIBRARY AND EXECINFO_INCLUDE_DIR)
+ plex_get_soname(EXECINFO_SONAME ${EXECINFO_LIBRARY})
+ENDIF()