I have created a simple Qt application with only a MainWindow and a Button. When I build it in Qt using Qmake
it works fine and UI is good as well. On other hand if build it using CMake it works fine but application UI is blurry.
Could anybody please let me know how to fix it. Thank you.
UI of Application Generated with QMake
-
UI of Application Generated with
CMake
My CmakeList.txt
File
make_minimum_required(VERSION 3.0.2)
project(MyProject)
find_package(Qt5Widgets 5.9 PATHS /usr/local/Cellar/qt/5.9.1)
find_package(OpenGL)
#find_package(IOKit PATHS /System/Library/Frameworks/IOKit.framework/Versions/A)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
add_library(mainwindow mainwindow.cpp)
target_link_libraries (mainwindow Qt5::Widgets)
#set_target_properties(${PROJECT_NAME} PROPERTIES MACOSX_BUNDLE YES)
add_executable(MyProject MACOSX_BUNDLE main.cpp)
target_link_libraries (MyProject mainwindow ${OPENGL_gl_LIBRARY})
Project Structure-
My Machine Configuration-