MantisBT - CMake | |||||
View Issue Details | |||||
ID | Project | Category | View Status | Date Submitted | Last Update |
0008843 | CMake | CMake | public | 2009-04-06 07:37 | 2009-04-06 11:14 |
Reporter | Tobias Rudolph | ||||
Assigned To | Brad King | ||||
Priority | normal | Severity | major | Reproducibility | always |
Status | closed | Resolution | fixed | ||
Platform | OS | OS Version | |||
Product Version | CMake-2-6 | ||||
Target Version | Fixed in Version | ||||
Summary | 0008843: Imported targets that are linked transitively to parent projects are not resolved correctly | ||||
Description | I am trying to build a project containing several subprojects that are included via add_subdirectory. Now, here is an example demonstrating the problem: The test project contains the following CMakeLists.txt: ---- project( CMakeTest ) cmake_minimum_required( VERSION 2.6 ) add_subdirectory( foo ) include_directories( foo ) add_executable( TestApp main.cpp ) target_link_libraries( TestApp foo ) ---- The CMakeLists.txt of the subdirectory libFoo: ---- add_library( ImportedTarget SHARED IMPORTED ) set_target_properties( ImportedTarget PROPERTIES IMPORTED_LOCATION "/opt/local/lib/libz.dylib" ) add_library( foo SHARED foo.cpp ) target_link_libraries( foo ImportedTarget ) ---- According to the documentation, the imported target ("ImportedTarget") is only known within "foo" and its subdirectories. So, when I try to link 'TestApp', it fails because the linker is looking for 'ImportedTarget' rather than '/opt/local/lib/libz.dylib' due to transitive linking (I suspect). | ||||
Steps To Reproduce | |||||
Additional Information | example attached | ||||
Tags | No tags attached. | ||||
Relationships | |||||
Attached Files | CMake_transitive_linking.tar.gz (634) 2009-04-06 07:37 https://public.kitware.com/Bug/file/2153/CMake_transitive_linking.tar.gz | ||||
Issue History | |||||
Date Modified | Username | Field | Change | ||
2009-04-06 07:37 | Tobias Rudolph | New Issue | |||
2009-04-06 07:37 | Tobias Rudolph | File Added: CMake_transitive_linking.tar.gz | |||
2009-04-06 10:06 | Bill Hoffman | Status | new => assigned | ||
2009-04-06 10:06 | Bill Hoffman | Assigned To | => Brad King | ||
2009-04-06 10:10 | Alexandre Feblot | Note Added: 0015920 | |||
2009-04-06 10:22 | Brad King | Note Added: 0015925 | |||
2009-04-06 11:12 | Brad King | Note Added: 0015930 | |||
2009-04-06 11:14 | Brad King | Note Added: 0015931 | |||
2009-04-06 11:14 | Brad King | Status | assigned => closed | ||
2009-04-06 11:14 | Brad King | Resolution | open => fixed |
Notes | |||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|
||||
|
|||||
|
|