update cmake install for MI_INSTALL_TOPLEVEL

This commit is contained in:
Daan 2021-11-14 15:32:21 -08:00
parent 5e55525e5e
commit 4ce6821c09
2 changed files with 6 additions and 3 deletions

View File

@ -4,8 +4,8 @@ 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()
# if MI_INSTALL_TOPLEVEL==ON
set(MIMALLOC_LIBRARY_DIR "${MIMALLOC_SHARE_DIR}/lib")
set(MIMALLOC_INCLUDE_DIR "${MIMALLOC_SHARE_DIR}/include")
# 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}")
endif()
set(MIMALLOC_TARGET_DIR "${MIMALLOC_LIBRARY_DIR}") # legacy

View File

@ -1,6 +1,9 @@
cmake_minimum_required(VERSION 3.0)
project(mimalloc-test C CXX)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
# Set default build type
if (NOT CMAKE_BUILD_TYPE)
if ("${CMAKE_BINARY_DIR}" MATCHES ".*(D|d)ebug$")