From 7414a56d7f7ac70ca64949814deb8f15573284e8 Mon Sep 17 00:00:00 2001 From: Zeex Date: Sat, 30 Dec 2017 19:37:00 +0600 Subject: [PATCH] Fix CMake warning regarding use of @rpath on macOS CMake Warning (dev): Policy CMP0042 is not set: MACOSX_RPATH is enabled by default. Run "cmake --help-policy CMP0042" for policy details. Use the cmake_policy command to set the policy and suppress this warning. MACOSX_RPATH is not specified for the following targets: pawnc This warning is for project developers. Use -Wno-dev to suppress it. --- source/compiler/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/compiler/CMakeLists.txt b/source/compiler/CMakeLists.txt index 61d762b..73b8739 100644 --- a/source/compiler/CMakeLists.txt +++ b/source/compiler/CMakeLists.txt @@ -58,6 +58,10 @@ if(UNIX) link_libraries(pthread) endif() +if(APPLE) + set(CMAKE_MACOSX_RPATH ON) +endif() + configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_BINARY_DIR}/version.h) include_directories(${CMAKE_CURRENT_BINARY_DIR})