From c0f751ca79b91783772c30393b3b0e19c2b5a7c0 Mon Sep 17 00:00:00 2001
From: drausch <dominik.rausch@rwth-aachen.de>
Date: Wed, 28 Mar 2012 17:41:26 +0000
Subject: [PATCH] FIX: last commit broke ordering in configure_app

git-svn-id: https://svn.rwth-aachen.de/repos/vrgroup-svn/projects/VistaCMakeCommon/trunk@29741 33c38b33-09d2-4561-8d4d-1bfa2f58f885
---
 VistaCommon.cmake | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/VistaCommon.cmake b/VistaCommon.cmake
index 911ae55..9579e04 100644
--- a/VistaCommon.cmake
+++ b/VistaCommon.cmake
@@ -812,21 +812,6 @@ macro( vista_configure_app _PACKAGE_NAME )
 		endif()
 	endif()
 	
-		
-	if( "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}" STREQUAL "${${_PACKAGE_NAME_UPPER}_TARGET_OUTDIR}" )
-		# prevent copying to same location
-		set( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )
-	endif()
-	
-	if( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )		
-		add_custom_command( TARGET ${_PACKAGE_NAME}
-                    POST_BUILD
-                    COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${_PACKAGE_NAME}>" "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}"
-					COMMAND ${CMAKE_COMMAND} -E copy_if_different "${${_PACKAGE_NAME_UPPER}_SET_PATH_SCRIPT}" "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}"
-					COMMENT "Copying executable"
-		)
-	endif()
-	
 	# we store the dependencies as required
 	set( ${_PACKAGE_NAME_UPPER}_DEPENDENCIES ${VISTA_TARGET_DEPENDENCIES} CACHE INTERNAL "" FORCE )
 	set( ${_PACKAGE_NAME_UPPER}_FULL_DEPENDENCIES ${VISTA_TARGET_FULL_DEPENDENCIES} CACHE INTERNAL "" FORCE )
@@ -900,8 +885,23 @@ macro( vista_configure_app _PACKAGE_NAME )
 		endif( WIN32 )
 	endif( VISTA_TARGET_LINK_DIRS )
 
+	# set up copying of executable after build
 	set( ${_PACKAGE_NAME_UPPER}_TARGET_MSVC_PROJECT "" CACHE INTERNAL "" FORCE )
 	
+		if( "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}" STREQUAL "${${_PACKAGE_NAME_UPPER}_TARGET_OUTDIR}" )
+		# prevent copying to same location
+		set( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )
+	endif()
+	
+	if( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )		
+		add_custom_command( TARGET ${_PACKAGE_NAME}
+                    POST_BUILD
+                    COMMAND ${CMAKE_COMMAND} -E copy "$<TARGET_FILE:${_PACKAGE_NAME}>" "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}"
+					COMMAND ${CMAKE_COMMAND} -E copy_if_different "${${_PACKAGE_NAME_UPPER}_SET_PATH_SCRIPT}" "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}"
+					COMMENT "Copying executable"
+		)
+	endif()
+	
 	#if we're usign MSVC, we set up a *.vcproj.user file
 	if( MSVC )
 		if( MSVC10 )
-- 
GitLab