+ if(APPLE)
+ # Now that lyx executable is defined, we can the files that should be included
+ # directly in the bundle. Note that resources are not copied with this mechanism:
+ # only the files necessary to run the executable are processed here (LyX.sdef, LyX.icns, etc.)
+ list(LENGTH OSX_BUNDLE_FILES OSX_BUNDLE_LAST_INDEX)
+ math(EXPR OSX_BUNDLE_LAST_INDEX "${OSX_BUNDLE_LAST_INDEX} - 1")
+ foreach(_i RANGE ${OSX_BUNDLE_LAST_INDEX})
+ list(GET OSX_BUNDLE_FILES ${_i} _file)
+ list(GET OSX_BUNDLE_DIRS ${_i} _directory)
+ # Sets the location of the file into the OS X bundle
+ set_source_files_properties("${_file}" PROPERTIES MACOSX_PACKAGE_LOCATION "${_directory}")
+ endforeach()
+