View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014636CMakeCMakepublic2013-12-07 04:422014-06-02 08:37
ReporterKiron 
Assigned ToStephen Kelly 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake 2.8.12 
Target VersionFixed in VersionCMake 3.0 
Summary0014636: Error with whitelisted properties and generator expression in target_link_libraries
DescriptionWhen using target_link_libraries to link an INTERFACE IMPORTED library with an EXECUTABLE and the INTERFACE_LINK_LIBRARIES property of the library contains a generator expression, the following FATAL_ERROR is produced:

(See Steps To Reproduce for CMakeLists.txt)

>cmake .
-- Configuring done
CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION_RELEASE" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_CONFIGURATIONS" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION_MINSIZEREL" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_CONFIGURATIONS" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION_RELWITHDEBINFO" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_CONFIGURATIONS" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION_NOCONFIG" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_LOCATION" is not allowed.


CMake Error in CMakeLists.txt:
  INTERFACE_LIBRARY targets may only have whitelisted properties. The
  property "IMPORTED_CONFIGURATIONS" is not allowed.


-- Generating done
-- Build files have been written to: ...

When NOT using a generator expression in the INTERFACE_LINK_LIBRARIES property, no error is generated.

Additionally, the error message does not provide detailed information to track down this error.
Steps To ReproduceCreate a file CMakeLists.txt file with the following content:

------------------------------------------------------------------------------
cmake_minimum_required(VERSION 2.8.12.20131125 FATAL_ERROR)

project(GeneratorExpressionAndWhitelistedProperties C CXX)

set(_main_cpp ${CMAKE_CURRENT_BINARY_DIR}/main.cpp)
file(WRITE ${_main_cpp}
  "int main(int argc, char** argv) { return 0; }\n"
)

add_library(foo::bar INTERFACE IMPORTED)
set_target_properties(foo::bar
  PROPERTIES
    INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_CURRENT_SOURCE_DIR}"
    # When not using a generator expression here, no error is generated
    INTERFACE_LINK_LIBRARIES "$<$<NOT:$<CONFIG:DEBUG>>:foo_bar.lib>"
)

add_executable(main ${_main_cpp})
target_include_directories(main PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}")

target_link_libraries(main foo::bar)
------------------------------------------------------------------------------

Run cmake
Additional Informationcmake version 2.8.12.20131207-g6f6ee
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0034764)
Stephen Kelly (developer)
2013-12-09 13:36

Fixed:

 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=31ca983c5 [^]

Thanks for testing!
(0036054)
Robert Maynard (manager)
2014-06-02 08:37

Closing resolved issues that have not been updated in more than 4 months.

 Issue History
Date Modified Username Field Change
2013-12-07 04:42 Kiron New Issue
2013-12-07 10:33 Stephen Kelly Assigned To => Stephen Kelly
2013-12-07 10:33 Stephen Kelly Status new => assigned
2013-12-09 13:36 Stephen Kelly Note Added: 0034764
2013-12-09 13:36 Stephen Kelly Status assigned => resolved
2013-12-09 13:36 Stephen Kelly Fixed in Version => CMake 3.0
2013-12-09 13:36 Stephen Kelly Resolution open => fixed
2014-06-02 08:37 Robert Maynard Note Added: 0036054
2014-06-02 08:37 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team