MantisBT - CMake
View Issue Details
0014668CMakeModulespublic2013-12-23 11:472014-06-02 08:37
sezero 
Brad King 
normalminoralways
closedduplicate 
CMake 2.8.12 
 
0014668: Modules/Platform/Darwin.cmake failure with cross toolchain file
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)
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)
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)
No tags attached.
duplicate of 0014603closed Brad King Cross compiling for darwin fails 
Issue History
2013-12-23 11:47sezeroNew Issue
2013-12-24 09:10Brad KingRelationship addedduplicate of 0014603
2013-12-24 09:10Brad KingStatusnew => resolved
2013-12-24 09:10Brad KingResolutionopen => duplicate
2013-12-24 09:10Brad KingAssigned To => Brad King
2014-06-02 08:37Robert MaynardNote Added: 0036066
2014-06-02 08:37Robert MaynardStatusresolved => closed

Notes
(0036066)
Robert Maynard   
2014-06-02 08:37   
Closing resolved issues that have not been updated in more than 4 months.