mirror of
https://github.com/Kitware/CMake.git
synced 2026-04-30 11:10:06 -05:00
2ef640819f
Some AUTOGEN tests require the Qt core libraries only and some require the Qt gui libraries to function. This replaces the AutogenTest.cmake script with two specific AutogenCoreTest.cmake and AutogenGuiTest.cmake scripts that are included on demand.
19 lines
555 B
CMake
19 lines
555 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(ObjectLibrary)
|
|
include("../AutogenCoreTest.cmake")
|
|
|
|
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
|
set(CMAKE_AUTOMOC ON)
|
|
|
|
# Object library a defined in a subdirectory
|
|
add_subdirectory(a)
|
|
|
|
# Object library b defined locally
|
|
include_directories(b)
|
|
add_library(b OBJECT b/classb.cpp)
|
|
target_compile_features(b PRIVATE ${QT_COMPILE_FEATURES})
|
|
|
|
# Executable with OBJECT library generator expressions
|
|
add_executable(someProgram main.cpp $<TARGET_OBJECTS:a> $<TARGET_OBJECTS:b>)
|
|
target_link_libraries(someProgram ${QT_LIBRARIES})
|