2010/5/15 Tyler Roscoe <[email protected]>

> [...]
> On Sat, May 15, 2010 at 05:53:45PM +0200, Baptiste Lepilleur wrote:
> > Alternatively, is it possible to delay variable expansion until the
> > cmake_install.cmake script is invoked?
>
> I think what I use to solve this problem (can't check right now) is
> \${CMAKE_BUILD_TYPE}. This sticks "${CMAKE_BUILD_TYPE}" into
> cmake_install.cmake, which is then correctly interpreted at install
> time.
>

Thanks, the \${VAR} trick works great to delay variable expansion. Though,
CMAKE_BUILD_TYPE also expand to an empty variable. Using either BUILD_TYPE
or CMAKE_INSTALL_CONFIG_NAME variable works. I think I'm going to stick with
CMAKE_INSTALL_CONFIG_NAME since the script go through great length to make
sure it is initialized. Though none of those variables are documented.

So the final installation command that install the library in a matching
sub-directory matching the configuration used in the IDE is:

install(TARGETS unrar_lib
    RUNTIME DESTINATION bin/\${CMAKE_INSTALL_CONFIG_NAME}
    ARCHIVE DESTINATION lib/\${CMAKE_INSTALL_CONFIG_NAME}
    LIBRARY DESTINATION lib/\${CMAKE_INSTALL_CONFIG_NAME}
)

Baptiste.


>  tyler
>
_______________________________________________
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