diff options
author | Ralf Habacker <ralf.habacker@freenet.de> | 2014-01-14 20:12:36 +0100 |
---|---|---|
committer | Ralf Habacker <ralf.habacker@freenet.de> | 2014-01-21 21:09:55 +0100 |
commit | c39722e286c006f570eaedf4bea9b07b7aa671e0 (patch) | |
tree | ac3200a710e054509e742adc90159ef6f07f1c11 /cmake | |
parent | 469ef6e082f04990a90b549049faeb73947d2ce8 (diff) | |
download | dbus-c39722e286c006f570eaedf4bea9b07b7aa671e0.tar.gz |
Give cmake users some hints/requirements when cross compiling for Windows on Linux.
Bug: https://bugs.freedesktop.org/show_bug.cgi?id=41252
Reviewed-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Diffstat (limited to 'cmake')
-rw-r--r-- | cmake/CMakeLists.txt | 5 | ||||
-rw-r--r-- | cmake/modules/Macros.cmake | 26 |
2 files changed, 31 insertions, 0 deletions
diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c8a68345..fd6c5250 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -597,6 +597,11 @@ endif(NOT DBUS_DISABLE_ASSERT) if (DBUS_DISABLE_CHECKS) message("NOTE: building without checks for arguments passed to public API makes it harder to debug apps using D-BUS, but will slightly decrease D-BUS library size and _very_ slightly improve performance.") endif(DBUS_DISABLE_CHECKS) + +foreach(_note ${FOOTNOTES}) + message(${_note}) +endforeach() + MESSAGE(" ") INCLUDE(modules/CPackInstallConfig.cmake) diff --git a/cmake/modules/Macros.cmake b/cmake/modules/Macros.cmake index 545f2e58..fd3f62c4 100644 --- a/cmake/modules/Macros.cmake +++ b/cmake/modules/Macros.cmake @@ -1,3 +1,29 @@ +if(DBUS_BUILD_TESTS AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows") + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + find_file(WINE_EXECUTABLE + NAMES wine + PATHS /usr/bin /usr/local/bin + NO_CMAKE_FIND_ROOT_PATH + ) + find_file(HAVE_BINFMT_WINE_SUPPORT + NAMES DOSWin wine Wine windows Windows + PATHS /proc/sys/fs/binfmt_misc + NO_SYSTEM_PATH NO_CMAKE_FIND_ROOT_PATH + ) + if(WINE_EXECUTABLE AND HAVE_BINFMT_WINE_SUPPORT) + list(APPEND FOOTNOTES "NOTE: The requirements to run cross compiled applications on your host system are achieved. You may run 'make check'.") + endif() + if(NOT WINE_EXECUTABLE) + list(APPEND FOOTNOTES "NOTE: You may install the Windows emulator 'wine' to be able to run cross compiled test applications.") + endif() + if(NOT HAVE_BINFMT_WINE_SUPPORT) + list(APPEND FOOTNOTES "NOTE: You may activate binfmt_misc support for wine to be able to run cross compiled test applications.") + endif() + else() + list(APPEND FOOTNOTES "NOTE: You will not be able to run cross compiled applications on your host system.") + endif() +endif() + MACRO(TIMESTAMP RESULT) if (CMAKE_HOST_SYSTEM_NAME STREQUAL "Windows") EXECUTE_PROCESS(COMMAND "cmd" " /C date /T" OUTPUT_VARIABLE DATE) |