MantisBT - CMake
View Issue Details
0008570CMakeModulespublic2009-02-20 09:492010-12-14 18:49
Christoph Seibert 
David Cole 
normalminoralways
closedfixed 
CMake-2-6 
CMake-2-8 
0008570: exclude_system flag in get_prerequisites() function broken in CMake 2.6.2
I'm seeing this problem on Windows XP 32 bit:

Setting the exclude_system flag to 1 has no effect when calling get_prerequisites() - it will still look for system libraries and include them in the returned list. The culprit seems to be the following block that has changed between 2.6.1 and 2.6.2 (this is the 2.6.2 version):

    # Use the raw_item as the list entries returned by this function. Use the
    # gp_resolve_item function to resolve it to an actual full path file if
    # necessary.
    #
    set(item "${raw_item}")

    # Add each item unless it is excluded:
    #
    set(add_item 1)

    if(${exclude_system})
      set(type "")
      gp_file_type("${target}" "${item}" type)

      if("${type}" STREQUAL "system")
        set(add_item 0)
      endif("${type}" STREQUAL "system")
    endif(${exclude_system})

In 2.6.2, only "raw" items are considered for addition. However, the gp_file_type() function expects the item to have an absolute path. In 2.6.1, the raw item was resolved to an absolute path _before_ checking the file type.

As a side note, I found it highly irritating that get_prerequisites() changed its interface incompatibly between 2.6.1 and 2.6.2 (which I consider a minor update): both the input (two additional mandatory arguments) and the output (no longer includes absolute paths) have changed. This also leads to incorrect documentation in the list_prerequisites() function, which implies that it will print full paths when in fact it will not.
No tags attached.
Issue History
2009-02-20 09:49Christoph SeibertNew Issue
2009-02-20 09:50Bill HoffmanStatusnew => assigned
2009-02-20 09:50Bill HoffmanAssigned To => David Cole
2009-02-20 09:53Bill HoffmanNote Added: 0015247
2009-02-20 09:54Bill HoffmanNote Added: 0015248
2009-12-10 13:45David ColeNote Added: 0018802
2009-12-10 13:45David ColeStatusassigned => resolved
2009-12-10 13:45David ColeFixed in Version => CMake-2-8
2009-12-10 13:45David ColeResolutionopen => fixed
2010-12-14 18:49David ColeNote Added: 0024065
2010-12-14 18:49David ColeStatusresolved => closed

Notes
(0015247)
Bill Hoffman   
2009-02-20 09:53   
get_prerequisites() should be considered Beta, and should have been marked as such, sorry about that.
(0015248)
Bill Hoffman   
2009-02-20 09:54   
On the bright side since it is a cmake module, you can copy it into your project and change it as needed.
(0018802)
David Cole   
2009-12-10 13:45   
This should be working as you expect with respect to the exclude_system flag in CMake 2.8.0... Please re-open and attach more information if you disagree.

Thanks,
David Cole
(0024065)
David Cole   
2010-12-14 18:49   
Closing bugs that have been resolved for more than 3 months without any further updates.