vmangos/dep/cpptrace
GrenderG 164622a36b
Proper fix for CMake 3.13 (#3376)
FetchContent_MakeAvailable was added in version 3.14. Previous fix wouldn't take into account intermediate 3.13 versions like 3.13.4.
2026-04-23 00:50:42 +03:00
..
cmake Replace ACE with native IO implementation (#2740) 2026-01-09 14:48:34 +01:00
include Replace ACE with native IO implementation (#2740) 2026-01-09 14:48:34 +01:00
src Replace ACE with native IO implementation (#2740) 2026-01-09 14:48:34 +01:00
CMakeLists.txt Proper fix for CMake 3.13 (#3376) 2026-04-23 00:50:42 +03:00
LICENSE Replace ACE with native IO implementation (#2740) 2026-01-09 14:48:34 +01:00
README.md Fix cmake warning (#3255) 2026-03-14 17:25:29 +02:00
README_original.md Replace ACE with native IO implementation (#2740) 2026-01-09 14:48:34 +01:00

jeremy-rifkin/cpptrace

Cpptrace is a simple, portable, and self-contained C++ stacktrace library supporting C++11 and greater on Linux, macOS, and Windows including MinGW and Cygwin environments. The goal: Make stack traces simple for once.

It is used in MaNGOS to print the stack trace on failure.

Source

Commit: 54a3e6fdf7
Date: 2024-09-17T13:25:23Z

Copied files

cmake/*
include/*
src/*
CMakeLists.txt
LICENSE
README.md -> README_original.md

Manual changes

Changed cmake_minimum_required to 3.12.

--- a/dep/cpptrace/CMakeLists.txt
+++ b/dep/cpptrace/CMakeLists.txt
@@ -1,4 +1,4 @@
-cmake_minimum_required(VERSION 3.14)
+cmake_minimum_required(VERSION 3.12)

Adjusted InstallRules for older cmake version

--- a/dep/cpptrace/cmake/InstallRules.cmake
+++ b/dep/cpptrace/cmake/InstallRules.cmake
@@ -25,6 +25,7 @@ install(
   COMPONENT ${package_name}-development
   INCLUDES #
   DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
+  ARCHIVE DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
 )
 
 # create config file that points to targets file

Disabled install rules to prevent cmake_install.cmake generation

--- a/dep/cpptrace/CMakeLists.txt
+++ b/dep/cpptrace/CMakeLists.txt
@@ -598,6 +598,9 @@ endif()

 # =============================================== Install ===============================================

-if(NOT CMAKE_SKIP_INSTALL_RULES)
-  include(cmake/InstallRules.cmake)
-endif()
+# if(NOT CMAKE_SKIP_INSTALL_RULES)
+#   include(cmake/InstallRules.cmake)
+# endif()

 # =============================================== Demo/test ===============================================

Prevent zstd, libdwarf from installing files (EXCLUDE_FROM_ALL)

Add EXCLUDE_FROM_ALL to FetchContent_Declare

diff --git a/dep/cpptrace/CMakeLists.txt b/dep/cpptrace/CMakeLists.txt
index 2c73da03f..c1dfaf6a9 100644
--- a/dep/cpptrace/CMakeLists.txt
+++ b/dep/cpptrace/CMakeLists.txt
@@ -425,8 +425,12 @@ if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF)
           SOURCE_SUBDIR build/cmake
           DOWNLOAD_EXTRACT_TIMESTAMP TRUE
           URL "${CPPTRACE_ZSTD_URL}"
+          EXCLUDE_FROM_ALL
       )
-      FetchContent_MakeAvailable(zstd)
+      FetchContent_GetProperties(zstd)
+      if(NOT zstd_POPULATED)
+        FetchContent_MakeAvailable(zstd)
+      endif()
     endif()
     # Libdwarf itself
     set(CMAKE_POLICY_DEFAULT_CMP0077 NEW)
@@ -437,8 +441,12 @@ if(CPPTRACE_GET_SYMBOLS_WITH_LIBDWARF)
       GIT_REPOSITORY ${CPPTRACE_LIBDWARF_REPO}
       GIT_TAG ${CPPTRACE_LIBDWARF_TAG}
       GIT_SHALLOW ${CPPTRACE_LIBDWARF_SHALLOW}
+      EXCLUDE_FROM_ALL
     )
-    FetchContent_MakeAvailable(libdwarf)
+    FetchContent_GetProperties(libdwarf)
+    if(NOT libdwarf_POPULATED)
+      FetchContent_MakeAvailable(libdwarf)
+    endif()
     target_include_directories(
       dwarf
       PRIVATE
@@ -601,9 +609,10 @@ endif()