MantisBT - CMake | ||||||||||
View Issue Details | ||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | |||||
0013271 | CMake | CMake | public | 2012-06-05 12:01 | 2016-06-10 14:31 | |||||
Reporter | recryn | |||||||||
Assigned To | Kitware Robot | |||||||||
Priority | normal | Severity | minor | Reproducibility | always | |||||
Status | closed | Resolution | moved | |||||||
Platform | Apple | OS | Mac OS X | OS Version | 10.6.8 | |||||
Product Version | CMake 2.8.8 | |||||||||
Target Version | Fixed in Version | |||||||||
Summary | 0013271: is_file_executable() from GetPrerequisites.cmake erroneously returns 0 for universal binaries (MacOSX) | |||||||||
Description | On UNIX is_file_executable() executes the tool 'file' and then compares the returned string with "executable": if("${file_ov}" MATCHES "executable") However, on MacOSX, there are several 'file' tools available (macports, fink) which do not share the same output format. Most notably, the output string does not always match "executable" if the file is a universal binary. Here are some possible output strings of 'file' for three different executables on a Mac: Mach-O executable i386 Mach-O 64-bit executable Mach-O fat file with 2 architectures 'file /bin/ls' results just in: /bin/ls: Mach-O fat file with 2 architectures Note, that a library would be reported as: "Mach-O 64-bit dynamically linked shared library". So matching Mach-O is no good either. Ideally is_file_executable() would call 'otool -hv' on APPLE and match the result with "EXECUTE", e.g.: otool -hv /bin/ls /bin/ls: Mach header magic cputype cpusubtype caps filetype ncmds sizeofcmds flags MH_MAGIC_64 X86_64 ALL LIB64 EXECUTE 13 1928 NOUNDEFS DYLDLINK TWOLEVEL | |||||||||
Steps To Reproduce | 1. Install 'file' from macports: port install file 2. Prepend macports binary dir (/opt/local/bin) to PATH 3. With a project that uses fixup_bundle: cmake -DCMAKE_OSX_ARCHITECTURES="x86_64;i386" make cpack -G Bundle --verbose [...] CPack Verbose: libs='' CPack Verbose: dirs='' CPack Verbose: warning: *NOT* handled - not .app dir, not executable file... CMake Error at /opt/local/share/cmake-2.8/Modules/MyBundleUtilities.cmake:723 (message): error: fixup_bundle: not a valid bundle Call Stack (most recent call first): /tmp/trunk/build/cmake/dist/cmake_install.cmake:38 (fixup_bundle) /tmp/trunk/build/cmake_install.cmake:36 (INCLUDE) | |||||||||
Additional Information | Patch attached. | |||||||||
Tags | No tags attached. | |||||||||
Relationships |
| |||||||||
Attached Files | ![]() https://public.kitware.com/Bug/file/4343/GetPrerequisites.cmake.diff | |||||||||
Issue History | ||||||||||
Date Modified | Username | Field | Change | |||||||
2012-06-05 12:01 | recryn | New Issue | ||||||||
2012-06-05 12:01 | recryn | File Added: GetPrerequisites.cmake.diff | ||||||||
2012-08-11 21:37 | David Cole | Assigned To | => David Cole | |||||||
2012-08-11 21:37 | David Cole | Status | new => assigned | |||||||
2012-11-21 14:57 | David Cole | Note Added: 0031654 | ||||||||
2012-11-21 14:59 | David Cole | Assigned To | David Cole => | |||||||
2012-11-21 15:11 | David Cole | Status | assigned => new | |||||||
2012-11-21 15:11 | David Cole | Note Added: 0031666 | ||||||||
2012-11-30 14:33 | David Cole | Relationship added | related to 0013764 | |||||||
2016-06-10 14:28 | Kitware Robot | Note Added: 0042059 | ||||||||
2016-06-10 14:28 | Kitware Robot | Status | new => resolved | |||||||
2016-06-10 14:28 | Kitware Robot | Resolution | open => moved | |||||||
2016-06-10 14:28 | Kitware Robot | Assigned To | => Kitware Robot | |||||||
2016-06-10 14:31 | Kitware Robot | Status | resolved => closed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|