From fe339408cefb51023cae8a7fd3def2a4b8a75a65 Mon Sep 17 00:00:00 2001
From: "Mark Palange (Mani)" <palange@lindenlab.com>
Date: Tue, 28 Jul 2009 18:03:28 -0700
Subject: [PATCH] DEV-35399 - Making the server build llcommon.dll compatible.
 Fixing up string escaping on calls to RunBuildTest.cmake Also added ilasm.bat
 to the FindMono.cmake search

---
 indra/cmake/FindMono.cmake       |  2 +-
 indra/cmake/LLAddBuildTest.cmake | 14 +++++++-------
 indra/test/CMakeLists.txt        |  2 +-
 3 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/indra/cmake/FindMono.cmake b/indra/cmake/FindMono.cmake
index c36d7259e89..d956c48656a 100644
--- a/indra/cmake/FindMono.cmake
+++ b/indra/cmake/FindMono.cmake
@@ -42,7 +42,7 @@ FIND_PROGRAM (GACUTIL_EXECUTABLE gacutil
              /usr/local/bin
 )
 FIND_PROGRAM (ILASM_EXECUTABLE
-             ilasm
+             NAMES ilasm.bat ilasm
              NO_DEFAULT_PATH
              PATHS "$ENV{PROGRAMFILES}/Mono-1.9.1/bin" "$ENV{PROGRAMFILES}/Mono-1.2.6/bin" /bin /usr/bin /usr/local/bin
 )
diff --git a/indra/cmake/LLAddBuildTest.cmake b/indra/cmake/LLAddBuildTest.cmake
index 0c6ddef50f3..aa77bbac65d 100644
--- a/indra/cmake/LLAddBuildTest.cmake
+++ b/indra/cmake/LLAddBuildTest.cmake
@@ -114,7 +114,8 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
     GET_TARGET_PROPERTY(TEST_EXE PROJECT_${project}_TEST_${name} LOCATION)
     SET(TEST_OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/PROJECT_${project}_TEST_${name}_ok.txt)
     SET(TEST_CMD ${TEST_EXE} --touch=${TEST_OUTPUT} --sourcedir=${CMAKE_CURRENT_SOURCE_DIR})
-    # daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
+
+	# daveh - what configuration does this use? Debug? it's cmake-time, not build time. + poppy 2009-04-19
     IF(LL_TEST_VERBOSE)
       MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_cmd  = ${TEST_CMD}")
     ENDIF(LL_TEST_VERBOSE)
@@ -125,18 +126,17 @@ MACRO(LL_ADD_PROJECT_UNIT_TESTS project sources)
       set(LD_LIBRARY_PATH ${ARCH_PREBUILT_DIRS}:/usr/lib)
     ENDIF(WINDOWS)
 
-    SET(TEST_SCRIPT_CMD 
-      ${CMAKE_COMMAND} 
-      -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}
-      -DTEST_CMD:STRING="${TEST_CMD}" 
-      -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
-      )
     IF(LL_TEST_VERBOSE)
       MESSAGE(STATUS "LL_ADD_PROJECT_UNIT_TESTS ${name} test_script  = ${TEST_SCRIPT_CMD}")
     ENDIF(LL_TEST_VERBOSE)
     # Add test 
     ADD_CUSTOM_COMMAND(
         OUTPUT ${TEST_OUTPUT}
+		COMMAND ${CMAKE_COMMAND} 
+		ARGS
+		  -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}
+		  "-DTEST_CMD:STRING=\"${TEST_CMD}\""
+		  -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
         COMMAND ${TEST_SCRIPT_CMD}
         DEPENDS PROJECT_${project}_TEST_${name}
         WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
diff --git a/indra/test/CMakeLists.txt b/indra/test/CMakeLists.txt
index 7ccd554be4e..e596151591e 100644
--- a/indra/test/CMakeLists.txt
+++ b/indra/test/CMakeLists.txt
@@ -157,7 +157,7 @@ ADD_CUSTOM_COMMAND(
   COMMAND ${CMAKE_COMMAND}
   ARGS
     -DLD_LIBRARY_PATH=${LD_LIBRARY_PATH}
-    -DTEST_CMD:STRING="${TEST_CMD}" 
+    "-DTEST_CMD:STRING=\"${TEST_CMD}\"" 
     -P ${CMAKE_SOURCE_DIR}/cmake/RunBuildTest.cmake
       
   DEPENDS test
-- 
GitLab