[cmake-developers] [CMake 0015788]: Error during export target, which has additional defined include directories with target_include_directories

Mantis Bug Tracker mantis at public.kitware.com
Tue Oct 13 11:47:09 EDT 2015


The following issue has been SUBMITTED. 
====================================================================== 
https://public.kitware.com/Bug/view.php?id=15788 
====================================================================== 
Reported By:                SunBlack
Assigned To:                
====================================================================== 
Project:                    CMake
Issue ID:                   15788
Category:                   CMake
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
====================================================================== 
Date Submitted:             2015-10-13 11:47 EDT
Last Modified:              2015-10-13 11:47 EDT
====================================================================== 
Summary:                    Error during export target, which has additional
defined include directories with target_include_directories
Description: 
If you have a static library and want to add necessary include directories with
target_include_directories so users of this library just need to add library
with target_link_libraries (and don't need to add includes with
include_directories), I currently got

%%Configuring done
CMake Error in CMakeLists.txt:
  Target "myProject" INTERFACE_INCLUDE_DIRECTORIES property contains path:

    "D:/myProjectDir/myIncludeDir"

  which is prefixed in the source directory.


Generating done%%

Source code:
%%cmake_minimum_required(VERSION 3.3)

project(myProject)

add_library(${PROJECT_NAME}
	mySourceDir/test.cpp
	myIncludeDir/test.h
)

target_include_directories(${PROJECT_NAME} PUBLIC "myIncludeDir")

install(TARGETS ${PROJECT_NAME}
    EXPORT MyTargets
    ARCHIVE DESTINATION lib
)

install(EXPORT MyTargets DESTINATION cmake)%%

This message don't occurs, if I remove install.

====================================================================== 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2015-10-13 11:47 SunBlack       New Issue                                    
======================================================================



More information about the cmake-developers mailing list