changeset 556:5dc4aa684c63

Symlink mozilla executable into the test directory
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 22 May 2014 08:59:13 +0000
parents 4cc378f335f5
children 5cd525fc91de
files ui/tests/CMakeLists.txt
diffstat 1 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ui/tests/CMakeLists.txt	Thu May 22 08:52:10 2014 +0000
+++ b/ui/tests/CMakeLists.txt	Thu May 22 08:59:13 2014 +0000
@@ -73,6 +73,29 @@
    endif()
 
    add_dependencies(nsstest mozilla)
+
+   # NSS code searches the mozilla process in the same path as the caller
+   if (WIN32)
+      file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/mozilla.exe" link)
+      file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/../../cinst/mozilla.exe" target)
+   else()
+      file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/mozilla" link)
+      file(TO_NATIVE_PATH "${CMAKE_CURRENT_BINARY_DIR}/../../cinst/mozilla" target)
+   endif()
+
+   if (NOT EXISTS ${link})
+      if (CMAKE_HOST_UNIX)
+         set(command ln -s ${target} ${link})
+      else()
+         set(command cmd.exe /c mklink ${link} ${target})
+      endif()
+      execute_process(COMMAND ${command}
+         RESULT_VARIABLE result
+         ERROR_VARIABLE output)
+      if (NOT ${result} EQUAL 0)
+         message(FATAL_ERROR "Could not create symbolic link for: ${target} --> ${output}")
+      endif()
+   endif()
 endif()
 
 #add_custom_test(${CMAKE_SOURCE_DIR}/ui/main.cpp "${TRUSTBRIDGE_SOURCES}")

http://wald.intevation.org/projects/trustbridge/