[PATCH] Symlink mozilla executable into the test directory

Wald Commits scm-commit at wald.intevation.org
Thu May 22 10:59:17 CEST 2014


# HG changeset patch
# User Andre Heinecke <aheinecke at intevation.de>
# Date 1400749153 0
# Node ID 5dc4aa684c63e192c76d58e883d40f1f5389722c
# Parent  4cc378f335f5f8f5bedcd07bc36f18f7b4ee3e4d
Symlink mozilla executable into the test directory

diff -r 4cc378f335f5 -r 5dc4aa684c63 ui/tests/CMakeLists.txt
--- 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}")


More information about the Trustbridge-commits mailing list