Skip to content

Instantly share code, notes, and snippets.

@ruohola
Created June 8, 2019 18:12
Show Gist options
  • Save ruohola/9d85d1e2b2796c307cc4e4dfc5c66d6f to your computer and use it in GitHub Desktop.
Save ruohola/9d85d1e2b2796c307cc4e4dfc5c66d6f to your computer and use it in GitHub Desktop.
CMakeList for running Qt project in CLion
cmake_minimum_required(VERSION 3.14)
project(projectname)
set(CMAKE_CXX_STANDARD 17)
# Needed for Qt
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
include_directories(.)
add_executable(projectname
main.cpp
MainWindow.cpp
MainWindow.h)
# Needed for Qt
list(APPEND CMAKE_PREFIX_PATH "/Users/eero/Qt/5.12.3/clang_64/lib/cmake")
find_package(Qt5Widgets REQUIRED)
target_link_libraries(projectname Qt5::Widgets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment