2019-12-03 15:58:59 +00:00
|
|
|
# - Try to find Unwind
|
|
|
|
# Once done this will define
|
|
|
|
#
|
|
|
|
# UNWIND_FOUND - system has Unwind
|
|
|
|
# UNWIND_INCLUDES - the Unwind include directory
|
|
|
|
# UNWIND_LIBRARIES - the libraries needed to use Unwind
|
|
|
|
#
|
2020-01-04 02:01:52 +00:00
|
|
|
# Copyright (c) 2015-2020, Ivailo Monev, <xakepa10@gmail.com>
|
2019-12-03 15:58:59 +00:00
|
|
|
#
|
|
|
|
# Redistribution and use is allowed according to the terms of the BSD license.
|
|
|
|
|
|
|
|
if(NOT WIN32)
|
|
|
|
include(FindPkgConfig)
|
|
|
|
pkg_check_modules(PC_UNWIND QUIET libunwind)
|
2020-02-10 21:21:33 +00:00
|
|
|
|
|
|
|
set(UNWIND_INCLUDES ${PC_UNWIND_INCLUDE_DIRS})
|
|
|
|
set(UNWIND_LIBRARIES ${PC_UNWIND_LIBRARIES})
|
2019-12-03 15:58:59 +00:00
|
|
|
endif()
|
|
|
|
|
2020-02-10 21:21:33 +00:00
|
|
|
if(NOT UNWIND_INCLUDES OR NOT UNWIND_LIBRARIES)
|
|
|
|
find_path(UNWIND_INCLUDES
|
|
|
|
NAMES libunwind.h
|
|
|
|
HINTS $ENV{UNWINDDIR}/include
|
|
|
|
)
|
2019-12-03 15:58:59 +00:00
|
|
|
|
2020-02-10 21:21:33 +00:00
|
|
|
find_library(UNWIND_LIBRARIES
|
|
|
|
NAMES unwind
|
|
|
|
HINTS $ENV{UNWINDDIR}/lib
|
|
|
|
)
|
|
|
|
endif()
|
2019-12-03 15:58:59 +00:00
|
|
|
|
|
|
|
include(FindPackageHandleStandardArgs)
|
|
|
|
find_package_handle_standard_args(Unwind
|
|
|
|
VERSION_VAR PC_UNWIND_VERSION
|
|
|
|
REQUIRED_VARS UNWIND_LIBRARIES UNWIND_INCLUDES
|
|
|
|
)
|
|
|
|
|
|
|
|
mark_as_advanced(UNWIND_INCLUDES UNWIND_LIBRARIES)
|