[CMAKE]
authorColin Finck <colin@reactos.org>
Fri, 13 Jan 2017 16:39:33 +0000 (16:39 +0000)
committerColin Finck <colin@reactos.org>
Fri, 13 Jan 2017 16:39:33 +0000 (16:39 +0000)
Call the NAME_ON_CD parameter RENAME (because it's not tied to a CD/ISO) and simplify the implementation.

svn path=/trunk/; revision=73540

reactos/sdk/cmake/CMakeMacros.cmake

index 5825c91..14e4279 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;NAME_ON_CD;TARGET" "FILE" ${ARGN})
+    cmake_parse_arguments(_ROSTESTS "" "RENAME;SUBDIR;TARGET" "FILE" ${ARGN})
     if(NOT (_ROSTESTS_TARGET OR _ROSTESTS_FILE))
         message(FATAL_ERROR "You must provide a target or a file to install!")
     endif()
@@ -829,22 +829,17 @@ function(add_rostests_file)
         get_target_property(_ROSTESTS_FILE ${_ROSTESTS_TARGET} LOCATION_${CMAKE_BUILD_TYPE})
     endif()
 
+    if(NOT _ROSTESTS_RENAME)
+        get_filename_component(_ROSTESTS_RENAME ${_ROSTESTS_FILE} NAME)
+    endif()
+
     if(_ROSTESTS_SUBDIR)
         set(_ROSTESTS_SUBDIR "/${_ROSTESTS_SUBDIR}")
     endif()
 
-    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)
+    add_cd_file(FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" NAME_ON_CD ${_ROSTESTS_RENAME} FOR all)
 
-        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()
+    if(DEFINED ENV{ROSTESTS_INSTALL})
+        install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests RENAME ${_ROSTESTS_RENAME})
     endif()
-
 endfunction()