1 cmake_minimum_required(VERSION 3.16)
3 include("../AutogenCoreTest.cmake")
5 set(CMAKE_INCLUDE_CURRENT_DIR ON)
8 # Object library a defined in a subdirectory
11 # Object library b defined locally
12 include_directories(b)
13 add_library(b OBJECT b/classb.cpp)
14 target_link_libraries(b PRIVATE ${QT_LIBRARIES})
16 # Executable with OBJECT library generator expressions
17 add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>)
18 target_link_libraries(someProgram ${QT_LIBRARIES})
20 # Executable without its own AUTOMOC.
21 add_executable(someProgram2 main.cpp)
22 target_link_libraries(someProgram2 PRIVATE a b ${QT_LIBRARIES})
23 set_property(TARGET someProgram2 PROPERTY AUTOMOC OFF)