[cmake-developers] [CMake 0014668]: Modules/Platform/Darwin.cmake failure with cross toolchain file

Mantis Bug Tracker mantis at public.kitware.com
Mon Dec 23 11:47:52 EST 2013


The following issue has been SUBMITTED. 
====================================================================== 
http://www.cmake.org/Bug/view.php?id=14668 
====================================================================== 
Reported By:                sezero
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14668
Category:                   Modules
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2013-12-23 11:47 EST
Last Modified:              2013-12-23 11:47 EST
====================================================================== 
Summary:                    Modules/Platform/Darwin.cmake failure with cross
toolchain file
Description: 
Using a toolchain file to test a linux-to-darwin cross-compile, I get
the following:

CMake Error at /usr/share/cmake/Modules/Platform/Darwin.cmake:344 (list):
  list sub-command REMOVE_DUPLICATES requires list to be present.
Call Stack (most recent call first):
  /usr/share/cmake/Modules/CMakeSystemSpecificInformation.cmake:36 (include)


Steps to Reproduce: 
cmake -DCMAKE_TOOLCHAIN_FILE=/path/to/Toolchain-OSX-ppc.cmake

FWIW, the toolchain file looks like this:

SET(CMAKE_SYSTEM_NAME Darwin)

SET(CMAKE_C_COMPILER /opt/cross_osx-ppc/bin/powerpc-apple-darwin9-gcc)
SET(CMAKE_CXX_COMPILER /opt/cross_osx-ppc/bin/powerpc-apple-darwin9-g++)

# where is the target environment
SET(CMAKE_FIND_ROOT_PATH /opt/cross_osx-ppc)

# adjust the default behaviour of the FIND_XXX() commands:
# search headers and libraries in the target environment, search
# programs in the host environment
SET(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
SET(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
SET(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)


Additional Information: 
LIST(REMOVE_DUPLICATES ...) seems sensitive to unset (non-existent)
variables, so applying the following patch makes it work for me:

--- Darwin.cmake~
+++ Darwin.cmake
@@ -341,7 +341,9 @@
     list(APPEND _apps_paths "${_apps}")
   endif()
 endforeach()
-list(REMOVE_DUPLICATES _apps_paths)
+if(_apps_paths)
+  list(REMOVE_DUPLICATES _apps_paths)
+endif()
 set(CMAKE_SYSTEM_APPBUNDLE_PATH
   ${_apps_paths})
 unset(_apps_paths)

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2013-12-23 11:47 sezero         New Issue                                    
======================================================================




More information about the cmake-developers mailing list