From f04d5e62f87894c6bed02ce6617f2a56fd78e990 Mon Sep 17 00:00:00 2001 From: Ralf Habacker Date: Tue, 14 Jan 2014 20:12:36 +0100 Subject: [PATCH] Give cmake users some hints/requirements when cross compiling for Windows on Linux. --- cmake/CMakeLists.txt | 5 +++++ cmake/modules/Macros.cmake | 21 +++++++++++++++++++++ 2 Dateien geändert, 26 Zeilen hinzugefügt(+) diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index c8a6834..fd6c525 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 545f2e5..13223a8 100644 --- a/cmake/modules/Macros.cmake +++ b/cmake/modules/Macros.cmake @@ -1,3 +1,24 @@ +if(DBUS_BUILD_TESTS AND CMAKE_CROSSCOMPILING AND CMAKE_SYSTEM_NAME STREQUAL "Windows") + if(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") + find_file(WINE_EXECUTABLE wine_) + if(EXISTS /proc/sys/fs/binfmt_misc/DOSWin) + set(HAVE_BINFMT_WINE_SUPPORT 1) + endif() + + if(WINE_EXECUTABLE AND HAVE_BINFMT_WINE_SUPPORT) + MESSAGE(STATUS "The requirements to run cross compiled applications on your host system are achieved.\nYou 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) -- 1.7.10.4