[CMakeMacros.cmake] - Add NAME_ON_CD parameter to add_rostests_file to make it possib...
authorGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 13 Jan 2017 15:15:55 +0000 (15:15 +0000)
committerGiannis Adamopoulos <gadamopoulos@reactos.org>
Fri, 13 Jan 2017 15:15:55 +0000 (15:15 +0000)
svn path=/trunk/; revision=73537

reactos/sdk/cmake/CMakeMacros.cmake

index 0afd329..5825c91 100644 (file)
@@ -820,7 +820,7 @@ endfunction()
 
 add_custom_target(rostests_install COMMAND ${CMAKE_COMMAND} -DCOMPONENT=rostests -P ${CMAKE_BINARY_DIR}/cmake_install.cmake)
 function(add_rostests_file)
-    cmake_parse_arguments(_ROSTESTS "" "SUBDIR;TARGET" "FILE" ${ARGN})
+    cmake_parse_arguments(_ROSTESTS "" "SUBDIR;NAME_ON_CD;TARGET" "FILE" ${ARGN})
     if(NOT (_ROSTESTS_TARGET OR _ROSTESTS_FILE))
         message(FATAL_ERROR "You must provide a target or a file to install!")
     endif()
@@ -833,9 +833,18 @@ function(add_rostests_file)
         set(_ROSTESTS_SUBDIR "/${_ROSTESTS_SUBDIR}")
     endif()
 
-    add_cd_file(FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" FOR all)
+    if(_ROSTESTS_NAME_ON_CD)
+        add_cd_file(FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" NAME_ON_CD ${_ROSTESTS_NAME_ON_CD} FOR all)
 
-    if(DEFINED ENV{ROSTESTS_INSTALL})
-        install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests)
+        if(DEFINED ENV{ROSTESTS_INSTALL})
+            install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests RENAME${_ROSTESTS_NAME_ON_CD})
+        endif()
+    else()
+        add_cd_file(FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" FOR all)
+
+        if(DEFINED ENV{ROSTESTS_INSTALL})
+            install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests)
+        endif()
     endif()
+
 endfunction()