On 18. Nov, 2009, at 7:25 , David Manura wrote:

On Fri, Nov 13, 2009 at 3:58 AM, Michael Wild wrote:
Something like this just came up recently:
http://www.cmake.org/pipermail/cmake/2009-October/032725.html

That would be better than nothing, though it does have a limitation in
that you cannot wrap a function more than once.

Well, that shouldn't be necessary. If you need to do different things for different sub-projects, you can stuff it all in the same wrapping and use an external variable to determine which behavior is used. Along these lines:


function(install)
  if(CUSTOM_INSTALL_SWITCH STREQUAL A)
    # some code for case A
  elseif(CUSTOM_INSTALL_SWITCH STREQUAL B)
    # some code for case B
  endif()
  _install(${ARGN}
endfunction()

set(CUSTOM_INSTALL_SWITCH A)
add_subdirectory(projectA)

set(CUSTOM_INSTALL_SWITCH B)
add_subdirectory(projectB)
_______________________________________________
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