[CMake] OpenSceneGraph Find Modules

Pau Garcia i Quiles pgquiles at elpauer.org
Fri Jan 4 16:09:34 EST 2008


Quoting "Miguel A. Figueroa-Villanueva" <miguelf at ieee.org>:

> What I was suggesting is that instead of having the following   
> modules separate:
>
>> Findosg.cmake
>> FindosgDB.cmake
>> FindosgFX.cmake
>> FindosgGA.cmake
>> FindosgIntrospection.cmake
>> FindosgManipulator.cmake
>> FindosgParticle.cmake
>> FindosgProducer.cmake
>> FindosgShadow.cmake
>> FindosgSim.cmake
>> FindosgTerrain.cmake
>> FindosgText.cmake
>> FindosgUtil.cmake
>> FindosgViewer.cmake
>
> You should have a single FindOpenSceneGraph.cmake module and provide a
> mechanism to use (if available) the different components of the
> library (FX, GA, Introspection, etc.) that the user is interested in.

I'm doing somethink like that for ZeroC ICE.

ICE has several libraries (IceCore, IceBox, IceGrid, IcePatch2,  
IceSSL, IceStorm, IceUtil, IceXML, Freeze, Glacier2 and some  
executables). I have a FindXXXX.cmake for each of them:

FindZeroCIceBox.cmake
FindZeroCIceCore.cmake
FindZeroCIceExecutables.cmake
FindZeroCIceGrid.cmake
FindZeroCIcePatch2.cmake
FindZeroCIceSSL.cmake
FindZeroCIceStorm.cmake
FindZeroCIceUtil.cmake
FindZeroCIceXML.cmake
FindZeroCFreeze.cmake
FindZeroCGlacier2.cmake

Then I have a FindZeroCIce.cmake which essentially has this code:

[...]
SET( ZeroCIceCore_FIND_QUIETLY TRUE )
SET( ZeroCIceBox_FIND_QUIETLY TRUE )
SET( ZeroCIceGrid_FIND_QUIETLY TRUE )
SET( ZeroCIcePatch2_FIND_QUIETLY TRUE )
SET( ZeroCIceSSL_FIND_QUIETLY TRUE )
SET( ZeroCIceStorm_FIND_QUIETLY TRUE )
SET( ZeroCIceUtil_FIND_QUIETLY TRUE )
SET( ZeroCIceXML_FIND_QUIETLY TRUE )
SET( ZeroCIceExecutables_FIND_QUIETLY TRUE )
SET( ZeroCIceFreeze_FIND_QUIETLY TRUE )
SET( ZeroCIceGlacier2_FIND_QUIETLY TRUE )

FIND_PACKAGE( ZeroCIceCore )
FIND_PACKAGE( ZeroCIceBox )
FIND_PACKAGE( ZeroCIceGrid )
FIND_PACKAGE( ZeroCIcePatch2 )
FIND_PACKAGE( ZeroCIceSSL )
FIND_PACKAGE( ZeroCIceStorm )
FIND_PACKAGE( ZeroCIceUtil )
FIND_PACKAGE( ZeroCIceXML )
FIND_PACKAGE( ZeroCIceExecutables )
FIND_PACKAGE( ZeroCIceFreeze )
FIND_PACKAGE( ZeroCIceGlacier2 )
[...]

If a project only needs a couple of libraries, say IceCore and  
IceUtil, I just do:
FIND_PACKAGE( ZeroCIceCore)
FIND_PACKAGE( ZeroCIceUtil)

But if I'm going to need most or all of ICE, I just do FIND_PACKAGE(  
ZeroCIce ) and now I have all the variables set.

Would that be acceptable for OSG?

-- 
Pau Garcia i Quiles
http://www.elpauer.org
(Due to my workload, I may need 10 days to answer)



More information about the CMake mailing list