MantisBT - CMake
View Issue Details
0014946CMakeCMakepublic2014-05-30 02:032015-01-05 08:38
Micha Renner 
Brad King 
normalminoralways
closedfixed 
LinuxUbuntu
 
CMake 3.0CMake 3.0 
0014946: Document build v. install values for INTERFACE_INCLUDE_DIRECTORIES
SET_TARGET_PROPERTIES(${TargetName} PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${CMAKE_SOURCE_DIR}/rot")
produces the following error message

gildemeister@iX4:~/work-c/ArchiveCMake/Beispiele/DLL/BuildDLL-40/TLib1/CMake$ make
-- CMake's build type is: Debug
-- Configuring done
CMake Error in CMakeLists.txt:
  Target "TLib1" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "/home/gildemeister/work-c/ArchiveCMake/Beispiele/DLL/BuildDLL-40/TLib1/src/rot"

  which is prefixed in the source directory.

-- Generating done

the generated make file works perfect.
No tags attached.
Issue History
2014-05-30 02:03Micha RennerNew Issue
2014-05-30 02:06Micha RennerNote Added: 0035969
2014-05-30 08:34Brad KingNote Added: 0035970
2014-06-02 08:08Micha RennerNote Added: 0035971
2014-06-02 10:46Brad KingNote Added: 0036098
2014-06-03 09:05Brad KingNote Added: 0036104
2014-06-03 09:06Brad KingAssigned To => Brad King
2014-06-03 09:06Brad KingStatusnew => resolved
2014-06-03 09:06Brad KingResolutionopen => fixed
2014-06-03 09:06Brad KingFixed in Version => CMake 3.0
2014-06-03 09:06Brad KingTarget Version => CMake 3.0
2014-06-03 09:06Brad KingSummaryStrange error message with INTERFACE_INCLUDE_DIRECTORIES => Document build v. install values for INTERFACE_INCLUDE_DIRECTORIES
2015-01-05 08:38Robert MaynardNote Added: 0037557
2015-01-05 08:38Robert MaynardStatusresolved => closed

Notes
(0035969)
Micha Renner   
2014-05-30 02:06   
CMake Version 3.0rc2
(0035970)
Brad King   
2014-05-30 08:34   
See documentation here:

http://www.cmake.org/cmake/help/v3.0/manual/cmake-buildsystem.7.html#include-directories-and-usage-requirements [^]
"Include directories usage requirements commonly differ between the build-tree and the install-tree. The BUILD_INTERFACE and INSTALL_INTERFACE generator expressions can be used to describe separate usage requirements based on the usage location."
(0035971)
Micha Renner   
2014-06-02 08:08   
Reading this "set_property(TARGET tgt APPEND PROPERTY
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR};${CMAKE_CURRENT_BINARY_DIR}>" I understood. One can influence INTERFACE_INCLUDE_DIRECTORIES indirect only. So this is the reason why the I_I_D property can not be set to read-only. I guess, I am not the last one who runs in this pitfall. Thanks for help. This topic is resolved.
(0036098)
Brad King   
2014-06-02 10:46   
It looks like there was an update to the cmake-buildsystem manual to explain this case in more detail. I've backported it for 3.0:

 Help: Add code example for INSTALL_INTERFACE to cmake-buildsystem.
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=6fbd9a8f [^]
(0036104)
Brad King   
2014-06-03 09:05   
I also extended the documentation in the target_include_directories command and the INTERFACE_INCLUDE_DIRECTORIES property to explain how to use $<BUILD_INTERFACE> and $<INSTALL_INTERFACE>:

 Help: Explain build/install-tree include dirs in more places
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=907e422b [^]
(0037557)
Robert Maynard   
2015-01-05 08:38   
Closing resolved issues that have not been updated in more than 4 months.