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                                    
======================================================================

-- 

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake-developers

Reply via email to