From d401f931d1e04b33df30180a1d5669b18b9d3ccc Mon Sep 17 00:00:00 2001
From: spick <pick@vr.rwth-aachen.de>
Date: Tue, 17 Apr 2012 09:49:35 +0000
Subject: [PATCH] CHG: COPY_EXECUTABLE_TO will now create the specified
 directory if it does not exist

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

diff --git a/VistaCommon.cmake b/VistaCommon.cmake
index a3fd475..310c0d0 100644
--- a/VistaCommon.cmake
+++ b/VistaCommon.cmake
@@ -934,12 +934,19 @@ macro( vista_configure_app _PACKAGE_NAME )
 		set( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )
 	endif()
 	
-	if( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )		
+	if( ${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR )
+		add_custom_command(	TARGET ${_PACKAGE_NAME}
+					POST_BUILD
+					COMMAND ${CMAKE_COMMAND}
+					ARGS -E make_directory "${${_PACKAG_NAME_UPPER}_COPY_EXEC_DIR}"
+					COMMENT "Creating binary target directory"
+		)
+	
 		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"
+					COMMENT "Copying binary to target directory"
 		)
 	endif()
 	
-- 
GitLab