2017-07-12 3 views
0

J'utilise actuellement CMake pour créer une application Mac. Je peux définir un certain nombre de fichiers Info.plist avec des commandes comme celle-ci:Comment puis-je définir NSHighResolutionCapable dans Info.plist via CMake?

SET(MACOSX_BUNDLE_LONG_VERSION_STRING ${MYAPP_VERSION}) 

Je voudrais mettre NSHighResolutionCapable dans mon fichier Info.plist. Malheureusement, il n'y a pas une propriété comme MACOSX_BUNDLE_HIGH_RESOLUTION_CAPABLE. Comment puis-je définir cette valeur Info.plist par programmation avec CMake?

+0

Voir cette question: https://stackoverflow.com/questions/1792632/how-to-add-an-extra-plist-property-using-cmake –

Répondre

1

Vous ne pouvez pas. Vous ne pouvez éditer à partir de CMake que quelques propriétés Info.plist. Show here. Mais vous pouvez fournir votre propre modèle Info.plist pour vos bundles OSX dans CMake. Here's le code que j'utilise:

 
function(osxBundle bundleName subDirList dependList) 

    processTarget("${bundleName}" APPLE_BUNDLE "${subDirList}" "${dependList}") 

    # Info.plist configure 
    # Proyect provides its own Info.plist? 
    if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) 
     set_target_properties(${bundleName} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/Info.plist) 
    # Use default template 
    else() 
     set_target_properties(${bundleName} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_SCRIPTS_PATH}/Info.plist) 
    endif() 

    # Overwrite some properties (not used yet) 
    # MACOSX_BUNDLE_BUNDLE_NAME 
    # MACOSX_BUNDLE_BUNDLE_VERSION 
    # MACOSX_BUNDLE_COPYRIGHT 
    # MACOSX_BUNDLE_GUI_IDENTIFIER 
    # set_target_properties(${bundleName} PROPERTIES MACOSX_BUNDLE_ICON_FILE logo.icns) 
    # MACOSX_BUNDLE_INFO_STRING 
    # MACOSX_BUNDLE_LONG_VERSION_STRING 
    # MACOSX_BUNDLE_SHORT_VERSION_STRING 

    target_link_libraries(${bundleName} ${COCOA_LIB}) 

endfunction()