2019-06-20 02:26:12 +03:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
|
2021-05-22 01:15:50 +03:00
|
|
|
get_filename_component(MIMALLOC_SHARE_DIR "${CMAKE_CURRENT_LIST_DIR}" PATH) # one up from the cmake dir, e.g. /usr/local/share/mimalloc-2.0
|
|
|
|
if (MIMALLOC_SHARE_DIR MATCHES "/share/")
|
|
|
|
string(REPLACE "/share/" "/lib/" MIMALLOC_LIBRARY_DIR ${MIMALLOC_SHARE_DIR})
|
|
|
|
string(REPLACE "/share/" "/include/" MIMALLOC_INCLUDE_DIR ${MIMALLOC_SHARE_DIR})
|
|
|
|
else()
|
2021-11-15 02:32:21 +03:00
|
|
|
# installed with -DMI_INSTALL_TOPLEVEL=ON
|
|
|
|
string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "${MIMALLOC_SHARE_DIR}")
|
|
|
|
string(REPLACE "/lib/cmake" "/include" MIMALLOC_INCLUDE_DIR "${MIMALLOC_SHARE_DIR}")
|
2021-05-22 01:15:50 +03:00
|
|
|
endif()
|
|
|
|
set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}") # legacy
|