[vtk-developers] RE: [Cmake] CMake command issue

Miller, James V (Research) millerjv at crd.ge.com
Tue Aug 13 20:46:36 EDT 2002


I think it would be nice to be able to distinguish between a 
builtin CMake command and a macro.

How about DEFINE_MACRO() and CALL_MACRO()

Now it looks likes your ASSERT macro is asserting that the
WIN32 CMake dodad is defined.  How would I define the macro
to assert that a CMake variable is defined?  Can I define a 
macro that takes in a predicate?

INVOKE_MACRO(ASSERT ${HAVE_OPENGL}==YES "You need OpenGL")

Jim


-----Original Message-----
From: Ken Martin [mailto:ken.martin at kitware.com]
Sent: Tuesday, August 13, 2002 8:53 AM
To: Cmake at Public. Kitware. Com
Cc: Vtk-Developers at Public. Kitware. Com
Subject: [Cmake] CMake command issue


Hey Folk,

A quick question. I am adding macros/procedures to CMake because a few
people have asked for them and they are very easy to implement. My
question is on syntax. For example, consider the following simple
example:

MACRO(ASSERT value message)
  IF (NOT ${value})
    MESSAGE(${message})
  ENDIF (NOT ${value})
ENDMACRO(ASSERT)

My question is which of the following two invocations would be better?

ASSERT(WIN32 "we are not on windows")

or

INVOKE_MACRO(ASSERT WIN32 "we are not on windows")

The first is easier to read, looks and smells like a regular command.
The down side is that someone might confuse it for a regular command
(I guess C and C++ have the same issue)  The second format is a little
less clean, but it is clear that you are invoking a macro. Thoughts?

Thanks
Ken


--------------------------
Ken Martin, PhD
Kitware Inc.
518 371-3971 x101
469 Clifton Corporate Pkwy.
Clifton Park, NY 12065

_______________________________________________
Cmake mailing list
Cmake at public.kitware.com
http://public.kitware.com/mailman/listinfo/cmake



More information about the vtk-developers mailing list