[CMake] INSTALL(FILES ... ) and $(OutDir)

David Cole david.cole at kitware.com
Tue Nov 18 07:09:31 EST 2008


Looks like your definition of GDCM_LIBRARY_DIR must include
"${CMAKE_CFG_INTDIR}". You can't use that in an install rule... rather use
"\${BUILD_TYPE}" (with an escaped dollar sign) like in the VTK install
rules...

BUILD_TYPE is defined in a cmake_install.cmake file to qualify which
configuration is being installed. (Look at the command line given to cpack
from a Visual Studio build to understand this...) Why the inconsistency
originally, I do not know, but changing it now would be backwards
incompatible if done the easy way. If you have a good suggestion for how to
make it more consistent in a backwards compatible way, I'm all ears.

HTH,
David


On Tue, Nov 18, 2008 at 5:33 AM, Mathieu Malaterre <
mathieu.malaterre at gmail.com> wrote:

> Hi there,
>
>  I am confused on how to use install(files...) with VS 2008 IDE. Here
> is what I wrote:
>
> <cmake>
>  ADD_CUSTOM_COMMAND(
>    OUTPUT ${GDCM_LIBRARY_DIR}/gdcm_csharp.dll
>    COMMAND ${CMAKE_CSHARP_COMPILER} ARGS "/t:library"
> "/out:${GDCM_LIBRARY_DIR}/gdcm_csharp.dll" "*.cs"
>    WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
>    DEPENDS "${swig_generated_file_fullname}"
>      ${CMAKE_CURRENT_BINARY_DIR}/AssemblyInfo.cs
>    COMMENT "csc *.cs"
>  )
>
> ...
>
>  # because gdcm_csharp.dll is constructed with custom commands, it
> need the INSTALL(FILES signature:
>  INSTALL(FILES "${GDCM_LIBRARY_DIR}/gdcm_csharp.dll"
>    DESTINATION ${GDCM_INSTALL_LIB_DIR} COMPONENT Runtime
>  )
> </cmake>
>
> but I am getting:
>
> 1>CMake Error at Wrapping/Csharp/cmake_install.cmake:61 (FILE):
> 1>  file INSTALL cannot find file
> 1>
>  "C:/cygwin/home/mmalaterre/Projects/gdcm/tags/release-2010-vs2008/bin/$(OutDir)/gdcm_csharp.dll"
> 1>  to install.
> 1>Call Stack (most recent call first):
> 1>  Wrapping/cmake_install.cmake:33 (INCLUDE)
> 1>  cmake_install.cmake:42 (INCLUDE)
> 1>CPack Error: Error when generating package: GDCM
> 1>Project : error PRJ0019: A tool returned an error code from
> "Performing Post-Build Event..."
> 1>Build log was saved at
>
> "file://c:\cygwin\home\mmalaterre\Projects\gdcm\tags\release-2010-vs2008\PACKAGE.dir\Release\BuildLog.htm"
> 1>PACKAGE - 1 error(s), 0 warning(s)
>
> Thank you !
> --
> Mathieu
> _______________________________________________
> CMake mailing list
> CMake at cmake.org
> http://www.cmake.org/mailman/listinfo/cmake
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20081118/0503f22c/attachment-0001.htm>


More information about the CMake mailing list