https://github.com/Kitware/CMake
Raw File
Tip revision: 44b8937b7614560d9e88d25456c8394b4b209d51 authored by Brad King on 05 February 2020, 14:19:24 UTC
CMake 3.16.4
Tip revision: 44b8937
CMakeLists.txt
cmake_minimum_required(VERSION 3.10)
project(MocOnly)
include("../AutogenCoreTest.cmake")

add_executable(mocOnly
  main.cpp
  # Test different Q_OBJECT position styles
  StyleA.cpp
  StyleB.cpp
  # Test different moc_/.moc include positions
  IncA.cpp
  IncB.cpp
)
set_property(TARGET mocOnly PROPERTY AUTOMOC ON)
target_link_libraries(mocOnly ${QT_LIBRARIES})
# Add compile definitions with unusual characters
target_compile_definitions(mocOnly PUBLIC "TOKEN=\"hello\;\"" )
back to top