Re: [CMake] Tips to create a UseXYZ.cmake

2010-01-28 Thread Michael Wild

On 28. Jan, 2010, at 19:01 , Anton Deguet wrote:

> Hello,
> 
> Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ... is there 
> a short description of the philosophy and basic commands to  use?   Any 
> pointer is welcome.  This would be for a project with multiple external 
> dependencies, i.e. libxml, openCV, Python, numpy, ...
> 
> Thanks,
> 
> Anton

I usually do it like this:

XYZConfig.cmake:
- import targets
- deal with version requirements and COMPONENTS
- define variables, such as XYZ_INCLUDE_DIR, XYZ_LIBRARIES, XYZ_COMPILE_FLAGS 
and XYZ_USE_FILE
- anything else to make it work like a FindXYZ.cmake module, just the bare 
minimum

XYZUse.cmake (or UseXYZ.cmake):
- perhaps call include_directories (personally I don't like this)
- call add_definitions if required
- define useful macros/functions (such as qt4_wrap_ui)
- anything else that makes working with XYZ comfortable


If you don't plan on calling include_directories and add_definitions (and 
similar) in your USE-file and the macros/functions are few and short, it might 
be reasonable to put them in the CONFIG-file directly.


HTH

Michael
___
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


Re: [CMake] Tips to create a UseXYZ.cmake

2010-01-28 Thread Mateusz Loskot
Anton Deguet wrote:
> Hello,
> 
> Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ...
> is there a short description of the philosophy and basic commands to
> use?   Any pointer is welcome.  This would be for a project with
> multiple external dependencies, i.e. libxml, openCV, Python, numpy,
> ...
> 

What's the difference between Use*.cmake and Find*.cmake?

Best regards,
-- 
Mateusz Loskot, http://mateusz.loskot.net
Charter Member of OSGeo, http://osgeo.org
___
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


[CMake] Tips to create a UseXYZ.cmake

2010-01-28 Thread Anton Deguet
Hello,

Besides digging in the existing UseVTK, UseITK, UseOpenIGTLing, ... is there a 
short description of the philosophy and basic commands to  use?   Any pointer 
is welcome.  This would be for a project with multiple external dependencies, 
i.e. libxml, openCV, Python, numpy, ...

Thanks,

Anton


---
Anton Deguet, Research Engineer, ERC-CISST/LCSR, Johns Hopkins University
e-mail: anton.deg...@jhu.edu, iChat: anton.deg...@mac.com
office phone: 410-516-5261, cell phone: 410-790-0456
JHU, LCSR, CSEB 137b, 3400 North Charles Street, Baltimore, MD 21218, USA




___
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