[CMake] Compiling OpenGL application with CMake

Andrea Tagliasacchi ata2 at cs.sfu.ca
Tue Feb 24 20:48:49 EST 2009


This is a bit odd to me. Why would not everything be required?
Are there situations in which you might not need a package?

Maybe I can answer my own question...

If you have 2 libraries A and B that do the same task maybe you can
use different compile rules like you showed below, while if A is the only
one, then "REQUIRED" gives the trick.

--
Andrea Tagliasacchi


You might want to consider adding the REQUIRED keyword to the find_package()
> command if the package is absolutely essential to compiling your entire
> project.  It should yield a far more useful error message if the package is
> not found.
> If you don't declare a package REQUIRED, a good rule of thumb is to use
> conditionals keyed on the CMake module's found variable (e.g OPENGL_FOUND )
> to control where you use it.
> *find_package(Foo)
> if(FOO_FOUND)
>    include_directories(${FOO_INCLUDE_DIR})
> endif()
> *
> --
> Philip Lowman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090224/c3b4ebbf/attachment.htm>


More information about the CMake mailing list