View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0015269CMakeCMakepublic2014-11-30 11:392016-06-10 14:31
ReporterDavid Zemon 
Assigned ToKitware Robot 
PrioritynormalSeveritymajorReproducibilityalways
StatusclosedResolutionmoved 
PlatformParallax Propeller P8X32AOSUbuntuOS Version14.04
Product VersionCMake 3.0.2 
Target VersionFixed in Version 
Summary0015269: Toolchain file not loaded without C language enabled
DescriptionProblem:
My toolchain file is not being loaded.

Apparent Cause:
Any time the C language is not enabled (by either 'project' or 'enable_langauge').

Normally, I have the toolchain file loaded with a file at the top of my root CMakeLists.txt file that reads:
  set(CMAKE_TOOLCHAIN_FILE ${PROPWARE_PATH}/PropellerToolchain.cmake)
but in an effort to try and debug this, I've also added the definition to my command line. No change occurred.
Steps To ReproduceReproducing the problem is straight-forward, but requires installing a toolchain as was deemed too complicated in my previous bug. For those willing to try, see instructions here: http://public.kitware.com/Bug/view.php?id=15155 [^]

I have not yet been able to reproduce this with a desktop build, but will report back if that changes.
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0037313)
David Zemon (reporter)
2014-11-30 11:41

I should clarify the apparent cause:
If I specify no languages with the project command (therefore leaving C and C++ enabled), it works fine. If I specify only C++ in the project command, it breaks and does not load my toolchain file.
(0037328)
Brad King (manager)
2014-12-01 11:14

FYI, if no project() command is present then CMake inserts one at line 0 of the top-level CMakeLists.txt file. This causes C and CXX to be enabled prior to execution of any other line in the CMakeLists.txt file.
(0037351)
David Zemon (reporter)
2014-12-01 22:47

The PropWare build system is setup such that project() is required by all projects (the PROJECT_NAME variable is used throughout).

I ran into this when I had to enable a new language in a C++ project. I changed the project command from `project(my_project)` to `project(my_project CXX DAT)`. I can absolutely see users doing this as well, and that presents a real problem.

Also, sorry about the severity being "major" - that was mistake.
(0037353)
Brad King (manager)
2014-12-02 09:13

Returning to the problem in the description, the enable_language() and project() commands both call configure and/or load CMakeSystem.cmake:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Source/cmGlobalGenerator.cxx;hb=v3.0.2#l400 [^]

which loads the toolchain file:

 http://www.cmake.org/gitweb?p=cmake.git;a=blob;f=Modules/CMakeSystem.cmake.in;hb=v3.0.2#l6 [^]

This should work regardless of what languages are enabled or not. It happens before the list of languages is even considered.
(0042676)
Kitware Robot (administrator)
2016-06-10 14:29

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
2014-11-30 11:39 David Zemon New Issue
2014-11-30 11:41 David Zemon Note Added: 0037313
2014-12-01 11:14 Brad King Note Added: 0037328
2014-12-01 22:47 David Zemon Note Added: 0037351
2014-12-02 09:13 Brad King Note Added: 0037353
2016-06-10 14:29 Kitware Robot Note Added: 0042676
2016-06-10 14:29 Kitware Robot Status new => resolved
2016-06-10 14:29 Kitware Robot Resolution open => moved
2016-06-10 14:29 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team