Commit c6b9982c authored by Thomaas Herault's avatar Thomaas Herault

Allow to create a Mac OS X bundle:

  - add a template info.plist
  - add the CMakeLists magic
  - add a fix on main.cpp: Finder passes an argument (-psn_%d_%d) to any bundled app, that Cocoa is supposed to remove, and Qt apparently does not remove. Remove it by hand until someone figures how to make Drag & Drop work with Mac OS X.
parent a1ce8895
......@@ -380,13 +380,30 @@ INCLUDE_DIRECTORIES(
${QTCOLORPICKERDIR}
)
#ADD_LIBRARY(vite2 SHARED ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
if( APPLE )
SET( OSX_ICON_FILES "interface/icon/mac_logo.icns")
set_source_files_properties(${OSX_ICON_FILES} PROPERTIES MACOSX_PACKAGE_LOCATION Resources)
ADD_EXECUTABLE(vite MACOSX_BUNDLE ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS} ${OSX_ICON_FILES})
SET_TARGET_PROPERTIES(vite PROPERTIES
MACOSX_BUNDLE_INFO_STRING "ViTE"
MACOSX_BUNDLE_ICON_FILE "mac_logo.icns"
MACOSX_BUNDLE_LONG_VERSION_STRING "Visual Trace Explorer - version ${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_NAME "Vite-MacOSX"
MACOSX_BUNDLE_SHORT_VERSION_STRING "ViTE-${VITE_VERSION_MAJOR}.${VITE_VERSION_MINOR}"
MACOSX_BUNDLE_BUNDLE_VERSION "1.0"
MACOSX_BUNDLE_COPYRIGHT "INRIA 2006-2012"
MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/vite-info.plist.in)
else( APPLE )
ADD_EXECUTABLE(vite ${VITE_SRCS} ${VITE_MOC} ${VITE_RCC_SRCS})
endif( APPLE )
TARGET_LINK_LIBRARIES(vite
${QT_LIBRARIES}
${GLU_LIBRARY}
${Boost_LIBRARIES}
)
IF(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
TARGET_LINK_LIBRARIES(vite
rt
......
......@@ -92,6 +92,21 @@ int main(int argc, char **argv) {
Q_INIT_RESOURCE(vite);
{
/* Mac OS X Application bundle:
* Remove the -psn_0_%d argument that Mac OS X passes to
* all bundled applications
*/
int i, k;
for(i = 0; i <= argc; i++) {
if( strncmp(argv[i], "-psn", 4) == 0 ) {
for(k = i+1; k <= argc; k++)
argv[k-1] = argv[k];
argc--;
}
}
}
Info::Render::_key_alt = false;/* no CTRL key pushed */
#ifdef VITE_DBG_MEMORY_TRACE
......
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${MACOSX_BUNDLE_EXECUTABLE_NAME}</string>
<key>CFBundleGetInfoString</key>
<string>${MACOSX_BUNDLE_INFO_STRING}</string>
<key>CFBundleIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleIdentifier</key>
<string>${MACOSX_BUNDLE_GUI_IDENTIFIER}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleLongVersionString</key>
<string>${MACOSX_BUNDLE_LONG_VERSION_STRING}</string>
<key>CFBundleName</key>
<string>${MACOSX_BUNDLE_BUNDLE_NAME}</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>${MACOSX_BUNDLE_SHORT_VERSION_STRING}</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>${MACOSX_BUNDLE_BUNDLE_VERSION}</string>
<key>CSResourcesFileMapped</key>
<true/>
<key>LSRequiresCarbon</key>
<true/>
<key>NSHumanReadableCopyright</key>
<string>${MACOSX_BUNDLE_COPYRIGHT}</string>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeExtensions</key>
<array>
<string>*.trace</string>
</array>
<key>CFBundleTypeIconFile</key>
<string>${MACOSX_BUNDLE_ICON_FILE}</string>
<key>CFBundleTypeName</key>
<string>Paje Trace File</string>
<key>CFBundleTypeRole</key>
<string>Viewer</string>
</dict>
</array>
</dict>
</plist>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment