microsoft / mimalloc

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

CMake install with namespace and add corresponding alias targets #886

Open tkohlman opened 2 months ago

tkohlman commented 2 months ago

Add namespace to installed export

install(EXPORT mimalloc DESTINATION ${mi_install_cmakedir} NAMESPACE mimalloc::)

Add alias targets to provide consistent targets for submodule builds.

add_library(mimalloc::mimalloc-obj ALIAS mimalloc-obj) add_library(mimalloc::mimalloc-static ALIAS mimalloc-static)

daanx commented 4 weeks ago

Thank you for the feedback; I'm not a cmake expert and don't know what the NAMESPACE does? Would adding this be backward compatible or is there a chance of breaking existing build scripts that people have?