MantisBT - CMake
View Issue Details
0012426CMake(No Category)public2011-08-27 12:502016-06-10 14:31
Stephen Kelly 
Alex Neundorf 
normalminorhave not tried
closedmoved 
 
 
0012426: cmake --find-package doesn't seem to set language correctly
I also note that it creates some output files in $PWD which it does not clear up afterward.

kde-devel@bishop:~/dev/src/kf5/tier1/itemmodels{frameworks}$ cmake --find-package -DNAME=Grantlee -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST
CMake Error at /home/kde-devel/dev/qt47/kde46/share/cmake-2.8/Modules/CheckSymbolExists.cmake:69 (TRY_COMPILE):
  Unknown extension ".cxx" for file

    /home/kde-devel/dev/src/kf5/tier1/itemmodels/CMakeFiles/CMakeTmp/CheckSymbolExists.cxx

  try_compile() works only for enabled languages. Currently these are:

   

  See project() command to enable other languages.
Call Stack (most recent call first):
  /home/kde-devel/dev/qt47/kde46/share/cmake-2.8/Modules/CheckCXXSymbolExists.cmake:41 (_CHECK_SYMBOL_EXISTS)
  /home/kde-devel/dev/qt47/kde46/share/cmake-2.8/Modules/FindQt4.cmake:718 (CHECK_CXX_SYMBOL_EXISTS)
  /home/kde-devel/dev/qt47/kde46/lib/cmake/grantlee/GrantleeConfig.cmake:19 (find_package)
  /home/kde-devel/dev/qt47/kde46/share/cmake-2.8/Modules/CMakeFindPackageMode.cmake:166 (find_package)


Grantlee not found.
CMake Error: Problem processing arguments. Aborting.
No tags attached.
child of 0014676closed Alex Neundorf cmake --find-package summary ticket 
Issue History
2011-08-27 12:50Stephen KellyNew Issue
2011-08-29 10:09Brad KingAssigned To => Alex Neundorf
2011-08-29 10:09Brad KingStatusnew => assigned
2011-09-12 17:11Alex NeundorfNote Added: 0027410
2011-09-12 17:12Alex NeundorfPrioritynormal => high
2011-09-12 17:12Alex NeundorfDescription Updatedbug_revision_view_page.php?rev_id=416#r416
2011-09-16 07:41Alex NeundorfNote Added: 0027432
2011-09-16 10:40Stephen KellyNote Added: 0027433
2011-09-16 18:25Alex NeundorfNote Added: 0027442
2012-08-13 14:32Alex NeundorfPriorityhigh => normal
2012-08-13 14:32Alex NeundorfStatusassigned => backlog
2014-01-01 12:21Alex NeundorfRelationship addedchild of 0014676
2016-06-10 14:28Kitware RobotNote Added: 0041894
2016-06-10 14:28Kitware RobotStatusbacklog => resolved
2016-06-10 14:28Kitware RobotResolutionopen => moved
2016-06-10 14:31Kitware RobotStatusresolved => closed

Notes
(0027410)
Alex Neundorf   
2011-09-12 17:11   
Hmm, this is not an easy one...

It does a try_compile(), and try_compile() needs a fully set up toolchain. But most of this is skipped in this mode.

Alex
(0027432)
Alex Neundorf   
2011-09-16 07:41   
I merged a fix into next, which gives a better error message:
"The TRY_COMPILE() command is not supported in --find-package mode."

This doesn't make it work, but IMO is much better.
This means some modules do not work in --find-package mode.
But I'd consider this good enough for releasing as a first version.

What do you think ?

Alex
(0027433)
Stephen Kelly   
2011-09-16 10:40   
I think it depends on whether it's fixable. In the current state, even attempting to find Qt will fail.

cmake --find-package -DNAME=Qt -DCOMPILER_ID=GNU -DLANGUAGE=CXX -DMODE=EXIST

I'm not familiar with why it doesn't more fully set up a toolchain (speed?), but if that can be fixed in the future maybe it's ok.

In the current state anything using struct_has_member, check_symbol_exists etc will not work. I don't know how common that is in find files or config files, but if it's common, then I don't think there's any rush to put the feature into cmake until the issue is resolved.
(0027442)
Alex Neundorf   
2011-09-16 18:25   
FindQt4.cmake is probably the most complex Find-module coming with cmake.
Ok, boost maybe.

Config-files should not have those tests, since they should know what features the package they belong to have.
So I also had the idea to support only Config-mode, but as it is now, additionally also Find-module which don't have any try_compile()s will work.
(0041894)
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.