Skip to content

Commit

Permalink
Set some Apple Compiler related cmake policies
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins committed Jan 22, 2024
1 parent 049eb78 commit 2e9b6fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
cmake_minimum_required(VERSION 3.25)

# Compiler id for Apple Clang is now AppleClang
cmake_policy(SET CMP0025 NEW)

# Enable MACOS_RPATH
# https://cmake.org/cmake/help/latest/policy/CMP0042.html
cmake_policy(SET CMP0042 NEW)

cmake_host_system_information(RESULT ncores QUERY NUMBER_OF_PHYSICAL_CORES)
enable_testing()

Expand All @@ -11,7 +19,7 @@ if(UNIX)
set(CMAKE_INSTALL_RPATH "$ORIGIN")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
elseif(APPLE)
set(CMAKE_INSTALL_RPATH "@rpath")
set(CMAKE_INSTALL_RPATH "@loader_path")
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
elseif(WIN32)
message(FATAL_ERROR "Windows is not supported")
Expand Down

0 comments on commit 2e9b6fe

Please sign in to comment.