[CMake] Compiling OpenGL application with CMake

Andrea Tagliasacchi ata2 at cs.sfu.ca
Thu Feb 19 20:36:58 EST 2009


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}) *

Hopefully other people will be able to find this solution.
--
Andrea Tagliasacchi
Ph.D. Candidate
School of Computer Science
Simon Fraser University


Try TARGET_LINK_LIBRARIES(mesh_view ${OPENGL_LIBRARIES})
> If it fails to link you can use "make VERBOSE=1" to look at the
> compiler/linker flags.
> --
> Philip Lowman
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090219/8acd473b/attachment.htm>


More information about the CMake mailing list