From 697aacc07202debf88b582998e261cb68f06ae25 Mon Sep 17 00:00:00 2001 From: Dimitri Staessens Date: Fri, 29 Oct 2021 08:45:34 +0200 Subject: build: Install into /usr/local by default on OS X On more recent Mac OS X (>= Catalina) the system volume is read-only, even with System Integrity Protection disabled. This requires an additional remount step to install something into /usr. Probably better to play by their rules and default the install to /usr/local. Signed-off-by: Dimitri Staessens Signed-off-by: Sander Vrijders --- CMakeLists.txt | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e7182396..6e49074d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -24,7 +24,13 @@ if (NOT CMAKE_BUILD_TYPE) endif() if (CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT) - set(CMAKE_INSTALL_PREFIX "/usr" CACHE STRING "Installation Prefix" FORCE) + if (APPLE) + set(CMAKE_INSTALL_PREFIX "/usr/local" CACHE STRING + "Installation Prefix" FORCE) + else() + set(CMAKE_INSTALL_PREFIX "/usr" CACHE STRING + "Installation Prefix" FORCE) + endif() endif () if (APPLE) -- cgit v1.2.3