Dear all, I have generated a bundle for MacOS as follows:
if(APPLE) set(OS_BUNDLE MACOSX_BUNDLE) elseif(WIN32) set(OS_BUNDLE WIN32) endif() include_directories(${CMAKE_CURRENT_BINARY_DIR}) add_executable(FADTTSter ${OS_BUNDLE} ${FADTTS_src} ) target_link_libraries(FADTTSter ${QT_LIBRARIES} ${VTK_LIBRARIES}) #-------------------------------------------------------------------------------- # Install the QtTest application, on Apple, the bundle is at the root of the # install tree, and on other platforms it'll go into the bin directory. INSTALL(TARGETS FADTTSter DESTINATION . COMPONENT Runtime RUNTIME DESTINATION bin COMPONENT Runtime ) macro(install_qt5_plugin _qt_plugin_name _qt_plugins_var) get_target_property(_qt_plugin_path "${_qt_plugin_name}" LOCATION) if(EXISTS "${_qt_plugin_path}") get_filename_component(_qt_plugin_file "${_qt_plugin_path}" NAME) get_filename_component(_qt_plugin_type "${_qt_plugin_path}" PATH) get_filename_component(_qt_plugin_type "${_qt_plugin_type}" NAME) set(_qt_plugin_dest "${CMAKE_INSTALL_PREFIX}/FADTTSter.app/Contents/PlugIns/${_qt_plugin_type}") install(FILES "${_qt_plugin_path}" DESTINATION "${_qt_plugin_dest}" COMPONENT Runtime) set(${_qt_plugins_var} "${${_qt_plugins_var}};${_qt_plugin_dest}/${_qt_plugin_file}") else() message(FATAL_ERROR "QT plugin ${_qt_plugin_name} not found") endif() endmacro() install_qt5_plugin("Qt5::QCocoaIntegrationPlugin" QT_PLUGINS) #-------------------------------------------------------------------------------- # install a qt.conf file # this inserts some cmake code into the install script to write the file INSTALL(CODE " file(WRITE \"\${CMAKE_INSTALL_PREFIX}/${qtconf_dest_dir}/qt.conf\" \"[Paths]\nPlugins = PlugIns\n\") " COMPONENT Runtime) install(CODE " include(BundleUtilities) fixup_bundle(\"${APPS}\" \"${QT_PLUGINS};\" \"${QT_LIBRARY_DIR};${QT_BINARY_DIR};\") " COMPONENT Runtime) The bundle will not run if executed through finder or in command line as $ open FADTTSter.app. LSOpenURLsWithRole() failed with error -10810 for the file /path/to/FADTTSter.app However, if the executable inside FADTTSter.app/Contents/MacOS/FADTTSter is executed, the application works fine. Does any body knows how to solve this issue? Any help will be greatly appreciated. Best regards,
-- Powered by www.kitware.com Please keep messages on-topic and check the CMake FAQ at: http://www.cmake.org/Wiki/CMake_FAQ Kitware offers various services to support the CMake community. For more information on each offering, please visit: CMake Support: http://cmake.org/cmake/help/support.html CMake Consulting: http://cmake.org/cmake/help/consulting.html CMake Training Courses: http://cmake.org/cmake/help/training.html Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html Follow this link to subscribe/unsubscribe: http://public.kitware.com/mailman/listinfo/cmake