diff options
author | Brad King <brad.king@kitware.com> | 2013-12-20 14:41:10 (GMT) |
---|---|---|
committer | CMake Topic Stage <kwrobot@kitware.com> | 2013-12-20 14:41:10 (GMT) |
commit | c6072c7806777fc734d7a6287229f87a26844c8b (patch) | |
tree | 321eef7493bd52f88adc88a892374d5f6cbba7e1 | |
parent | a0ce1e36b6d3a117ebf51d1d803a129cf657321e (diff) | |
parent | 9650c09b952598e39b67962411900ef6303d4117 (diff) | |
download | CMake-c6072c7806777fc734d7a6287229f87a26844c8b.zip CMake-c6072c7806777fc734d7a6287229f87a26844c8b.tar.gz CMake-c6072c7806777fc734d7a6287229f87a26844c8b.tar.bz2 |
Merge topic 'find_backtrace'
9650c09 FindBacktrace: Search and report only when not already found
-rw-r--r-- | Modules/FindBacktrace.cmake | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/Modules/FindBacktrace.cmake b/Modules/FindBacktrace.cmake index 56e739e..83789cc 100644 --- a/Modules/FindBacktrace.cmake +++ b/Modules/FindBacktrace.cmake @@ -58,17 +58,20 @@ endif(Backtrace_HEADER) find_path(Backtrace_INCLUDE_DIR "${_Backtrace_HEADER_TRY}") set(Backtrace_INCLUDE_DIRS ${Backtrace_INCLUDE_DIR}) -# First, check if we already have backtrace(), e.g., in libc -cmake_push_check_state(RESET) -set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS}) -check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND) -cmake_pop_check_state() +if (NOT DEFINED Backtrace_LIBRARY) + # First, check if we already have backtrace(), e.g., in libc + cmake_push_check_state(RESET) + set(CMAKE_REQUIRED_INCLUDES ${Backtrace_INCLUDE_DIRS}) + check_symbol_exists("backtrace" "${_Backtrace_HEADER_TRY}" _Backtrace_SYM_FOUND) + cmake_pop_check_state() +endif() if(_Backtrace_SYM_FOUND) - set(Backtrace_LIBRARY) - if(NOT Backtrace_FIND_QUIETLY) + # Avoid repeating the message() call below each time CMake is run. + if(NOT Backtrace_FIND_QUIETLY AND NOT DEFINED Backtrace_LIBRARY) message(STATUS "backtrace facility detected in default set of libraries") endif() + set(Backtrace_LIBRARY "" CACHE FILEPATH "Library providing backtrace(3), empty for default set of libraries") else() # Check for external library, for non-glibc systems if(Backtrace_INCLUDE_DIR) |