title: CMake warnings under OS X: MACOSX_RPATH is not specified for the following targets
body: <p>I try to build a CMake-based software under OS X (Yosemite) which can be built successfully under Fedora 21. It uses a bunch of libraries. Both, big open ones like Boost and some self-written ones lying in /installation_folder/lib. I use CMake version 3.3.0. </p>
  
  <p>After executing </p>
  
  <pre><code>mkdir build
  cd build
  cmake .. -DCMAKE_C_COMPILER=/usr/local/Cellar/gcc/5.2.0/bin/gcc-5 -DCMAKE_CXX_COMPILER=/usr/local/Cellar/gcc/5.2.0/bin/g++-5  -DCMAKE_MODULE_PATH=${PWD}/../external/install/share/llvm/cmake 
  </code></pre>
  
  <p>I get the following warnings:</p>
  
  <pre><code>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:
  
  ClangWrapper
  Structure
  WCETXML
  
  This warning is for project developers.  Use -Wno-dev to suppress it.
  </code></pre>
  
  <p>The CMakeLists.txt contains the following lines regarding RPATH:</p>
  
  <pre><code>SET(CMAKE_SKIP_BUILD_RPATH FALSE)
  SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
  SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
  
  LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
  
  IF("${isSystemDir}" STREQUAL "-1")
    SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
  ENDIF("${isSystemDir}" STREQUAL "-1")
  </code></pre>
  
  <p>All I can say is that <code>${CMAKE_INSTALL_PREFIX}/lib</code> is indeed the correct path, and that other libraries like Boost are found correctly.</p>
  
  <p>Ignoring the warnings and continuing with "make" in the build directory results in a linking error.</p>
  
  <p>I read the <a href="http://www.cmake.org/Wiki/CMake_RPATH_handling#Mac_OS_X_and_the_RPATH" rel="noreferrer">CMake Wiki RPATH handling article</a>, but I am still not able to distinguish between these path variables and their correct use on OS X. </p>