Hi,

I created simple hello world with qt5 (5.6) using  cmake 3.5.2:

set(test_app_UIS mainwin.ui)
set(test_app_MOC_HDRS mainwin.hpp)
qt5_wrap_ui(test_app_UIS_H ${test_app_UIS})
qt5_wrap_cpp(test_app_MOC_SRCS ${test_app_MOC_HDRS})
add_executable(test_app ${test_app_UIS_H} ${test_app_MOC_SRCS}
${test_app_MOC_HDRS} mainwin.cpp main.cpp)
target_link_libraries(test_app Qt5::Widgets)

it builds and I  can run it, but there is strange bug:

after start I can not access menu, but if I give focus to another application,
and then return back to test_app it is possible to open menu.

I build the same application with qmake and bug disappear.

the difference was how qmake and cmake place executables inside build directory:

qmake put binary inside test_app.app directory, with content like:
Info.plist MacOS PkgInfo Resources

cmake put binary in the same way as on linux - just binary test_app

So, to work with cmake + qt on mac I have write some special cmake
with pre_build hook to generate suitable structure? Or there is more
convenient way to resolve this problem?
-- 

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

Reply via email to