summaryrefslogtreecommitdiffstats
path: root/Tests/RunCMake/Autogen/MocGeneratedFile.cmake
blob: 7bb55e97688bab11786f7d9416bbaf3b66b89c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
enable_language(CXX)

find_package(Qt${with_qt_version} REQUIRED COMPONENTS Core)

set(CMAKE_AUTOMOC ON)

set(GEN_SRC "class_$<CONFIG>.cpp")
add_custom_command(
  OUTPUT "${GEN_SRC}"
  COMMAND ${CMAKE_COMMAND} -E echo "// cpp src" > "${GEN_SRC}"
  VERBATIM
)

add_library(libgen STATIC ${GEN_SRC})
target_link_libraries(libgen Qt${with_qt_version}::Core)