summaryrefslogtreecommitdiff
path: root/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2022-09-16 15:53:42 +0200
committerContext Git Mirror Bot <phg@phi-gamma.net>2022-09-16 15:53:42 +0200
commitc161b7d6fe142231346cc1844e6e27c0ab7718c1 (patch)
tree3fd877b8986137703e987e4651a2db8e946a0f72 /source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake
parente94fa4dc30ec28a6727aa85e17aaac18b76aeadb (diff)
downloadcontext-c161b7d6fe142231346cc1844e6e27c0ab7718c1.tar.gz
2022-09-16 14:41:00
Diffstat (limited to 'source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake')
-rw-r--r--source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake b/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake
new file mode 100644
index 000000000..8a28e37e7
--- /dev/null
+++ b/source/luametatex/source/libraries/mimalloc/cmake/mimalloc-config.cmake
@@ -0,0 +1,14 @@
+include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
+get_filename_component(MIMALLOC_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH) # one up from the cmake dir, e.g. /usr/local/lib/cmake/mimalloc-2.0
+get_filename_component(MIMALLOC_VERSION_DIR "${CMAKE_CURRENT_LIST_DIR}" NAME)
+string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "${MIMALLOC_CMAKE_DIR}")
+if("${MIMALLOC_VERSION_DIR}" EQUAL "mimalloc")
+ # top level install
+ string(REPLACE "/lib/cmake" "/include" MIMALLOC_INCLUDE_DIR "${MIMALLOC_CMAKE_DIR}")
+ set(MIMALLOC_OBJECT_DIR "${MIMALLOC_LIBRARY_DIR}")
+else()
+ # versioned
+ string(REPLACE "/lib/cmake/" "/include/" MIMALLOC_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}")
+ string(REPLACE "/lib/cmake/" "/lib/" MIMALLOC_OBJECT_DIR "${CMAKE_CURRENT_LIST_DIR}")
+endif()
+set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}") # legacy