MantisBT - CMake
View Issue Details
0012220CMakeCMakepublic2011-05-24 08:282011-10-03 09:54
Magnus Osterlind 
David Cole 
normalminoralways
closedno change required 
CMake 2.8.4 
CMake 2.8.4 
0012220: /INCREMENTAL flag interferes with include directory parsing for Visual Studio 2010
The /INCREMENTAL flag will incorrectly by identified and parsed as an include directory (/I), so the generated project file will contain a <AdditionalIncludeDirectories>NCREMENTAL</AdditionalIncludeDirectories> tag.
1) Create a CMakeLists.txt containing an /INCREMENTAL flag, ex:

---
cmake_minimum_required (VERSION 2.6)
project (Tutorial)
SET(CMAKE_CXX_FLAGS_DEBUG "/INCREMENTAL")
add_executable(Tutorial tutorial.cxx)
---

2) Run cmake with Visual Studio 2010 as the generator.
As far as I can tell, include directories as separated from the /I switch with a space, so I solved this locally by including a space as part of the AdditionalIncludeDirectories rule in cmVS10CLFlagTable.h.
No tags attached.
Issue History
2011-05-24 08:28Magnus OsterlindNew Issue
2011-05-24 11:56David ColeAssigned To => David Cole
2011-05-24 11:56David ColeStatusnew => assigned
2011-05-24 11:58David ColeNote Added: 0026575
2011-05-24 11:58David ColeStatusassigned => resolved
2011-05-24 11:58David ColeFixed in Version => CMake 2.8.4
2011-05-24 11:58David ColeResolutionopen => no change required
2011-05-24 11:59David ColeNote Edited: 0026575bug_revision_view_page.php?bugnote_id=26575#r338
2011-10-03 09:54David ColeNote Added: 0027505
2011-10-03 09:54David ColeStatusresolved => closed

Notes
(0026575)
David Cole   
2011-05-24 11:58   
(edited on: 2011-05-24 11:59)
This is not really a bug in CMake. You are trying to use /INCREMENTAL as a compiler flag, but in reality, it is a linker flag.

Try one of these instead (for exes, modules and shared libs, respectively):

  set(CMAKE_EXE_LINKER_FLAGS_DEBUG "/INCREMENTAL")
  set(CMAKE_MODULE_LINKER_FLAGS_DEBUG "/INCREMENTAL")
  set(CMAKE_SHARED_LINKER_FLAGS_DEBUG "/INCREMENTAL")

(0027505)
David Cole   
2011-10-03 09:54   
Closing resolved issues that have not been updated in more than 4 months.