summaryrefslogtreecommitdiffstats
path: root/Tests/QtAutogen/automoc_rerun/CMakeLists.txt
blob: 92a682baf55c5421956b3cbf9b57c44312c510d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
cmake_minimum_required(VERSION 3.7)
project(automoc_rerun CXX)

if (QT_TEST_VERSION STREQUAL 4)
  find_package(Qt4 REQUIRED)
  set(QT_CORE_TARGET Qt4::QtCore)
else()
  if (NOT QT_TEST_VERSION STREQUAL 5)
    message(SEND_ERROR "Invalid Qt version specified.")
  endif()

  find_package(Qt5Core REQUIRED)
  set(QT_CORE_TARGET Qt5::Core)
endif()

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)

configure_file(test1.h.in1 test1.h COPYONLY)

add_executable(test1
  ${CMAKE_CURRENT_BINARY_DIR}/test1.h
  test1.cpp
  res1.qrc
  )
target_include_directories(test1 PRIVATE ${CMAKE_CURRENT_BINARY_DIR})
target_link_libraries(test1 ${QT_CORE_TARGET})