Skip to content

Instantly share code, notes, and snippets.

@meetingcpp
Created February 27, 2016 22:33
Show Gist options
  • Select an option

  • Save meetingcpp/1a8007ca08bf1668bccc to your computer and use it in GitHub Desktop.

Select an option

Save meetingcpp/1a8007ca08bf1668bccc to your computer and use it in GitHub Desktop.
qt cmake (first try)
cmake_minimum_required(VERSION 2.8.11)
project(cmakeqttest)
# Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
# Instruct CMake to run moc automatically when needed.
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
add_definitions( -std=c++11 -ftemplate-depth=512 -Wno-unused-local-typedefs -Wno-deprecated-declarations )
endif()
# Find the QtWidgets library
find_package(Qt5Widgets)
aux_source_directory(. SRC_LIST)
add_executable(${PROJECT_NAME} ${SRC_LIST})
# Use the Widgets module from Qt 5.
target_link_libraries(${PROJECT_NAME} Qt5::Widgets)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment