View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014786CMakeCMakepublic2014-03-05 08:062016-06-10 14:31
ReporterPhilipp Möller 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformLinuxOSArch LinuxOS Version
Product VersionCMake 2.8.12.2 
Target VersionCMake 3.0Fixed in Version 
Summary0014786: Imported targets always require an IMPORTED_LOCATION
DescriptionWhen creating an imported target "importtarget" and not setting the IMPORTED_LOCATION property, targets linking against the imported target will have a dependency on importtarget-NOTFOUND, making it impossible to build.

A common use case is to manually create imported targets from the result of a find_package call for easy reference to the dependency in various places in the build system. Some libraries (like core Boost, Eigen) don't have any libraries.
Steps To ReproduceUse:

cmake_minimum_required(VERSION 2.8)
project(Foo)

add_executable(main main.cpp)

add_library(Header_only_lib IMPORTED)
set_target_properties(${lib} PROPERTIES
  INTERFACE_INCLUDE_DIRECTORIES "/usr/include/my_lib"
  )
target_link_libraries(main Header_only_lib)

cmake .
make main # boom
Additional InformationAFAIK this is going to be resolved with add_library(foo INTERFACE IMPORTED), but a work-around for earlier CMake versions would be much appreciated.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0035303)
Brad King (manager)
2014-03-05 11:40

Correct, the INTERFACE library type is introduced in CMake 3.0.0-rc1 which has now been released. I do not think there is a work-around for older versions. The requirement for IMPORTED_LOCATION was by-design for non-INTERFACE imported targets.
(0042497)
Kitware Robot (administrator)
2016-06-10 14:29

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2014-03-05 08:06 Philipp Möller New Issue
2014-03-05 11:40 Brad King Note Added: 0035303
2014-03-05 11:40 Brad King Status new => acknowledged
2014-03-05 11:40 Brad King Resolution open => fixed
2014-03-05 11:40 Brad King Fixed in Version => CMake 3.0
2014-03-05 11:40 Brad King Target Version => CMake 3.0
2016-06-10 14:29 Kitware Robot Note Added: 0042497
2016-06-10 14:29 Kitware Robot Status acknowledged => resolved
2016-06-10 14:29 Kitware Robot Fixed in Version CMake 3.0 =>
2016-06-10 14:29 Kitware Robot Resolution fixed => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team