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