You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
873 B

cmake_minimum_required(VERSION 3.16)
project(MocBasic)
include("../../AutogenCoreTest.cmake")
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
# Generated source file
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
COMMAND ${CMAKE_COMMAND} -E sleep 2
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp.in ${CMAKE_CURRENT_BINARY_DIR}/main.cpp
)
add_executable(mocBasic
${CMAKE_CURRENT_BINARY_DIR}/test1.h
${CMAKE_CURRENT_BINARY_DIR}/myobject3.h
${CMAKE_CURRENT_BINARY_DIR}/main.cpp
plainobject.cpp
res1.qrc
)
target_include_directories(mocBasic PRIVATE
${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}
)
target_link_libraries(mocBasic ${QT_QTCORE_TARGET})
# Write target name to text file
add_custom_command(TARGET mocBasic POST_BUILD COMMAND
${CMAKE_COMMAND} -E echo "$<TARGET_FILE:mocBasic>" > mocBasic.txt
)