From 9dc18220400d9a6f4fe3e65ba73d77f4844d249a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?P=C5=99emysl=20Janouch?=
Date: Mon, 20 Dec 2010 05:20:21 +0100
Subject: Fix problems discovered while testing on Windows.
* Set the working directory for glib-genmarshal correctly.
* Use one more path suffix when searching for glibconfig.h.
* Don't assume that gdk_screen_get_resolution() returns
a useful value.
---
CMakeLists.txt | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
(limited to 'CMakeLists.txt')
diff --git a/CMakeLists.txt b/CMakeLists.txt
index aba8443..fc9bfc6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -123,7 +123,16 @@ function (glib_genmarshal base prefix)
set (command_base ${GLIB_GENMARSHAL_EXECUTABLE}
--prefix ${prefix} "${base_name}.list")
- # NOTE: VERBATIM may cause problems, so it is not used here
+ # On Windows, the final makefile may contain:
+ # cd e:\abc && ...
+ # That won't actually change the directory. We have to do:
+ # cd e:\abc && e: && ...
+ if (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]")
+ string (SUBSTRING "${base_path}" 0 2 base_drive)
+ set (command_base "${base_drive}" && "${command_base}")
+ endif (WIN32 AND "${base_path}" MATCHES "^.:[/\\\\]")
+
+ # NOTE: VERBATIM would cause problems, so it is not used here
add_custom_command (OUTPUT ${base}.c
COMMAND ${command_base} --body > "${base_name}.c"
DEPENDS "${base}.list"
--
cgit v1.2.3