[CMake] 3rd party modules

David Cole david.cole at kitware.com
Thu Sep 21 16:49:11 EDT 2006


They could be installed anywhere they want to be.... as long as the 
corresponding FindFoo and FindBar look for them there. :-)

Also consider this:
Foo 1.0
Foo 1.2
Foo 1.4
All installed on the same machine...

Ideally, each one should have a FooConfig -- then FindFoo has to choose 
the "latest one" but allow the developer to choose a specific one if he 
wants...

Fuel for the fire,
David

Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA wrote:

>	Thanks Brad.
>	Let's say for project Foo and project Bar, I've created
>a FooConfig.cmake and BarConfig.cmake. Project Foo uses Cmake
>but Bar doesn't. During the installation, where should Foo and Bar place
>the Config.cmake so that another project's CMake can easily find it?
>Consider these scenarios:
>1) Foo (cmake based) is installed on a system that has cmake
>	Is there CMakeConfig.cmake that would tell me where 
>      to install the FooConfig.cmake?
>2) Bar (not cmake based) is installed on a system that has cmake.
>      Is there cmake-config that would tell me where to install 
>      BarConfig.cmake?
>3) Bar (not cmake based) is installed on a system that doesn't have cmake.
>
>	Should I install BarConfig.cmake in 
>	$(datarootdir)/CMake/Modules (if Bar is using autotools)
>	so that when CMake is installed later, BarConfig.cmake will be
>	available.
>
>	Please consider that they would be installed under
>a) Linux
>b) Windows
>
>	I apreciate your help.
>	Thank You.
>
>--
>Artur Kedzierski
>
>
>-----Original Message-----
>From: Brad King [mailto:brad.king at kitware.com] 
>Sent: Tuesday, September 19, 2006 7:16
>To: Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA
>Cc: CMake Mailing List
>Subject: Re: [CMake] 3rd party modules
>
>Kedzierski, Artur CIV NAVSURFWARCENDIV CORONA wrote:
>  
>
>>	Some packages provide modules/programs that
>>provide information where they were installed. For
>>example, "FooLibrary" may provide
>>FooLibrary.m4 for auto-tools,
>>FooLibrary.pc for pkg-confing,
>>or
>>Foo-config for anything else.
>>	As an author of a library, should I start 
>>providing anything for Cmake for easier integration 
>>(that works on multiple platforms)? 
>>    
>>
>
>You should create a "FooConfig.cmake" file, where "Foo" is your project
>name and "Config.cmake" is that exact string (capitalization and all).
>The file should have information about the installed copy of Foo with
>which it comes.
>
>FIND_PACKAGE(Foo)
>
>will look for FindFoo.cmake first and if not found then create a Foo_DIR
>cache entry that asks the user to locate FooConfig.cmake.  In the future
>there will be better support for locating FooConfig.cmake automatically:
>
>http://www.cmake.org/Bug/bug.php?op=show&bugid=3659
>
>If you can't wait until that bug is implemented, install FooConfig.cmake
>anyway and then create a small FindFoo.cmake that just looks for this
>file and loads it.  Then post FindFoo.cmake for your users to copy into
>their projects or for inclusion into CMake.
>
>The key is that the FindFoo.cmake file cannot be distributed as part of
>Foo's distribution because by the time CMake finds it it must have
>already found the project anyway.
>
>-Brad
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>CMake mailing list
>CMake at cmake.org
>http://www.cmake.org/mailman/listinfo/cmake
>


More information about the CMake mailing list