Commits

Shankar Giri committed cfd065b

Fixes to build scripts to successfully compile Ogitor on the Mac.

  • Participants
  • Parent commits 040c24d

Comments (0)

Files changed (6)

File CMakeLists.txt

         set(OGITOR_OGRE_PLUGIN_PATH "${OGRE_PLUGIN_DIR_LINUX}" CACHE PATH "Ogre plugins path" FORCE)
         set(OGITOR_LIBOGREOFSPLUGIN_PATH "${CMAKE_INSTALL_PREFIX}/lib" CACHE PATH "libOgreOfsPlugin path" FORCE)
     endif(OGITOR_DIST)
+	if (APPLE)
+	set(OGITOR_PLUGIN_ICON_PATH "../Plugins/Icons" CACHE PATH "Ogitor plugins icon path" FORCE)
+	endif(APPLE)
     configure_file(${CMAKE_CURRENT_SOURCE_DIR}/CMakeModules/Templates/plugins.cfg.in ${OGITOR_WORK_DIR}/RunPath/bin/plugins.cfg)
 else(UNIX)
     # We are on Windows

File Dependencies/ImageConverter/CMakeLists.txt

 
     ENDIF(UNIX AND NOT APPLE)
 
+IF (APPLE)
+        set_target_properties(ImageConverter PROPERTIES OUTPUT_NAME ImageConverter_Ogitor)
+        # Set the INSTALL_PATH so that Frameworks can be local
+        set_target_properties(ImageConverter PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Plugins/Ogitor")
+   ENDIF(APPLE)
+
+
 endif(NOT QT4_FOUND)
 
 # vim: set sw=2 ts=2 noet:

File Mac/plugins.cfg

 Plugin=libRenderSystem_GL
 Plugin=libPlugin_ParticleFX
 Plugin=libPlugin_OctreeSceneManager
+Plugin=libOgreOfsPlugin
 
 

File OgreOfsPlugin/CMakeLists.txt

 
 target_link_libraries(OgreOfsPlugin ${OGRE_LIBRARY} OFS ${Boost_LIBRARIES})
 
-if(APPLE)
-
-	# Setup to be a framework
-	set_target_properties(OgreOfsPlugin PROPERTIES FRAMEWORK TRUE)
-	set_target_properties(OgreOfsPlugin PROPERTIES PUBLIC_HEADER "${HEADER_FILES}")
-
-	# Framework is called 'OgreOfsPlugin'
-	set_target_properties(OgreOfsPlugin PROPERTIES OUTPUT_NAME OgreOfsPlugin)
-	# Set the INSTALL_PATH so that Frameworks can be local
-	set_target_properties(OgreOfsPlugin PROPERTIES BUILD_WITH_INSTALL_RPATH 1 INSTALL_NAME_DIR "@executable_path/../Frameworks")
-endif(APPLE)
-
 if(WIN32)
 	add_custom_command(TARGET OgreOfsPlugin PRE_BUILD
 		COMMAND if not exist ..\\RunPath\\bin mkdir ..\\RunPath\\bin)
 if (APPLE)
 	install(TARGETS OgreOfsPlugin
             LIBRARY DESTINATION lib
-            FRAMEWORK DESTINATION "~/Library/Frameworks"
             CONFIGURATIONS Release RelWithDebInfo MinSizeRel)
 endif(APPLE)
 

File RunPath/CMakeLists.txt

     endif(OGITOR_DIST)
 endif(UNIX)
 
+if (APPLE)
+	file(COPY Plugins/Icons DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/Plugins)
+endif(APPLE)
 # vim: set sw=2 ts=2 noet:

File qtOgitor/CMakeLists.txt

             file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/Ogitor/lib/Debug/Ogitor.framework")
         endif()
         set(COPY_FRAMEWORKS ${OGRE_LIBRARIES} ${Cg_LIBRARY_FWK} "${CMAKE_BINARY_DIR}/Ogitor/lib/Debug/Ogitor.framework")
-        set(COPY_RESOURCES "../../resources.cfg" "../../plugins.cfg" "${RUNPATH}/Media")
+        set(COPY_RESOURCES "../Mac/resources.cfg" "../Mac/plugins.cfg" "${RUNPATH}/Media")
         set(COPY_PLUGINS
             ${OGRE_RenderSystem_GL_LIBRARY_DBG}
             ${OGRE_Plugin_ParticleFX_LIBRARY_DBG}
         set(MakeBundle
             cp ${QtSolutions_PropertyBrowser_BINARY_DIR}/${CMAKE_CFG_INTDIR}/libQtSolutions_PropertyBrowser*.dylib ${OGRE_LIBRARIES}/../../libOgreTerrain*.dylib ${OGRE_LIBRARIES}/../../libOgrePaging*.dylib ${qtOgitorLocationAppdir}/Contents/Components && 
             cp ${OGRE_LIBRARIES}/../../libRenderSystem_GL*.dylib ${OGRE_LIBRARIES}/../../libPlugin_OctreeSceneManager*.dylib ${OGRE_LIBRARIES}/../../libPlugin_ParticleFX*.dylib ${OGRE_Plugin_CgProgramManager_LIBRARY_DBG} ${qtOgitorLocationAppdir}/Contents/Plugins && 
+            cp ../lib/${CMAKE_CFG_INTDIR}/libOgreOfsPlugin*.dylib ${qtOgitorLocationAppdir}/Contents/Plugins &&
             cp -r ${OGRE_LIBRARY} ${qtOgitorLocationAppdir}/Contents/Frameworks && 
-            cp -r ../lib/${CMAKE_CFG_INTDIR}/Ogitor.framework ../lib/${CMAKE_CFG_INTDIR}/OgreOFSPlugin.framework ${qtOgitorLocationAppdir}/Contents/Frameworks && 
-            cp ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgCaelum*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgHydrax*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgModularZone*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgSkyx*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libDotSceneSerializer*.dylib ../Dependencies/lib/libGenericTextEditor*.dylib ../Dependencies/lib/libGenericImageEditor*.dylib ../Dependencies/lib/libOFS*.dylib ${qtOgitorLocationAppdir}/Contents/Plugins/Ogitor && 
+            cp -r ../lib/${CMAKE_CFG_INTDIR}/Ogitor.framework ${qtOgitorLocationAppdir}/Contents/Frameworks && 
+            cp ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgCaelum*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgHydrax*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgModularZone*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libOgSkyx*.dylib ../Plugins/lib/${CMAKE_CFG_INTDIR}/libDotSceneSerializer*.dylib ../Dependencies/lib/libGenericTextEditor*.dylib ../Dependencies/lib/libImageConverter*.dylib ../Dependencies/lib/libGenericImageEditor*.dylib ../Dependencies/lib/libOFS*.dylib ${qtOgitorLocationAppdir}/Contents/Plugins/Ogitor && 
             cp -r ../../RunPath/Media ${qtOgitorLocationAppdir}/Contents/Resources && 
             cp -r ../../RunPath/Plugins/Icons ${qtOgitorLocationAppdir}/Contents/Plugins && 
             cp ../../Mac/plugins.cfg ../../Mac/resources.cfg ${qtOgitorLocationAppdir}/Contents/Resources
                 CONFIGURATIONS Release RelWithDebInfo MinSizeRel)
     endif(UNIX AND NOT APPLE)
 
-    if(UNIX AND NOT APPLE)
+    if(UNIX)
     
         if(OGITOR_DIST)
             install(
             PATTERN     "qt_*.qm"
             PATTERN     "ogitor_*.qm" EXCLUDE
         )
-    else(UNIX AND NOT APPLE)
+    elseif(WINDOWS)
         # ie Windows
         install(DIRECTORY ${CMAKE_SOURCE_DIR}/RunPath/languages
             DESTINATION ${PREFIX}
             PATTERN "*.exe" EXCLUDE
             PATTERN "*.bat" EXCLUDE
         )
-    endif(UNIX AND NOT APPLE)
+    endif(UNIX)
 
     if(WIN32)
         set(QT_DLL_DIR ${QT_BINARY_DIR})