The following issue has been SUBMITTED. 
====================================================================== 
http://public.kitware.com/Bug/view.php?id=14854 
====================================================================== 
Reported By:                Petr Lefner
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   14854
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2014-03-31 12:53 EDT
Last Modified:              2014-03-31 12:53 EDT
====================================================================== 
Summary:                    Xcode projects with binary files cannot load in
Xcode
Description: 
If an project lists some binary files, CMake generator creates .pbxproject where
htese files are listed as 'source files', which causes Xocde unable* to load
that project.

* depends on total file size or amount; say that 300MB makes it about 1 hour
until Xcode can be used. Until that, hourglass and 200% CPU drain suggest heavy
background thinking about he files.

If those file are not listed in project, Xcode opens it like a charm.

Steps to Reproduce: 
Create a CMakeLists.txt with usual structure to have some binary target in
there.
Then add some binary files (assets or resources), let say we have them within
the DATA_FILES list variable (full paths). 
Intention is to get those files into app bundle (.app/). For this case, do not
consider that to put into .app, a small hack must be achieved.

# Collect resource files

foreach(FILE ${DATA_FILES})
    set_source_files_properties(
        ${FILE}
        PROPERTIES
        MACOSX_PACKAGE_LOCATION ${MACOSX_BUNDLE_BUNDLE_NAME}.app/${TARGET}
        GENERATED TRUE
    )
    list(APPEND ASSETS ${FILE})
endforeach()

# Add binary target and register resoruce files in project listings
add_executable(osx_app_target MACOSX_BUNDLE ${SOURCES} ${ASSETS})


Additional Information: 
Given method worked prior 2.8.12 (not sure exactly about problem version).
There's same issue if one wants to copy files via a custom command: 

# Copy from SRC to DST, being part of current target. 
add_custom_command(OUTPUT ${DST}
    COMMAND ${CMAKE_COMMAND} -E copy ${SRC} ${DST}
    MAIN_DEPENDENCY ${SRC}
    COMMENT "Copying ${SRC} to ${DST}")

This used to do same troubles even already prior 2.8.12


In case of further assistance, do not hesitate to ask for more information. If
htere's a new way adding resources to MACOSX_BUNDLE target (into .app), I did
not found it - please point me out. 
====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2014-03-31 12:53 Petr Lefner    New Issue                                    
======================================================================

-- 

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/cgi-bin/mailman/listinfo/cmake-developers

Reply via email to