[Cmake] cmake newbie questions

Andy Cedilnik andy.cedilnik at kitware.com
Fri Jan 31 10:18:14 EST 2003


Hi Edward,


On Thu, 2003-01-30 at 14:55, Edward Zdankiewicz wrote:
> To the cmake mailing list
> When adding a layer to an already complicated tool chain (a c/c++ build
> system) in an open source project that will always be suffering in the
> documentation department you need to provide a simple print or echo feature
> to the cmake tool. A way to echo 'I am here's or dump the contents of a
> variable would be extremely useful.

Try:

MESSAGE("I am here")

> my specific difficulty is in finding the glut package. GLUT_FOUND passes the
> if test but the /I statement in the makefiles does not have an entry for the
> gl stuff. I do get /I statements for the xerces and bugly2: If I manually
> add /usr/include/GL to the include directories statement and remove the
> ${GLUT_INCLUDE_PATH} the makefiles will work.
> INCLUDE (${CMAKE_ROOT}/Modules/FindGLUT.cmake)
> 
> IF (GLUT_FOUND)
> 
> INCLUDE_DIRECTORIES(/usr/include/xercesc ${GLUT_INCLUDE_PATH}
> /usr/include/bugly2)
> 
> ELSE (GLUT_FOUND)
> 
> INCLUDE_DIRECTORIES(/usr/include/bugly)
> 
> ENDIF(GLUT_FOUND)
> 
> 
> also:
> How does one force a line into a makefile? I would love to add a simple line
> like:
> VPATH = linux_objs
> into the make files and setting things in the cache doesn't do it, and using
> SET in the cmakelist.txt doesn't do it. I want to be able to mimic the
> Visual studio approach of subdirectories for the object files, to make the
> task of packing up source distributions easier.

CMake does not use VPATHs, since it hardcodes all the paths to
Makefiles. So, it does support out of source build by itself.

> How does one control builds on linux with the debug options? I see in the
> cache where -g is defined as a CMAKE_ debug flag, but I do not see a -g
> option anywhere in the resulting makefiles so I am not sure how to turn this
> on or off. Where does this show up?

If you want -g to be added to C flags, just modify CMAKE_C_FLAGS. For
C++ use CMAKE_CXX_FLAGS.

				Andy




More information about the CMake mailing list