2019-06-19 16:26:12 -07:00
|
|
|
include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
|
2021-12-14 18:29:14 -08:00
|
|
|
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
|
2021-12-15 08:33:14 -08:00
|
|
|
get_filename_component(MIMALLOC_VERSION_DIR "${CMAKE_CURRENT_LIST_DIR}" NAME)
|
2021-12-14 18:29:14 -08:00
|
|
|
string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "${MIMALLOC_CMAKE_DIR}")
|
2022-12-03 00:23:43 +01:00
|
|
|
if("${MIMALLOC_VERSION_DIR}" EQUAL "mimalloc")
|
2021-12-14 18:29:14 -08:00
|
|
|
# top level install
|
|
|
|
string(REPLACE "/lib/cmake" "/include" MIMALLOC_INCLUDE_DIR "${MIMALLOC_CMAKE_DIR}")
|
|
|
|
set(MIMALLOC_OBJECT_DIR "${MIMALLOC_LIBRARY_DIR}")
|
2022-12-03 00:23:43 +01:00
|
|
|
else()
|
2021-12-14 18:29:14 -08:00
|
|
|
# versioned
|
|
|
|
string(REPLACE "/lib/cmake/" "/include/" MIMALLOC_INCLUDE_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
2022-12-03 00:23:43 +01:00
|
|
|
string(REPLACE "/lib/cmake/" "/lib/" MIMALLOC_OBJECT_DIR "${CMAKE_CURRENT_LIST_DIR}")
|
|
|
|
endif()
|
2021-05-21 15:15:50 -07:00
|
|
|
set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}") # legacy
|