CMake/Tests/RunCMake/ObjectLibrary/Import.cmake
Robert Maynard eec93bceec Allow OBJECT libraries to be installed, exported, and imported
Teach install() and export() to handle the actual object files.
Disallow this on Xcode with multiple architectures because it
still cannot be cleanly supported there.

Co-Author: Brad King <brad.king@kitware.com>
2017-04-18 11:36:10 -04:00

13 lines
434 B
CMake

add_library(A OBJECT IMPORTED)
# We don't actually build this example so just configure dummy
# object files to test. They do not have to exist.
set_property(TARGET A APPEND PROPERTY IMPORTED_CONFIGURATIONS DEBUG)
set_target_properties(A PROPERTIES
IMPORTED_OBJECTS_DEBUG "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o"
IMPORTED_OBJECTS "${CMAKE_CURRENT_BINARY_DIR}/does_not_exist.o"
)
add_library(B $<TARGET_OBJECTS:A> b.c)