[CMake] install an empty directory

Brad King brad.king at kitware.com
Wed Jul 19 12:51:12 EDT 2006


Brandon J. Van Every wrote:
> David Cole wrote:
>> How about:
>> INSTALL(CODE "MAKE_DIRECTORY(\"lib/chicken/1\")")
>>
> 
> Almost!  Needs a ${CMAKE_INSTALL_PREFIX} qualifier, then it works.
> 
> # Destination for eggs.  No eggs to install though.
> INSTALL(CODE "
>  MESSAGE(STATUS \"Installing ${CMAKE_INSTALL_PREFIX}/lib/chicken/1\")
>  MAKE_DIRECTORY(\"${CMAKE_INSTALL_PREFIX}/lib/chicken/1\")
> ")

Actually to be completely correct you need to account for DESTDIR
installs.  Also you do not want the install prefix or destdir to
evaluate until install time, so you need to escape the $ tokens too:

INSTALL(CODE "
MESSAGE(STATUS \"Installing \${CMAKE_INSTALL_PREFIX}/lib/chicken/1\")
MAKE_DIRECTORY(\"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/lib/chicken/1\")
")


-Brad


More information about the CMake mailing list