]> granicus.if.org Git - check/commitdiff
test_vars: add correct slash if on Unix or MSVC
authorbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 6 Jan 2014 04:41:39 +0000 (04:41 +0000)
committerbrarcher <brarcher@64e312b2-a51f-0410-8e61-82d0ca0eb02a>
Mon, 6 Jan 2014 04:41:39 +0000 (04:41 +0000)
The IS_MSVC variable is only set from CMake, and only if
the platform is MSVC. If it is not set, the Unix slash will
be used.

git-svn-id: svn+ssh://svn.code.sf.net/p/check/code/trunk@1037 64e312b2-a51f-0410-8e61-82d0ca0eb02a

tests/CMakeLists.txt
tests/test_vars.in

index 31d501367c77a360ded13e12079a57036bd07d2e..ad0de9b170e97c399d4cb1082fca41daa1e942bc 100644 (file)
@@ -34,6 +34,7 @@ if(WIN32)
   # slashes because the shell scripts will consume srcdir.
   string(REPLACE "/" "\\\\" srcdir "${srcdir}")
   set(EXEEXT ".exe")
+  set(IS_MSVC "1")
 endif(WIN32)
 
 configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_vars.in
index fd7b67023db81a4e1f75f07b36ea45dc9d62cff7..f3dbf20a96c5e60b3c6f4f2ac103102072f39b9b 100644 (file)
@@ -5,6 +5,16 @@ EXEEXT=@EXEEXT@
 export EXEEXT
 HAVE_FORK=@HAVE_FORK@
 export HAVE_FORK
+
 # path of the tests directory
-SRCDIR=@srcdir@
+if [ x"@srcdir@" != x"." ]; then
+    if [ -z "@IS_MSVC@" ]; then
+       SRCDIR="@srcdir@/"
+    else
+       SRCDIR="@srcdir@\\"
+    fi
+else
+    SRCDIR=""
+fi
+
 export SRCDIR