MantisBT - CMake
View Issue Details
0012443CMakeModulespublic2011-09-02 20:462012-02-06 06:07
Adrián Chaves Fernández 
Brad King 
normalfeatureN/A
closedno change required 
 
 
0012443: Add SFML module
Would it be possible to add a SFML module to CMake?

There is a proposal here: http://www.sfml-dev.org/forum/viewtopic.php?p=6233 [^]
No tags attached.
Issue History
2011-09-02 20:46Adrián Chaves FernándezNew Issue
2011-09-05 08:09Brad KingNote Added: 0027330
2011-09-05 10:33Adrián Chaves FernándezNote Added: 0027332
2011-09-05 11:05Brad KingNote Added: 0027333
2011-09-05 11:07Brad KingNote Added: 0027334
2011-09-05 11:07Brad KingStatusnew => resolved
2011-09-05 11:07Brad KingResolutionopen => no change required
2011-09-05 11:07Brad KingAssigned To => Brad King
2012-02-06 06:07David ColeNote Added: 0028490
2012-02-06 06:07David ColeStatusresolved => closed

Notes
(0027330)
Brad King   
2011-09-05 08:09   
Our policy for CMake modules is documented here:

  http://www.cmake.org/Wiki/CMake:Module_Maintainers [^]

However, it looks like SFML is built by CMake:

  https://github.com/LaurentGomila/SFML [^]

In that case you don't need to provide a FindSFML module at all. The project itself should provide a SFMLConfig.cmake file (package configuration file):

  http://www.cmake.org/Wiki/CMake/Tutorials#CMake_Packages [^]
(0027332)
Adrián Chaves Fernández   
2011-09-05 10:33   
You are right. I though those modules were always maintained from CMake, but they do have their ouw file in the repo:

https://github.com/LaurentGomila/SFML/blob/master/cmake/Modules/FindSFML.cmake [^]

So, thanks for the answers, and this topic can be closed :)
(0027333)
Brad King   
2011-09-05 11:05   
I think you misunderstood my response. There are two ways in which a package XYZ can be found:

(1) A find-module named FindXYZ.cmake that comes either with CMake or with the source trees of the applications that need to find XYZ. This is intended for finding packages that are not themselves CMake aware. This is the find_package command's "module mode".

(2) A package configuration file named XYZConfig.cmake or xyz-config.cmake that comes with the installation of XYZ. This is the find_package command's "config mcode". It requires no special code to be added to outside projects and is the preferred method to find a CMake-aware project.

Only option (1) or (2) is needed. Not both. See documentation of find_package here for details:

  http://www.cmake.org/cmake/help/cmake-2-8-docs.html#command:find_package [^]

Currently SFML only provides option (1) but it should be converted to option (2). The tutorials I linked in the previous response cover how.
(0027334)
Brad King   
2011-09-05 11:07   
I'm resolving this issue since no change is required to CMake. Please contact the mailing list for further help on writing package configuration files if the documentation linked is not sufficient.
(0028490)
David Cole   
2012-02-06 06:07   
Closing resolved issues that have not been updated in more than 4 months.