MantisBT - CMake
View Issue Details
0010781CMakeCPackpublic2010-05-28 18:242016-06-10 14:31
Chuck Seberino 
Kitware Robot 
normalminoralways
closedmoved 
CMake-2-8 
 
0010781: CPack infinite recursion with include
I ran into a case where a set of cpack files were generated where there was a circular reference when calling include() leading to infinite recursion. I am including a trivial example that illustrates the problem. Running cpack on this file eventually generates a segmentation fault on ubuntu 9.04 (x86_64) linux and no output whatsoever on WinXP SP3. Tested on 2.8.1.

CPackConfig.cmake
---------------
set(CMAKE_MODULE_PATH .)
include(CPackConfig)

I have made accommodations in my build system to keep this from happening in the future, but it would be good to at least have some way to trap or report this condition besides no output (WinXP) or a segmentation fault (linux).
No tags attached.
related to 0010751closed Kitware Robot CPack.cmake confused when used twice 
child of 0011808closed Kitware Robot Make CPack preinstall to take account current install project name 
Issue History
2010-05-28 18:24Chuck SeberinoNew Issue
2010-07-29 09:05Eric NOULARDRelationship addedrelated to 0010751
2010-07-29 09:15Eric NOULARDNote Added: 0021542
2010-12-14 18:42David ColeAssigned To => David Cole
2010-12-14 18:42David ColeStatusnew => assigned
2011-02-07 02:00Eric NOULARDRelationship addedchild of 0011808
2012-08-13 15:06David ColeStatusassigned => new
2012-08-13 15:06David ColeNote Added: 0030590
2012-08-13 15:07David ColeStatusnew => backlog
2012-08-13 15:21David ColeAssigned ToDavid Cole =>
2016-06-10 14:28Kitware RobotNote Added: 0041707
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:28Kitware RobotAssigned To => Kitware Robot
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0021542)
Eric NOULARD   
2010-07-29 09:15   
May be this could be recasted in a generic way to avoid "double" or "more"
inclusion of the same .cmake file, however there is currently a simple
way to solve it just like for C/C++ header, protect yourself against multiple inclusion.

set(CMAKE_MODULE_PATH .)
if(NOT CPACK_CONFIG_INCLUDED)
  set(CPACK_CONFIG_INCLUDED TRUE)
  include(CPackConfig)
else(NOT CPACK_CONFIG_INCLUDED)
  message("Not including this twice")
endif(NOT CPACK_CONFIG_INCLUDED)

This could be written as a macro
include_once

or may be a feature request for enhancing builtin include

include(<file|module> [ONCE])

However how was the offending CPack file generated?
Was it generated by custom tool?
If this is the case then your custom tool could use "include_once" approach.

If not would you be able to give us a complete [but small] example
(0030590)
David Cole   
2012-08-13 15:06   
Sending old, not-recently-updated issues to the backlog.

(The age of the bug alone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0041707)
Kitware Robot   
2016-06-10 14:28   
Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.