From: Romain Pokrzywka Date: Mon, 29 Mar 2010 23:44:57 +0000 (-0700) Subject: update WinCE cmake support X-Git-Tag: dbus-1.3.1~62^2~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4708efeebbac8a6345811e38da86961155e2b4ae;p=platform%2Fupstream%2Fdbus.git update WinCE cmake support --- diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index 1bae290..266eed5 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -114,50 +114,28 @@ endif (UNIX AND NOT DBUS_DISABLE_ASSERTS) SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG") ######################################################################### -# Windows CE +# Windows CE (>= 5.0.0) # -# usage: -# cmake ..\trunk\cmake -Dwince=1 -Dwcelibcex=c:\wcelibcex +# WinCE support now relies on the presence of platform files, found in cmake/modules/platform +# Cmake 2.8.0 doesn't include WinCE platform files by default, but working ones can be found +# on CMake's bugtracker : +# http://public.kitware.com/Bug/view.php?id=7919 # -# change configuration in Visual Studio to 'Pocket PC 2003 (ARMV4)' +# for cmake 2.8.0 get the following patch only : +# http://public.kitware.com/Bug/file_download.php?file_id=2944&type=bug # -if(wince) - project(${CMAKE_PROJECT_NAME}-wince) - # don't forget parameters - set(wince 1 CACHE TYPE STRING FORCE) - set(wcelibcex ${wcelibcex} CACHE TYPE STRING FORCE) - - include_directories(${wcelibcex}/include/wcelibcex ${wcelibcex}/src) - - add_definitions( -# see config.h.cmake -# -DDBUS_WINCE - -DWINCE - -DWIN32_PLATFORM_PSPC - -D_WINDOWS - -D_UNICODE - -DUNICODE - -DPOCKETPC2003_UI_MODEL - ) - - # Windows CE Version - add_definitions( - -D_WIN32_WCE=0x420 - -DWIN32_PLATFORM_PSPC=0x420 - -DUNDER_CE=0x420 - ) - - # Architecture - add_definitions( - -DARM - -D_ARM_ - ) - - set(CMAKE_CXX_STANDARD_LIBRARIES "coredll.lib corelibc.lib ole32.lib oleaut32.lib uuid.lib commctrl.lib ws2.lib") - - set(CMAKE_SHARED_LINKER_FLAGS "/subsystem:windowsce,4.20 /machine:THUMB") - -endif(wince) +# after applying the patch, you can enable the WinCE build by specifying : +# cmake [...] -DCMAKE_SYSTEM_NAME=WinCE -DCMAKE_SYSTEM_VERSION=X.XX +# (where X.XX is your actual WinCE version, e.g. 5.02 for Windows Mobile 6) +# +# Note that you should have a proper cross-compilation environment set up prior to running +# cmake, ie. the PATH, INCLUDE and LIB env vars pointing to your CE SDK/toolchain. +# +if(WINCE) + +MESSAGE("Building for WinCE (${CMAKE_SYSTEM_VERSION})") + +endif(WINCE) ######################################################################### diff --git a/cmake/dbus/CMakeLists.txt b/cmake/dbus/CMakeLists.txt index 57c499f..52cbf90 100644 --- a/cmake/dbus/CMakeLists.txt +++ b/cmake/dbus/CMakeLists.txt @@ -198,6 +198,14 @@ if (WIN32) ${DBUS_DIR}/dbus-spawn-win.c ${DBUS_DIR}/dbus-sysdeps-util-win.c ) + if(WINCE) + set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES} + ${DBUS_DIR}/dbus-sysdeps-wince-glue.c + ) + set (DBUS_SHARED_HEADERS ${DBUS_SHARED_HEADERS} + ${DBUS_DIR}/dbus-sysdeps-wince-glue.h + ) + endif(WINCE) else (WIN32) set (DBUS_SHARED_SOURCES ${DBUS_SHARED_SOURCES} ${DBUS_DIR}/dbus-file-unix.c @@ -256,7 +264,11 @@ add_library(dbus-1 SHARED ${DBUS_LIB_HEADERS} ${DBUS_SHARED_HEADERS}) if(WIN32) - target_link_libraries(dbus-1 ws2_32 advapi32 netapi32) + if(WINCE) + target_link_libraries(dbus-1 ws2) + else(WINCE) + target_link_libraries(dbus-1 ws2_32 advapi32 netapi32) + endif(WINCE) endif(WIN32) install_targets(/lib dbus-1 ) @@ -275,7 +287,11 @@ add_library(dbus-internal ${DBUS_INTERNAL_ADD_LIBRARY_OPTIONS} target_link_libraries(dbus-internal) set_target_properties(dbus-internal PROPERTIES COMPILE_FLAGS ${DBUS_INTERNAL_LIBRARY_DEFINITIONS}) if(WIN32) - target_link_libraries(dbus-internal ws2_32 advapi32 netapi32) + if(WINCE) + target_link_libraries(dbus-internal ws2) + else(WINCE) + target_link_libraries(dbus-internal ws2_32 advapi32 netapi32) + endif(WINCE) endif(WIN32) if (DBUS_BUILD_TESTS)