[CMake] Enhancement of FIND_PACKAGE

Filipe Sousa filipe at ipb.pt
Fri Jan 27 09:09:49 EST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Filipe Sousa wrote:
> Hi!
> 
> I'm thinking we could extend REQUIRED parameter from FIND_PACKAGE to be
> more specific. Some packages have a lot of libraries and we may not need
> all them. Something link FIND_PACKAGE(Qt4 REQUIRED GUI XML SQL) should
> define Qt4_FIND_REQUIRED-GUI, Qt4_FIND_REQUIRED-XML and
> Qt4_FIND_REQUIRED-SQL.
> 
> What do you think?
> 

I made a patch that seems to work

- --
Filipe Sousa
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)

iD8DBQFD2imtbQdNYqwwwCwRAgEJAKCKdUQuzyEsENgwcQQmcCkZDjej6QCfdxtL
861ujJ8mcowhCkhYzlGMF2c=
=cQAL
-----END PGP SIGNATURE-----
-------------- next part --------------
Index: cmFindPackageCommand.cxx
===================================================================
RCS file: /cvsroot/CMake/CMake/Source/cmFindPackageCommand.cxx,v
retrieving revision 1.15
diff -u -r1.15 cmFindPackageCommand.cxx
--- cmFindPackageCommand.cxx	18 Mar 2005 15:41:40 -0000	1.15
+++ cmFindPackageCommand.cxx	27 Jan 2006 14:07:19 -0000
@@ -75,6 +75,12 @@
       else if(args[i] == "REQUIRED")
         {
         required = true;
+        ++i;
+        while (i < args.size() && args[i] != "QUIET")
+          {
+          std::string req_var = Name + "_FIND_REQUIRED-" + args[i++];
+          m_Makefile->AddDefinition(req_var.c_str(), "1");
+          }
         }
       else
         {


More information about the CMake mailing list