[Cmake] CMakeCommand feature (+ ccommand)
Sebastien BARRE
sebastien.barre at kitware.com
Mon Mar 25 16:03:47 EST 2002
At 3/18/2002 10:38 AM, Bill Hoffman wrote:
>Actually, the ELSE is not required either.
>
>This is all that is required:
>
> ADD_CUSTOM_COMMAND(
> SOURCE vtkXY
> COMMAND ${CCOMMAND_COMMAND}
> ARGS copy
> ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${MY_LIB_NAME}
> ${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/vtkXY.pvm
> TARGET vtkXY )
>
>CMAKE_CFG_INTDIR is either $(IntDir) which is expanded by msdev, or .
>for non-msdev build environments.
Actually you also need the extension of the source file (".dll" for WIN32
for example).
This extension is stored in the CMAKE_SHLIB_SUFFIX variable.
Which leads us:
ADD_CUSTOM_COMMAND(
SOURCE vtkXY
COMMAND ${CCOMMAND_COMMAND}
ARGS copy
${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/${MY_LIB_NAME}${CMAKE_SHLIB_SUFFIX}
${EXECUTABLE_OUTPUT_PATH}/${CMAKE_CFG_INTDIR}/vtkXY.pvm
TARGET vtkXY )
You will need today's CVS version of CMake to achieve that result when
CMake works in .NET or MSDEV mode. Borland and Nmake mode are fine already.
The cmSystemTools::cmCopyFile() function has been upgraded.
- the second arg can be a directory (the name of the source file will be
appended to it)
- the destination directory is created (as well as any other
intermediate directory)
ccommand usage is now:
CMake Error: cmake version 1.3
Usage: ccommand [command] [arguments ...]
Available commands:
copy file destination - copy file to destination (either file or directory)
remove file1 file2 ... - remove the file(s)
--
Sebastien Barre
More information about the CMake
mailing list