[CMake] CMakeModules repository at GitHub?
David Cole
dlrdave at aol.com
Sat Mar 30 07:53:13 EDT 2013
Alan,
Project config files must be installed *with* the project, in its
install tree, in a standard location where CMake's find_package can
find them [1]. If the project is unwilling to put such a file in its
install tree, then it's "game over" for a project config file, and a
Find module then becomes necessary, either in another project's repo
that is a client, or in CMake itself, if it's for a widely used package.
It really does belong with the project, though, so that when its layout
changes, it changes its config file, and there's no need for CMake to
"respond" to a release of that project just for a layout reorg or an
addition of a new library...
Two "rules":
- Project config files can only go *with* the project.
(VTK and ITK have them. Qt 5 has one. KDE uses them... All the cool
projects have one. :-)
- Find modules can *never* go with the project, and must be hosted
*outside* the project.
You will never see any project config files in CMake unless CMake
provides one for itself someday. (Not necessary, since CMake is a tool
that people use, not a library that people build upon.)
This topic is also covered in one of my stackoverflow answers:
http://stackoverflow.com/a/6594839/236192
Hopefully this explanation illuminates the topic a little bit more for
you.
Cheers,
David
[1] for the standard locations where find_package will look for project
config files, please see the find_package documentation, and search for
"CMake constructs a set of possible installation prefixes for the
package" in the text...
http://www.cmake.org/cmake/help/v2.8.10/cmake.html#command:find_package
-----Original Message-----
From: Alan W. Irwin <irwin at beluga.phys.uvic.ca>
To: Bill Hoffman <bill.hoffman at kitware.com>
Cc: cmake <cmake at cmake.org>
Sent: Fri, Mar 29, 2013 7:30 pm
Subject: Re: [CMake] CMakeModules repository at GitHub?
On 2013-03-29 16:58-0400 Bill Hoffman wrote:
> On 3/29/2013 4:18 PM, Alan W. Irwin wrote:
>> Hi Bill:
>>
>> This may have been covered in this thread already, but I am
interested
>> in your take on the following questions. Why no downstream (i.e.,
>> associated with CMake) config files if upstream won't take them? For
>> the downstream case, are find modules considered to be a better
>> solution than config files, and if so why?
> If the project will not create cmake config files then the only
option is to
> have a traditional find module. Maybe I don't get your question?
This sub-topic started with the following thought-provoking statements
from David:
<quote>
CMake needs no new Find modules.
All projects should provide a "project config file .cmake script"
readable by CMake's find_package, and installed in a location where
CMake can find it, so that a CMake find module is completely
unnecessary.
</quote>
Perhaps I am overinterpreting what David said, but it appears to
me he is generally deprecating the find module approach and
recommending the new project config file approach be used instead.
However, for the special case where an external project is not willing
to host anything concerning CMake where should those project config
files be hosted? It appears to me that one possibility is that CMake
host them, just like you do now for the deprecated (according to my
interpretation) find modules. But you say above the only option
for this case is the find module approach. Why? Is there some technical
issue that I am missing concerning project config files that would make
it impossible for CMake to host them?
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and
Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
--
Powered by www.kitware.com
Visit other Kitware open-source projects at
http://www.kitware.com/opensource/opensource.html
Please keep messages on-topic and check the CMake FAQ at:
http://www.cmake.org/Wiki/CMake_FAQ
Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake
More information about the CMake
mailing list