Last active
July 28, 2018 18:00
-
-
Save Davidj361/8c16d53de0c66f8cf1a1abc3627c81a3 to your computer and use it in GitHub Desktop.
This file contains 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
cmake_minimum_required(VERSION 3.12.0) | |
project(HelloQt) | |
# Find includes in corresponding build directories | |
set(CMAKE_INCLUDE_CURRENT_DIR ON) | |
# Instruct CMake to run moc automatically when needed | |
set(CMAKE_AUTOMOC ON) | |
# Create code from a list of Qt designer ui files | |
set(CMAKE_AUTOUIC ON) | |
find_package(Qt5 REQUIRED COMPONENTS Core Widgets Gui) | |
set(project_ui | |
mainwindow.ui) | |
set(project_headers | |
mainwindow.h) | |
set(project_sources | |
main.cpp | |
mainwindow.cpp) | |
add_executable(${PROJECT_NAME} ${project_headers} ${project_sources} ${project_ui}) | |
# Use the widgets module from Qt 5 | |
target_link_libraries(${PROJECT_NAME} | |
PUBLIC | |
Qt5::Core | |
Qt5::Gui | |
Qt5::Widgets) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment