[CMake] INSTALL with RENAME

J Decker d3ck0r at gmail.com
Thu May 26 14:57:33 EDT 2011


How do I install a single target as multiple names? (for something like busybox)


------ CMakeLists.txt -----------
cmake_minimum_required(VERSION 2.8)

PROJECT( test )

add_executable( ${PROJECT_NAME} test.c )

install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION . RENAME util_rm.exe )
install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION . RENAME util_ls.exe )
install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION . RENAME util_mv.exe )
install( TARGETS ${PROJECT_NAME} RUNTIME DESTINATION . RENAME util_cp.exe )

------- test.c ----------
#include <stdio.h>

int main( void )
{
   return printf( "I am a utility." );
}
--------------- output  -----------

1>------ Build started: Project: INSTALL, Configuration: Debug Win32 ------
1>  Building Custom Rule M:/tmp/inst_test/CMakeLists.txt
1>  CMake does not need to re-run because
M:\tmp\inst_test\build\CMakeFiles\generate.stamp is up-to-date.
1>  -- Install configuration: "Debug"
1>  -- Installing: M:/tmp/inst_test/buid/test/./test.exe
1>  -- Up-to-date: M:/tmp/inst_test/buid/test/./test.exe
1>  -- Up-to-date: M:/tmp/inst_test/buid/test/./test.exe
1>  -- Up-to-date: M:/tmp/inst_test/buid/test/./test.exe


----------------------------------


More information about the CMake mailing list