I'm trying to write some MESSAGE() wrappers like info(), warning(),
fatal(), etc which may be a bit easier to use. But I failed to simulate the
correct MESSAGE() behavior no matter I use MACRO or FUNCTION. For example:

  MACRO(info_mac_1)
      message("[MACRO 1] " ${ARGV})
  ENDMACRO()
  MACRO(info_mac_2)
      message("[MACRO 2] " "${ARGV}")
  ENDMACRO()
  FUNCTION(info_fun_1)
      message("[FUNC 1] " ${ARGV})
  ENDFUNCTION()
  FUNCTION(info_fun_2)
      message("[FUNC 2] " "${ARGV}")
  ENDFUNCTION()

  message("foo;bar")
  info_mac_1("foo;bar")

  message(foo bar)
  info_mac_2(foo bar)

  message("foo;bar")
  info_fun_1("foo;bar")

  message(foo bar)
  info_fun_2(foo bar)

The output (tested with 2.8.8) would be like this:

  foo;bar
  [MACRO 1] foobar
  foobar
  [MACRO 2] foo;bar
  foo;bar
  [FUNC 1] foobar
  foobar
  [FUNC 2] foo;bar

As you can see all the 4 commands I defined did not work the same way as
MESSAGE(). So how should I define a correct wrapper on MESSAGE()?

Thanks.

-Clark
--

Powered by www.kitware.com

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to