[vtkusers] cmake option for post-build?

Andy Cedilnik andy.cedilnik at kitware.com
Wed May 15 07:19:28 EDT 2002


Hi Steve,

There is an ADD_CUSTOM_COMMAND. This is how I use it:

  SET(COMMON_LIB_SUFFIX ${CMAKE_SHLIB_SUFFIX})
  SET(COMMON_LIB_PREFIX "lib")
  IF(WIN32)
    IF(NOT CYGWIN)
      SET(COMMON_LIB_PREFIX "")
      SET(COMMON_LIB_SUFFIX ".dll")
    ENDIF(NOT CYGWIN)
  ENDIF(WIN32)
  SET(COMMON_LIB_NAME  
      ${COMMON_LIB_PREFIX}vtkCommonTCL${COMMON_LIB_SUFFIX})

  ADD_CUSTOM_COMMAND(
        SOURCE vtkCommonTCL
        COMMAND ${CCOMMAND_COMMAND}
        ARGS copy
        ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${COMMON_LIB_NAME}
        /somePath/${COMMON_LIB_NAME}
        TARGET vtkCommonTCL )

This will copy the common library to the new location after it is being
rebuild. Please note that it works on *NIX and MS Windows. Some key
features:

It determines what the library name is including prefix and sufix, when
using MS Visual Studio it takes into an account whether it is Debug or
Release...

			Andy

On Wed, 2002-05-15 at 05:52, Steve Boyd wrote:
> Hello,
> 
> Is there a Cmake option that will set a post-build command such as
> moving libraries to appropriate directories?
> 
> By the way, I've recently been using Cmake on WinNT with VC++ and find
> it to be fantastic!





More information about the vtkusers mailing list