microsoft / mimalloc

mimalloc is a compact general purpose allocator with excellent performance.
MIT License
10.45k stars 843 forks source link

mimalloc.cmake has hard-coded paths #827

Open davesworking opened 10 months ago

davesworking commented 10 months ago

hi,

the generated mimalloc.cmake file has hard-coded paths, e.g.

mimalloc.cmake

# The installation prefix configured by this project.
set(_IMPORT_PREFIX"C:/Build/work/Windows-x86-64/vc143")

set_target_properties(mimallocPROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES"C:/Build/work/Build/Windows-x86-64/vc143/include/mimalloc-2.1"
)

set_target_properties(mimalloc-staticPROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES"C:/Build/work/Build/Windows-x86-64/vc143/include/mimalloc-2.1"
  INTERFACE_LINK_LIBRARIES"\$<LINK_ONLY:psapi>;\$<LINK_ONLY:shell32>;\$<LINK_ONLY:user32>;\$<LINK_ONLY:advapi32>;\$<LINK_ONLY:bcrypt>"
)

Is it possible to have relative paths, e.g.:

# Compute the installation prefix relative to this file.
get_filename_component(_IMPORT_PREFIX"${CMAKE_CURRENT_LIST_FILE}"PATH)
get_filename_component(_IMPORT_PREFIX"${_IMPORT_PREFIX}"PATH)
get_filename_component(_IMPORT_PREFIX"${_IMPORT_PREFIX}"PATH)
get_filename_component(_IMPORT_PREFIX"${_IMPORT_PREFIX}"PATH)
if(_IMPORT_PREFIXSTREQUAL"/")
  set(_IMPORT_PREFIX"")
endif()

Is there a way to specify that during the CMake build?

Thanks! Dave