View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013918CMakeCMakepublic2013-02-14 04:412016-06-10 14:31
ReporterPetr Kmoch 
Assigned ToKitware Robot 
PrioritynormalSeverityminorReproducibilityalways
StatusclosedResolutionmoved 
PlatformOSWindowsOS Version7
Product VersionCMake 2.8.10.2 
Target VersionFixed in Version 
Summary0013918: enable_language() sets CMAKE_<lang>_COMPILER_LOADED in local scope
DescriptionWhen enable_language(<lang>) is called within a function, it sets the variable CMAKE_<lang>_COMPILER_LOADED within the scope of that function only. This behaviour is rather unexpected, or at least not mentioned in the documentation.
Steps To ReproduceRun CMake on the attached CMakeList.

Expected output:
-- C was loaded
-- C reports as loaded

Actual output:
-- C was loaded
-- C reports as not loaded
TagsNo tags attached.
Attached Filestxt file icon CMakeLists.txt [^] (391 bytes) 2013-02-14 04:41 [Show Content]

 Relationships

  Notes
(0032280)
Brad King (manager)
2013-02-14 08:36

The variable gets set as documented here:

 http://www.cmake.org/cmake/help/v2.8.10/cmake.html#variable:CMAKE_LANG_COMPILER_LOADED [^]

but it gets eaten by the function's nested variable scope.

As a generalization of my comments in this thread:

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.user/45460 [^]

the language initialization needs an overhaul to be scoped properly.

Sending to backlog for now.

Use a macro to work around.
(0042224)
Kitware Robot (administrator)
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.

 Issue History
Date Modified Username Field Change
2013-02-14 04:41 Petr Kmoch New Issue
2013-02-14 04:41 Petr Kmoch File Added: CMakeLists.txt
2013-02-14 08:36 Brad King Note Added: 0032280
2013-02-14 08:36 Brad King Status new => backlog
2016-06-10 14:28 Kitware Robot Note Added: 0042224
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team