default.txt 528 B

12345678910111213141516171819
  1. cmake_minimum_required(VERSION 2.8.8)
  2. project(cmake_example)
  3. # Show message on Linux platform
  4. if (${CMAKE_SYSTEM_NAME} MATCHES Linux)
  5. message("Good choice, bro!")
  6. endif()
  7. # Tell CMake to run moc when necessary:
  8. set(CMAKE_AUTOMOC ON)
  9. # As moc files are generated in the binary dir,
  10. # tell CMake to always look for includes there:
  11. set(CMAKE_INCLUDE_CURRENT_DIR ON)
  12. # Widgets finds its own dependencies.
  13. find_package(Qt5Widgets REQUIRED)
  14. add_executable(myproject main.cpp mainwindow.cpp)
  15. qt5_use_modules(myproject Widgets)