MantisBT - CMake
View Issue Details
0015412CMakeCMakepublic2015-02-20 07:532016-03-22 10:29
Kiron 
 
normalminoralways
closedfixed 
CMake 3.1.3 
CMake 3.3CMake 3.3 
0015412: FPHSA should set ExactCase_FOUND variable
The find_dependency macro only checks for ${dep}_FOUND and not for the alternative form <UPPERCASED_NAME>_FOUND.

Not <UPPERCASED_NAME>_FOUND considering means, that the find_dependency macro will not work with FindModules which use FIND_PACKAGE_HANDLE_STANDARD_ARGS and do not set FOUND_VAR to ${CMAKE_FIND_PACKAGE_NAME}, since by default it will set <UPPERCASED_NAME>_FOUND. Or other FindModules which just set <UPPERCASED_NAME>_FOUND.

I also think in line 80 till 83 it should use unset instead of set.

[1] http://www.cmake.org/gitweb?p=stage/cmake.git;a=blob;f=Modules/CMakeFindDependencyMacro.cmake;h=73efaae7cddc5915fb5e273decd7b703883b929d;hb=HEAD#l78 [^]
No tags attached.
has duplicate 0016028closed Stephen Kelly find_dependency not looking for the correct FOUND variable 
Issue History
2015-02-20 07:53KironNew Issue
2015-02-20 10:40Brad KingAssigned To => Stephen Kelly
2015-02-20 10:40Brad KingStatusnew => assigned
2015-02-20 10:40Brad KingTarget Version => CMake 3.3
2015-02-21 04:02Stephen KellyNote Added: 0038013
2015-02-23 03:12KironNote Added: 0038016
2015-02-23 09:24Brad KingTarget VersionCMake 3.3 =>
2015-02-23 09:30Brad KingNote Added: 0038021
2015-02-23 16:47Stephen KellyNote Added: 0038041
2015-02-24 08:37Brad KingNote Added: 0038047
2015-02-24 14:00Stephen KellyNote Added: 0038058
2015-02-24 14:07Brad KingNote Added: 0038059
2015-03-05 10:01Brad KingTarget Version => CMake 3.3
2015-03-07 07:00Stephen KellyAssigned ToStephen Kelly => Alex Neundorf
2015-03-07 07:01Stephen KellySummaryfind_dependency macro does not check for <UPPERCASED_NAME>_FOUND => FPHSA should set ExactCase_FOUND variable
2015-03-07 14:03Alex NeundorfNote Added: 0038176
2015-03-07 14:03Alex NeundorfAssigned ToAlex Neundorf => Stephen Kelly
2015-03-08 11:33Stephen KellyAssigned ToStephen Kelly =>
2015-03-08 11:33Stephen KellyNote Added: 0038177
2015-03-11 15:52Brad KingNote Added: 0038203
2015-04-15 14:45Brad KingNote Added: 0038526
2015-04-15 14:45Brad KingStatusassigned => resolved
2015-04-15 14:45Brad KingResolutionopen => fixed
2015-04-15 14:45Brad KingFixed in Version => CMake 3.3
2015-04-17 10:49Brad KingNote Edited: 0038526bug_revision_view_page.php?bugnote_id=38526#r1767
2015-11-02 09:13Robert MaynardNote Added: 0039779
2015-11-02 09:13Robert MaynardStatusresolved => closed
2016-03-22 10:29Stephen KellyRelationship addedhas duplicate 0016028

Notes
(0038013)
Stephen Kelly   
2015-02-21 04:02   
In my view, the problem you're hitting is the outcome of

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6103 [^]

It didn't go my way :). If it did there would be no problem.

I object to changing find_dependency to look for UPPERCASE_FOUND. As it is, find_dependency incentivises consistency for the _FOUND variable. I don't want to change that.

So the modules affected by this have to be changed as described by Brad (he wanted to incentivise changing the modules to set the _FOUND variable explicitly):

 http://thread.gmane.org/gmane.comp.programming.tools.cmake.devel/6103/focus=6143 [^]

Which modules are affected by this?
(0038016)
Kiron   
2015-02-23 03:12   
> Which modules are affected by this?

Problem was with a custom self written FindModule which uses FPHSA
 but did not set the FOUND_VAR explicitly.

It is a bit annoying that two standard CMake modules disagree by default on how to name the Module_FOUND variable.
(0038021)
Brad King   
2015-02-23 09:30   
Re 0015412:0038013: There was another discussion long before that one where I wanted ExactCase_FOUND to be the standard for FPHSA but was outvoted because so many of the existing modules already used UPPERCASE_FOUND. If that had gone my way then everything would be consistent now.

After seeing how this comes up for third-party modules I've reconsidered my position from two years ago in the thread you linked. I think we should go ahead with the behavior you originally proposed there, at least when no explicit FOUND_VAR option is passed.
(0038041)
Stephen Kelly   
2015-02-23 16:47   
Good, let's finally fix this problem :)

 http://www.cmake.org/gitweb?p=cmake.git;a=commitdiff;h=f6cb72e0 [^]
 FPHSA: Always populate the ExactCase_FOUND variable (0015412).
(0038047)
Brad King   
2015-02-24 08:37   
Re 0015412:0038041: The FOUND_VAR option should still be checked/enforced to only allow the two possible names if it is given.
(0038058)
Stephen Kelly   
2015-02-24 14:00   
Given that the FOUND_VAR is ignored and has no semantics, I don't think that is necessary.

Do you feel strongly about that?
(0038059)
Brad King   
2015-02-24 14:07   
Re 0015412:0038058: If the argument is accepted then it should be validated when used, as before. By deprecating it we shouldn't allow more uses than before.
(0038176)
Alex Neundorf   
2015-03-07 14:03   
Stephen, if you know what to do go ahead and do it.
(0038177)
Stephen Kelly   
2015-03-08 11:33   
Ok, sorry! :)
(0038203)
Brad King   
2015-03-11 15:52   
Steve, the change linked in 0015412:0038041 never made it to 'master' due to my comment in 0015412:0038047. Please revise and restore the topic when ready.
(0038526)
Brad King   
2015-04-15 14:45   
(edited on: 2015-04-17 10:49)
I've revised the change from 0015412:0038041 to maintain the FOUND_VAR argument validation. Applied:

 FPHSA: Always populate the ExactCase_FOUND variable
 http://cmake.org/gitweb?p=cmake.git;a=commitdiff;h=d1a6d15b [^]

(0039779)
Robert Maynard   
2015-11-02 09:13   
Closing resolved issues that have not been updated in more than 4 months.