mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-13 18:49:38 -06:00
Previously we would synthesize <TARGET_NAME>-NOTFOUND as the location. This would then end up on the link line and cause build failures. Policy CMP0110 is added to control this behaviour. Fixes #19080, #19943.
12 lines
434 B
CMake
12 lines
434 B
CMake
enable_language(C)
|
|
set(CMAKE_LINK_DEPENDENT_LIBRARY_DIRS 1)
|
|
set(CMAKE_SHARED_LIBRARY_SUFFIX ".so")
|
|
add_library(imported SHARED IMPORTED)
|
|
set_target_properties(imported PROPERTIES
|
|
IMPORTED_LOCATION "imported${CMAKE_SHARED_LIBRARY_SUFFIX}"
|
|
IMPORTED_IMPLIB "imported${CMAKE_IMPORT_LIBRARY_SUFFIX}"
|
|
IMPORTED_LINK_DEPENDENT_LIBRARIES "/path/to/libSharedDep.so"
|
|
)
|
|
add_executable(empty empty.c)
|
|
target_link_libraries(empty imported)
|