View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0009444CMakeCMakepublic2009-08-21 17:472009-08-24 09:56
ReporterK. Noel Belcourt 
Assigned ToBrad King 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusclosedResolutionfixed 
PlatformOSOS Version
Product VersionCMake-2-6 
Target VersionFixed in Version 
Summary0009444: Ability to detect, report and terminate build if cycles exist
DescriptionHi,

Do you have a way to disable support for circular dependencies so if,
theoretically, users wanted to eliminate cycles from their dependencies,
they could enable some internal CMAKE variable to detect, report and
terminate the build if a cycle is detected? This would be a very useful
feature for Sierra. Boost Build does not permit circular dependencies
so with our movement to Cmake, and without this feature, we're likely to
introduce circular dependencies back into our code base. We'd really
like to avoid re-introducing them since we spent a good year working to
eliminate them completely from Sierra's code base and we're much happier
without them.

Any chance for this kind of feature?
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0017184)
Brad King (manager)
2009-08-24 09:56

CMake already detects and complains about cycles in the inter-target dependency graph that do not consist completely of STATIC libraries. I've created a new GLOBAL_DEPENDS_NO_CYCLES property which simply enables the error message for cycles even among static libraries:

Create GLOBAL_DEPENDS_NO_CYCLES property
/cvsroot/CMake/CMake/Source/cmComputeTargetDepends.cxx,v <-- Source/cmComputeTargetDepends.cxx
new revision: 1.5; previous revision: 1.4
/cvsroot/CMake/CMake/Source/cmComputeTargetDepends.h,v <-- Source/cmComputeTargetDepends.h
new revision: 1.4; previous revision: 1.3
/cvsroot/CMake/CMake/Source/cmake.cxx,v <-- Source/cmake.cxx
new revision: 1.420; previous revision: 1.419

Add a line like this to your project:

  set_property(GLOBAL PROPERTY GLOBAL_DEPENDS_NO_CYCLES 1)

It will be safely ignored by CMake versions too old to know about the property. CMake 2.7.20090824 and later will complain about cycles.


FYI, there is already a property called GLOBAL_DEPENDS_DEBUG_MODE which will print verbose information about inter-target dependencies. It was meant for debugging the CMake implementation of target dependency analysis, but may be useful for individual users also:

http://www.cmake.org/cmake/help/cmake2.6docs.html#prop_global:GLOBAL_DEPENDS_DEBUG_MODE [^]

 Issue History
Date Modified Username Field Change
2009-08-21 17:47 K. Noel Belcourt New Issue
2009-08-24 09:51 Brad King Status new => assigned
2009-08-24 09:51 Brad King Assigned To => Brad King
2009-08-24 09:56 Brad King Note Added: 0017184
2009-08-24 09:56 Brad King Status assigned => closed
2009-08-24 09:56 Brad King Resolution open => fixed


Copyright © 2000 - 2018 MantisBT Team