On Thu, Feb 19, 2009 at 8:36 PM, Andrea Tagliasacchi <a...@cs.sfu.ca> wrote:

> Thanks Philip,
>
> that worked flawlessly!
>
> I would say that *this* is the most compact CMake specification to compile
>
> a Glut/OpenGL application then:
>
> *find_package(GLUT)
> find_package(OpenGL)
> INCLUDE_DIRECTORIES(${OPENGL_INCLUDE_DIR})
> ADD_EXECUTABLE(mesh_view mesh_view.cpp)
> TARGET_LINK_LIBRARIES(mesh_view ${OPENGL_LIBRARIES} ${GLUT_LIBRARIES}) *


Yes, that's pretty much all you should need to get started.

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
_______________________________________________
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

Reply via email to