View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0014109CMakeCMakepublic2013-04-23 22:222013-10-07 10:09
ReporterTim Patterson 
Assigned ToDavid Cole 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionno change required 
PlatformOSOS Version
Product VersionCMake 2.8.8 
Target VersionFixed in VersionCMake 2.8.8 
Summary0014109: Target property INCLUDE_DIRECTORIES is ignored in Visual Studio Generator
DescriptionThe INCLUDE_DIRECTORIES property on a target appears to be ignored by the VS generator. Setting the property on the directory works fine.
Steps To ReproduceCMakeLists.txt:

PROJECT(SomeProject)
cmake_minimum_required(VERSION 2.8)

ADD_LIBRARY(HelloWorld HelloWorld.cpp)

IF(TRUE)
    # This doesn't work (despite being set correctly):
    SET_PROPERTY(TARGET HelloWorld APPEND PROPERTY INCLUDE_DIRECTORIES "ThisIsATest")
    GET_TARGET_PROPERTY(_includeDirs HelloWorld INCLUDE_DIRECTORIES)
    MESSAGE("_includeDirs = ${_includeDirs}")
ELSE()
    # This works:
    SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES "ThisIsATest")
ENDIF()
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0032930)
David Cole (manager)
2013-04-23 23:32

This is fixed already in 2.8.11.

When I run your CMakeLists file with CMake 2.8.11-rc3, I get this output:

_includeDirs = ThisIsATest
(0032931)
Tim Patterson (reporter)
2013-04-23 23:37

Note that the property always prints out correctly - even in the earlier version I am running. I just put it in as a sanity check. The real test is to see if the path appears in the generated project's property page (Which can't be tested from within cmake easily).
(0032932)
David Cole (manager)
2013-04-23 23:58

Well if I add a HelloWorld.cpp file so that it generates correctly, and I look at the generated Visual Studio project, I see:

ThisIsATest;%(AdditionalIncludeDirectories)

in the "Additional Include Directories" field.

So... I still contend that this is fixed in later versions of CMake. The INCLUDE_DIRECTORIES property did not become write-able as a target property directly until version 2.8.8.

Are you certain you are using CMake 2.8.8 to do this?

What version of Visual Studio are you using?

I cannot reproduce the problem when I use CMake 2.8.11-rc3 and Visual Studio 11.
(0032933)
Tim Patterson (reporter)
2013-04-24 00:07

I just upgraded to cmake 2.8.10.2 and the issue is resolved. I checked and I was using 2.8.7 :-/. I guess that means u can close this ticket!

Thanks for getting back to me so quickly, btw! Thanks for such a fantastic tool, too! :-)
(0032934)
David Cole (manager)
2013-04-24 08:01

See previous notes for details...
(0034037)
Robert Maynard (manager)
2013-10-07 10:09

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

 Issue History
Date Modified Username Field Change
2013-04-23 22:22 Tim Patterson New Issue
2013-04-23 23:32 David Cole Note Added: 0032930
2013-04-23 23:37 Tim Patterson Note Added: 0032931
2013-04-23 23:58 David Cole Note Added: 0032932
2013-04-24 00:07 Tim Patterson Note Added: 0032933
2013-04-24 08:01 David Cole Assigned To => David Cole
2013-04-24 08:01 David Cole Status new => assigned
2013-04-24 08:01 David Cole Note Added: 0032934
2013-04-24 08:01 David Cole Status assigned => resolved
2013-04-24 08:01 David Cole Fixed in Version => CMake 2.8.8
2013-04-24 08:01 David Cole Resolution open => no change required
2013-10-07 10:09 Robert Maynard Note Added: 0034037
2013-10-07 10:09 Robert Maynard Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team