fixup_bundle fails for read-only .dylib files

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

fixup_bundle fails for read-only .dylib files

Neil Williams
Hello,

We use perforce for our source control system, which has a typical configuration where files need to be explicitly checked out prior to them being changed. If they are not checked the files are marked as read only.

When trying to use fixup_bundle with a dylib in the perforce depot it fails, as it copies the files from the source location into the .app bundle and preserves the read-only flag, so the call to install_name_tool fails.

Using Cmake 2.8.11.2.

Should this be considered a cmake bug?

Any ideas/suggestions in the short term for a workaround?

Thanks,
Neil

--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake
Reply | Threaded
Open this post in threaded view
|

Re: fixup_bundle fails for read-only .dylib files

Neil Williams
Hello,

I have found a reasonable workaround, override the call to fixup_bundle_item (called by fixup_bundle) and mark the file as writable:

install(CODE "
    INCLUDE (BundleUtilities)

    macro (fixup_bundle_item resolved_embedded_item exepath dirs)
        message (\"Making writable: \${resolved_embedded_item}\")
        execute_process (COMMAND chmod +w \${resolved_embedded_item})
        _fixup_bundle_item (\${resolved_embedded_item} \${exepath} \${dirs})
    endmacro()

    COPY_AND_FIXUP_BUNDLE (${CMAKE_INSTALL_PREFIX}/test.app ${CMAKE_INSTALL_PREFIX}/test2.app \"\" \"${LIBRARY_DIRECTORIES}\")
    "
    COMPONENT Runtime )

Hope this helps any future readers.

Thanks,
Neil

On Thu, Feb 2, 2017 at 11:12 AM, Neil Williams <[hidden email]> wrote:
Hello,

We use perforce for our source control system, which has a typical configuration where files need to be explicitly checked out prior to them being changed. If they are not checked the files are marked as read only.

When trying to use fixup_bundle with a dylib in the perforce depot it fails, as it copies the files from the source location into the .app bundle and preserves the read-only flag, so the call to install_name_tool fails.

Using Cmake 2.8.11.2.

Should this be considered a cmake bug?

Any ideas/suggestions in the short term for a workaround?

Thanks,
Neil


--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake