<div dir="ltr">Hello everyone,<div><br></div><div>I try to install a bundle application on macOS.</div><div><br></div><div>I successfully create the bundle and add all dependencies to Qt event the plugin platform libqcocoa.dylib.</div><div><br></div><div>Unfortunately, when I launch the installed app, the window style is not the same as the build app style (macOS) as you can see on the joined screenshots.</div><div><br></div><div>The CMakeLists.txt script is (too?) simple:</div><div><br></div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:Menlo,Monaco,"Courier New",monospace;font-size:12px;line-height:18px;white-space:pre"><div><span style="color:rgb(86,156,214)">cmake_minimum_required</span>(VERSION 3.2 FATAL_ERROR)</div><br><div><span style="color:rgb(86,156,214)">project</span>(testProj)</div><br><div><span style="color:rgb(86,156,214)">set</span>(<span style="color:rgb(156,220,254)">CMAKE_MODULE_PATH</span> <span style="color:rgb(86,156,214)">${CMAKE_MODULE_PATH}</span> <span style="color:rgb(86,156,214)">${CMAKE_CURRENT_SOURCE_DIR}</span>)</div><br><div><span style="color:rgb(86,156,214)">set</span>(<span style="color:rgb(156,220,254)">CMAKE_AUTOMOC</span> <span style="color:rgb(86,156,214)">ON</span>)</div><div><span style="color:rgb(86,156,214)">set</span>(CMAKE_AUTOUIC_SEARCH_PATHS <span style="color:rgb(86,156,214)">${CMAKE_CURRENT_SOURCE_DIR}</span>/ui)</div><div><span style="color:rgb(86,156,214)">set</span>(CMAKE_AUTOUIC <span style="color:rgb(86,156,214)">ON</span>)</div><div><span style="color:rgb(86,156,214)">set</span>(CMAKE_AUTORCC <span style="color:rgb(86,156,214)">ON</span>)</div><br><div><span style="color:rgb(86,156,214)">find_package</span>(Qt5Core REQUIRED)</div><div><span style="color:rgb(86,156,214)">find_package</span>(Qt5Widgets REQUIRED)</div><br><div><span style="color:rgb(86,156,214)">get_target_property</span>(QtCore_location Qt5::Core LOCATION)</div><div><span style="color:rgb(86,156,214)">get_target_property</span>(QtWidgets_location Qt5::Widgets LOCATION)</div><br><div><span style="color:rgb(86,156,214)">include_directories</span>(<span style="color:rgb(86,156,214)">${QtCore_location}</span> <span style="color:rgb(86,156,214)">${QtWidgets_location}</span>)</div><br><div><span style="color:rgb(86,156,214)">add_executable</span>(<span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> <span style="color:rgb(156,220,254)">MACOSX_BUNDLE</span> main.cpp MainWindow.cpp MainWindow.hpp MainWindow.ui)</div><div><span style="color:rgb(86,156,214)">set_target_properties</span>(<span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> PROPERTIES</div><div>        CXX_STANDARD 14</div><div>        CXX_STANDARD_REQUIRED YES</div><div>        CXX_EXTENSIONS NO)</div><br><div><span style="color:rgb(86,156,214)">install</span>(TARGETS <span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> DESTINATION <span style="color:rgb(206,145,120)">"."</span>)</div><br><div><span style="color:rgb(86,156,214)">target_link_libraries</span>(<span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> Qt5::Widgets)</div><br><div><span style="color:rgb(86,156,214)">set_target_properties</span>(<span style="color:rgb(86,156,214)">${PROJECT_NAME}</span></div><div>PROPERTIES</div><div>MACOSX_BUNDLE_BUNDLE_NAME <span style="color:rgb(206,145,120)">"${PROJECT_NAME}"</span></div><div>)</div><br><div><span style="color:rgb(86,156,214)">include</span>(InstallRequiredSystemLibraries)</div><div><span style="color:rgb(86,156,214)">include</span>(DeployQt5)</div><br><div><span style="color:rgb(86,156,214)">get_target_property</span>(build_dir <span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> BINARY_DIR)</div><div><span style="color:rgb(86,156,214)">get_target_property</span>(target_name <span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> <span style="color:rgb(86,156,214)">NAME</span>)</div><div><span style="color:rgb(86,156,214)">get_target_property</span>(isbundle <span style="color:rgb(86,156,214)">${PROJECT_NAME}</span> <span style="color:rgb(156,220,254)">MACOSX_BUNDLE</span>)</div><br><div><span style="color:rgb(86,156,214)">get_filename_component</span>(qt_dlls_dir <span style="color:rgb(206,145,120)">"${QtWidgets_location}"</span> <span style="color:rgb(86,156,214)">PATH</span>)</div><div><span style="color:rgb(86,156,214)">get_filename_component</span>(qt_dlls_dir <span style="color:rgb(206,145,120)">"${qt_dlls_dir}"</span> <span style="color:rgb(86,156,214)">PATH</span>)</div><div><span style="color:rgb(86,156,214)">set</span>(dirs <span style="color:rgb(206,145,120)">"${qt_dlls_dir}"</span>)</div><br><div><span style="color:rgb(86,156,214)">if</span>(WIN32)</div><div><span style="color:rgb(86,156,214)">    set</span>(suffix <span style="color:rgb(206,145,120)">".exe"</span>)</div><div><span style="color:rgb(86,156,214)">endif</span>()</div><br><div><span style="color:rgb(86,156,214)">if</span> (<span style="color:rgb(86,156,214)">${isbundle}</span>)</div><div><span style="color:rgb(86,156,214)">    set</span>(exe <span style="color:rgb(86,156,214)">${target_name}</span>.app)</div><div><span style="color:rgb(86,156,214)">else</span>()</div><div><span style="color:rgb(86,156,214)">    set</span>(exe <span style="color:rgb(86,156,214)">${target_name}${suffix}</span>)</div><div><span style="color:rgb(86,156,214)">endif</span>()</div><br><div>install_qt5_executable(<span style="color:rgb(86,156,214)">${exe}</span> <span style="color:rgb(206,145,120)">""</span> <span style="color:rgb(206,145,120)">""</span> <span style="color:rgb(206,145,120)">"${dirs}"</span> <span style="color:rgb(206,145,120)">""</span> <span style="color:rgb(206,145,120)">""</span>)</div></div></div><div><br></div><div>I don't understand why the plugin libqcocoa.dylib is not used for the installed app.</div><div><br></div><div>I try to read the CMake script available (such as Paraview or Slicer3D), but it's a little too much time consuming. </div><div><br></div><div>Is there some simple example available?</div><div><br></div><div>Thank you,</div><div><br></div><div>Romain</div><div><br></div></div>