mirror of
				https://github.com/OpenMW/openmw.git
				synced 2025-11-03 23:56:43 +00:00 
			
		
		
		
	OS X: Ogre plugins are now installed in OpenCS bundle too. Generalized
plugin install routine.
This commit is contained in:
		
							parent
							
								
									874ecee079
								
							
						
					
					
						commit
						73c6aba4d0
					
				
					 1 changed files with 22 additions and 9 deletions
				
			
		| 
						 | 
					@ -689,9 +689,9 @@ if (APPLE)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set(OPENMW_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
 | 
					    set(OPENMW_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set(OPENCS_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/OpenCS.app")
 | 
					    set(OPENCS_BUNDLE_NAME "OpenCS.app")
 | 
				
			||||||
 | 
					    set(OPENCS_APP "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${OPENCS_BUNDLE_NAME}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set(PLUGINS "")
 | 
					 | 
				
			||||||
    set(ABSOLUTE_PLUGINS "")
 | 
					    set(ABSOLUTE_PLUGINS "")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    foreach (PLUGIN ${USED_OGRE_PLUGINS})
 | 
					    foreach (PLUGIN ${USED_OGRE_PLUGINS})
 | 
				
			||||||
| 
						 | 
					@ -699,12 +699,25 @@ if (APPLE)
 | 
				
			||||||
        set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
 | 
					        set(ABSOLUTE_PLUGINS ${PLUGIN_ABS} ${ABSOLUTE_PLUGINS})
 | 
				
			||||||
    endforeach ()
 | 
					    endforeach ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    set(PLUGIN_INSTALL_BASE "\${CMAKE_INSTALL_PREFIX}/${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}/Contents/Plugins")
 | 
					    # installs used plugins in bundle at given path (bundle_path must be relative to ${CMAKE_INSTALL_PREFIX})
 | 
				
			||||||
    install(FILES ${ABSOLUTE_PLUGINS} DESTINATION "${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}/Contents/Plugins" COMPONENT Runtime)
 | 
					    # and returns list of install paths for all installed plugins
 | 
				
			||||||
    foreach (PLUGIN ${ABSOLUTE_PLUGINS})
 | 
					    function (install_plugins_for_bundle bundle_path plugins_var)
 | 
				
			||||||
        get_filename_component(PLUGIN_RELATIVE ${PLUGIN} NAME)
 | 
					        set(RELATIVE_PLUGIN_INSTALL_BASE "${bundle_path}/Contents/Plugins")
 | 
				
			||||||
        set(PLUGINS ${PLUGINS} "${PLUGIN_INSTALL_BASE}/${PLUGIN_RELATIVE}")
 | 
					        install(FILES ${ABSOLUTE_PLUGINS} DESTINATION ${RELATIVE_PLUGIN_INSTALL_BASE} COMPONENT Runtime)
 | 
				
			||||||
    endforeach ()
 | 
					
 | 
				
			||||||
 | 
					        set(PLUGINS "")
 | 
				
			||||||
 | 
					        set(PLUGIN_INSTALL_BASE "\${CMAKE_INSTALL_PREFIX}/${RELATIVE_PLUGIN_INSTALL_BASE}")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        foreach (PLUGIN ${ABSOLUTE_PLUGINS})
 | 
				
			||||||
 | 
					            get_filename_component(PLUGIN_RELATIVE ${PLUGIN} NAME)
 | 
				
			||||||
 | 
					            set(PLUGINS ${PLUGINS} "${PLUGIN_INSTALL_BASE}/${PLUGIN_RELATIVE}")
 | 
				
			||||||
 | 
					        endforeach ()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        set(${plugins_var} ${PLUGINS} PARENT_SCOPE)
 | 
				
			||||||
 | 
					    endfunction (install_plugins_for_bundle)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    install_plugins_for_bundle("${INSTALL_SUBDIR}/${APP_BUNDLE_NAME}" PLUGINS)
 | 
				
			||||||
 | 
					    install_plugins_for_bundle("${INSTALL_SUBDIR}/${OPENCS_BUNDLE_NAME}" OPENCS_PLUGINS)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    #For now, search unresolved dependencies only in default system paths, so if you put unresolveable (i.e. with @executable_path in id name) lib or framework somewhere else, it would fail
 | 
					    #For now, search unresolved dependencies only in default system paths, so if you put unresolveable (i.e. with @executable_path in id name) lib or framework somewhere else, it would fail
 | 
				
			||||||
    set(DIRS "")
 | 
					    set(DIRS "")
 | 
				
			||||||
| 
						 | 
					@ -752,7 +765,7 @@ if (APPLE)
 | 
				
			||||||
        set(BU_CHMOD_BUNDLE_ITEMS ON)
 | 
					        set(BU_CHMOD_BUNDLE_ITEMS ON)
 | 
				
			||||||
        include(BundleUtilities)
 | 
					        include(BundleUtilities)
 | 
				
			||||||
        fixup_bundle(\"${OPENMW_APP}\" \"${PLUGINS}\" \"${DIRS}\")
 | 
					        fixup_bundle(\"${OPENMW_APP}\" \"${PLUGINS}\" \"${DIRS}\")
 | 
				
			||||||
        fixup_bundle(\"${OPENCS_APP}\" \"\" \"${DIRS}\")
 | 
					        fixup_bundle(\"${OPENCS_APP}\" \"${OPENCS_PLUGINS}\" \"${DIRS}\")
 | 
				
			||||||
        " COMPONENT Runtime)
 | 
					        " COMPONENT Runtime)
 | 
				
			||||||
        include(CPack)
 | 
					        include(CPack)
 | 
				
			||||||
endif (APPLE)
 | 
					endif (APPLE)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue