Cmake ROS失败:Mac OSX部署目标不匹配

时间:2015-11-09 13:46:28

标签: c++ macos cmake ros

我正在尝试使用Mac OSX Yosemite中的ROS编译LSD-SLAM(v10.10.4)。已设置ROS Jade并已检出源代码。

然而rosmake似乎失败了。

这是输出:

[ rosmake ] rosmake starting...                                                 
[ rosmake ] Packages requested are: ['lsd_slam']                                
[ rosmake ] Logging to directory /Users/apple/.ros/rosmake/rosmake_output-20151109-185908
[ rosmake ] Expanded args ['lsd_slam'] to:
['lsd_slam_core', 'lsd_slam_viewer'] 
[rosmake-0] Starting >>> catkin [ make ]                                        
[rosmake-0] Finished <<< catkin ROS_NOBUILD in package catkin
 No Makefile in package catkin
[rosmake-0] Starting >>> genmsg [ make ]                                        
[rosmake-0] Finished <<< genmsg ROS_NOBUILD in package genmsg
 No Makefile in package genmsg
[rosmake-0] Starting >>> genlisp [ make ]   

。 。 。    很多构建消息 。 。

[rosmake-0] Starting >>> lsd_slam_viewer [ make ]                               
[ rosmake ] All 18 lines
{-------------------------------------------------------------------------------
  mkdir -p bin
  cd build && cmake -Wdev -DCMAKE_TOOLCHAIN_FILE=/Users/apple/ros_catkin_ws/install_isolated/share/ros/core/rosbuild/rostoolchain.cmake  ..
  CMake Error at /usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/Platform/Darwin.cmake:76 (message):
    CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT:

     ""

    is not set to a MacOSX SDK with a recognized version.  Either set
    CMAKE_OSX_SYSROOT to a valid SDK or set CMAKE_OSX_DEPLOYMENT_TARGET to
    empty.
  Call Stack (most recent call first):
    /usr/local/Cellar/cmake/3.3.2/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)
    CMakeLists.txt:2 (project)


  -- Configuring incomplete, errors occurred!
  See also "/Users/apple/ros_catkin_ws/package_dir/lsd_slam/lsd_slam_viewer/build/CMakeFiles/CMakeOutput.log".
-------------------------------------------------------------------------------}
[ rosmake ] Output from build of package lsd_slam_viewer written to:
[ rosmake ]    /Users/apple/.ros/rosmake/rosmake_output-20151109-185908/lsd_slam_viewer/build_output.log
[rosmake-0] Finished <<< lsd_slam_viewer [FAIL] [ 0.09 seconds ]                
[ rosmake ] Halting due to failure in package lsd_slam_viewer. 
[ rosmake ] Waiting for other threads to complete.
[ rosmake ] Results:                                                            
[ rosmake ] Built 42 packages with 1 failures.                                  
[ rosmake ] Summary output to directory                                         
[ rosmake ] /Users/apple/.ros/rosmake/rosmake_output-20151109-185908     

这个问题的核心在于这一点:

CMAKE_OSX_DEPLOYMENT_TARGET is '10.6' but CMAKE_OSX_SYSROOT: ""

我浏览了这个消息列表:

https://cmake.org/pipermail/cmake/2012-November/052649.html

和此:

https://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=15f5764e

但无法解决我的问题。

我尝试使用以下方法更新SDK根目录:

export SDKROOT=/Developer/SDKs/MacOSX10.6.sdk

我还尝试从public.cmake中注释掉系统根目标,如下所示: http://answers.ros.org/question/50561/cmake_osx_deployment_target-and-cmake_osx_sysroot/

但没有快乐。

请帮忙。提前谢谢。

1 个答案:

答案 0 :(得分:0)

我有同样的问题。 请试一试。
在〜/ ros_catkin_ws / install_isolated / share / ros / core / rosbuild / public.cmake中注释一行,如下所示:

if(APPLE) #SET(CMAKE_OSX_DEPLOYMENT_TARGET "10.6" CACHE STRING "Deployment target for OSX" FORCE) endif(APPLE)