mirror of
https://github.com/microsoft/mimalloc.git
synced 2025-07-07 03:48:42 +03:00
further improvements to installation directories
This commit is contained in:
parent
1bbc184082
commit
69b6b24688
5 changed files with 26 additions and 20 deletions
|
@ -1,7 +1,7 @@
|
|||
set(mi_version_major 1)
|
||||
set(mi_version_minor 7)
|
||||
set(mi_version_patch 3)
|
||||
set(mi_version ${mi_version_major}.${mi_version_minor}.${mi_version_patch})
|
||||
set(mi_version_patch 4)
|
||||
set(mi_version ${mi_version_major}.${mi_version_minor})
|
||||
|
||||
set(PACKAGE_VERSION ${mi_version})
|
||||
if(PACKAGE_FIND_VERSION_MAJOR)
|
||||
|
|
|
@ -1,11 +1,14 @@
|
|||
include(${CMAKE_CURRENT_LIST_DIR}/mimalloc.cmake)
|
||||
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()
|
||||
# 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}")
|
||||
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_VER_DIR "${CMAKE_CURRENT_LIST_DIR}" NAME)
|
||||
string(REPLACE "/lib/cmake" "/lib" MIMALLOC_LIBRARY_DIR "${MIMALLOC_CMAKE_DIR}")
|
||||
if("${MIMALLOC_VER_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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue