[CMAKE] Avoid generator expresisons in install()'s RENAME argument. CORE-14509
authorThomas Faber <thomas.faber@reactos.org>
Mon, 2 Apr 2018 07:57:51 +0000 (09:57 +0200)
committerThomas Faber <thomas.faber@reactos.org>
Mon, 2 Apr 2018 08:07:38 +0000 (10:07 +0200)
This fixes rostests_install, and thus hopefully WHS-Testbot.

sdk/cmake/CMakeMacros.cmake

index c2b3f37..020ccc4 100644 (file)
@@ -855,14 +855,15 @@ function(add_rostests_file)
         message(FATAL_ERROR "You must provide a target or a file to install!")
     endif()
 
+    set(_ROSTESTS_NAME_ON_CD "${_ROSTESTS_RENAME}")
     if(NOT _ROSTESTS_FILE)
         set(_ROSTESTS_FILE "$<TARGET_FILE:${_ROSTESTS_TARGET}>")
         if(NOT _ROSTESTS_RENAME)
-            set(_ROSTESTS_RENAME "$<TARGET_FILE_NAME:${_ROSTESTS_TARGET}>")
+            set(_ROSTESTS_NAME_ON_CD "$<TARGET_FILE_NAME:${_ROSTESTS_TARGET}>")
         endif()
     else()
         if(NOT _ROSTESTS_RENAME)
-            get_filename_component(_ROSTESTS_RENAME ${_ROSTESTS_FILE} NAME)
+            get_filename_component(_ROSTESTS_NAME_ON_CD ${_ROSTESTS_FILE} NAME)
         endif()
     endif()
 
@@ -871,12 +872,16 @@ function(add_rostests_file)
     endif()
 
     if(_ROSTESTS_TARGET)
-        add_cd_file(TARGET ${_ROSTESTS_TARGET} FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" NAME_ON_CD ${_ROSTESTS_RENAME} FOR all)
+        add_cd_file(TARGET ${_ROSTESTS_TARGET} FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" NAME_ON_CD ${_ROSTESTS_NAME_ON_CD} FOR all)
     else()
-        add_cd_file(FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" NAME_ON_CD ${_ROSTESTS_RENAME} FOR all)
+        add_cd_file(FILE ${_ROSTESTS_FILE} DESTINATION "reactos/bin${_ROSTESTS_SUBDIR}" NAME_ON_CD ${_ROSTESTS_NAME_ON_CD} FOR all)
     endif()
 
     if(DEFINED ENV{ROSTESTS_INSTALL})
-        install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests RENAME ${_ROSTESTS_RENAME})
+        if(_ROSTESTS_RENAME)
+            install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests RENAME ${_ROSTESTS_RENAME})
+        else()
+            install(FILES ${_ROSTESTS_FILE} DESTINATION "$ENV{ROSTESTS_INSTALL}${_ROSTESTS_SUBDIR}" COMPONENT rostests)
+        endif()
     endif()
 endfunction()