Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@snrkiwi
Copy link
Contributor

@snrkiwi snrkiwi commented Jan 8, 2017

Avoids the following error (OS X 10.11, SIP enabled, CMake 3.6)

-- Configuring done
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:

log4cpp

This warning is for project developers. Use -Wno-dev to suppress it.

-- Generating done

Tested on OS X 10.11/SIP enabled/CMake 3.6, and Mint 17.0/CMake 2.8.12.

Avoids the following error (OS X 10.11, SIP enabled, CMake 3.6)

-- Configuring done
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:

   log4cpp

This warning is for project developers.  Use -Wno-dev to suppress it.

-- Generating done
@meyerj
Copy link
Member

meyerj commented Jan 9, 2017

LGTM and we have similar cmake code in UseOROCOS-RTT-helpers.cmake.

Another solution, at least for CMake 2.8.12 and later, would be to set the cmake_policy CMP0042 to new and enable RPATH somewhere in the beginning:

cmake_minimum_required(VERSION 2.8.12)
if(POLICY CMP0042)
  cmake_policy(SET CMP0042 NEW)
endif()
if(NOT DEFINED CMAKE_MACOSX_RPATH)
  set(CMAKE_MACOSX_RPATH ON)
endif()

Maybe we should prefer this shorter code snippet for all Orocos projects and drop support for older CMake versions? The NOT DEFINED check also allows to override the default behavior in the cmake command line.

@snrkiwi
Copy link
Contributor Author

snrkiwi commented Jan 9, 2017

IIRC you can't simplify the logic that much. Ruben and I spent time hacking at this a long time ago, and the logic above (which I did indeed lift from RTT) is required.

Having said that, I'd personally be happy to simplify to CMake >= 2.8.12. We are in the process of doing exactly that to all our internal projects.

@meyerj meyerj merged commit e41198f into orocos-toolchain:toolchain-2.9 Apr 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants