Created
September 27, 2017 09:39
-
-
Save Trass3r/a4bf695e1eba4978b113d4652ebc5e2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # put generated files into a separate VS folder | |
| source_group("Generated Files" "(qrc_.+\\.cpp)|(.+_automoc\\.cpp)|(ui_.+\\.h)") | |
| # for finding generated headers in CMAKE_CURRENT_BINARY_DIR | |
| set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
| # run moc automatically when needed | |
| set(CMAKE_AUTOMOC ON) | |
| # imported targets are created for each Qt module | |
| find_package(Qt5Widgets) | |
| ##### create target ##### | |
| set(SRCs main.cpp mainwindow.cpp) | |
| set(HDRs mainwindow.h) | |
| set(UIs mainwindow.ui) | |
| set(RSCs projectname.qrc) | |
| # run uic and rcc | |
| qt5_wrap_ui(uiheaders ${UIs}) | |
| qt5_add_resources(rccfiles ${RSCs}) | |
| add_executable(ProjectName ${SRCs} ${HDRs} ${uiheaders} ${rccfiles}) | |
| target_link_libraries(ProjectName Qt5::Widgets) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment