[CMake] OS X Info.plist with POSIX executables and libraries (no app/framework bundles)

René J.V. Bertin rjvbertin at gmail.com
Wed Sep 14 09:09:44 EDT 2016


Hi,

I'd like to do something like

set_target_properties(foo PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/MacOSXBundleInfo.plist.in)
set_target_properties(foo PROPERTIES MACOSX_BUNDLE_GUI_IDENTIFIER "org.bar.foo")
# etc

for an application that will not be an app bundle but a regular POSIX executable. The resulting Info.plist can easily be included in the executable by

target_link_libraries(foo "-sectcreate __TEXT __info_plist ${CMAKE_CURRENT_BINARY_DIR}/Info.plist")

but the template Info.plist isn't processed at all.

What's the best way to replace the above standard sequence of Info.plist set-up commands to obtain a preprocessed Info.plist that has the correct values substituted for the variables in the template?

Thanks,
René


More information about the CMake mailing list