summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Freutsmiedl <markus.freutsmiedl@partner.bmw.de>2014-04-11 18:11:50 +0200
committerMarkus Freutsmiedl <markus.freutsmiedl@partner.bmw.de>2014-04-11 18:12:17 +0200
commitc2fc1997d458ad96db44453ae3771640e6fc5e2b (patch)
tree98e410ca6131274d2d18995ec7044ba8c6cec5ef
parentc65f551cd7ed799d0aafd5de8584c98236f65de6 (diff)
downloadgenivi-common-api-dbus-runtime-c2fc1997d458ad96db44453ae3771640e6fc5e2b.tar.gz
Project settings in project files reworked.
Additional information added for windows part in readme.
-rw-r--r--CommonAPI-DBus.vcxproj8
-rw-r--r--README48
-rw-r--r--UnitTests.vcxproj15
3 files changed, 54 insertions, 17 deletions
diff --git a/CommonAPI-DBus.vcxproj b/CommonAPI-DBus.vcxproj
index 94b0e1a..3176711 100644
--- a/CommonAPI-DBus.vcxproj
+++ b/CommonAPI-DBus.vcxproj
@@ -39,8 +39,7 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <IncludePath>$(ProjectDir)\src;..\ascgit017.CommonAPI\src;$(DBUS_DIR);$(DBUS_BUILD_DIR);$(IncludePath)</IncludePath>
- <LibraryPath>..\ascgit017.CommonAPI\Debug;$(LibraryPath)</LibraryPath>
+ <TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
@@ -51,15 +50,15 @@
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
<DebugInformationFormat>OldStyle</DebugInformationFormat>
<DisableSpecificWarnings>4996;%(DisableSpecificWarnings)</DisableSpecificWarnings>
+ <AdditionalIncludeDirectories>$(COMMONAPI_DIR)\src;$(DBUS_BUILD_DIR);$(DBUS_DIR);$(SolutionDir)\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalDependencies>CommonAPI.dll;dbus-1d.dll;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProgramFiles)\dbus\bin\;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>/VERBOSE %(AdditionalOptions)</AdditionalOptions>
</Link>
<Lib>
- <AdditionalDependencies>CommonAPI.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies>
</Lib>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -69,6 +68,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
+ <AdditionalIncludeDirectories>$(COMMONAPI_DIR)\src;$(DBUS_BUILD_DIR);$(DBUS_DIR);$(SolutionDir)\src;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<GenerateDebugInformation>true</GenerateDebugInformation>
diff --git a/README b/README
index 284f852..bc5fb08 100644
--- a/README
+++ b/README
@@ -72,6 +72,31 @@ For example, if CommonAPI and patched dbus are available in /usr/local, set the
----
# export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"
----
+To build the Windows version of the dbus following steps have to be done:
+# Download dbus from http://www.freedesktop.org/wiki/Software/dbus/ e.g. dbus-1.8.0.tar.gz
+ Unpack the archive into a directory
+# For building the dbus cmake is needed. Download cmake from http://cmake.org/cmake/resources/software.html
+ Downloading the zip archive is ok e.g. cmake-2.8.12.2-win32-x86.zip
+ Unpack the archive into a directory
+# For building the dbus expat is needed. Expat can be downloaded from http://expat.sourceforge.net/
+ e.g. Download expat-win32bin-2.1.0.exe from http://sourceforge.net/projects/expat/files/expat_win32/2.1.0/
+ Install expat
+# For patching the dbus patch is needed. Download patch from http://gnuwin32.sourceforge.net/packages/patch.htm e.g. patch-2.5.9-7-setup.exe
+ Install patch
+# Install dbus patch
+ e.g. <patch_to_patch>\patch.exe -p1 < <patch_to_CommonAPI-D-Bus>\dbus-DBusMessage-add-support-for-custom-marshaling.patch
+# Build dbus via the cmake command line tool
+ Open the developer command line for VS2013
+ Change into root directory of the unpacked dbus archive e.g. dbus-1.8.0
+ Create a new directory dbus-build-dir e.g. mkdir dbus-build-dir
+ Change into this new created directory e.g. cd dbus-build-dir
+ Create the Visual Studio files for building the dbus:
+ cmake -DEXPAT_INCLUDE_DIR="<expat-path>\Source\lib" -DEXPAT_LIBRARY="<expat-path>\Bin\libexpat.lib" -G "Visual Studio 12" <DBusSourcenPath>\cmake
+ e.g. C:\Work\cmake-2.8.12.2-win32-x86\bin\cmake.exe -DEXPAT_INCLUDE_DIR="C:\Program Files (x86)\Expat 2.1.0\Source\lib"
+ -DEXPAT_LIBRARY="C:\Program Files (x86)\Expat 2.1.0\Bin\libexpat.lib" -G "Visual Studio 12" C:\Work\dbus-1.8.0\cmake
+ The Visual Studio files are created in the directory dbus-build-dir
+ Open the solution dbus.sln and build all projects
+ Info for dbus-1.8.0: In file printf.c the #include "test-utils.h" must be changed to #include "test/test-utils.h"
=== Instructions
Use autotools to build this package withthe above requirements available through Pkgconfig :
@@ -81,12 +106,16 @@ Use autotools to build this package withthe above requirements available through
# make
# sudo make install (or alternative install process, eg. checkinstall on debian-based distributions, such as Ubuntu)
----
-To build the Windows version with Visual Studio, you can use the solution file CommonAPI-DBus.sln. It is configured to build CommonAPI-DBus as a static library.
-Set the environment variable DBUS_DIR to the directory containing your patched DBus sources.
-Set the environment variable DBUS_BUILD_DIR to the directory containing your built DBus.
-Add the path of CommonAPI.lib to "Additional Library Directories"
+To build the Windows version with Visual Studio 2013, you can use the solution file CommonAPI-DBus.sln. It is configured to build CommonAPI-DBus as a static library.
+Before opening the solution file CommonAPI-DBus.sln the following environment variables must be set:
+DBUS_DIR: directory containing the patched DBus sources e.g. <path_to_folder>\dbus-1.8.0
+DBUS_BUILD_DIR: directory containing the build DBus e.g. <path_to_folder>\dbus-1.8.0\dbus-build-dir
+COMMONAPI_DIR: directory containing the CommonAPI e.g. <path_to_folder>\ascgit017.CommonAPI
-To run the tests, you need to add the location of your built dbus-1d.dll to the PATH environment variable
+To run the tests, you need to add the location of your built dbus-1d.dll to the PATH environment variable.
+Please note:
+For building the tests the environment variable GTEST must be set (see README of CommonAPI).
+Furthermore the files DemoPoll.h and DemoPoll.cpp are needed (part of gnulib).
== Linking against CommonAPI-D-Bus
@@ -108,6 +137,15 @@ Generated proxies and stubs also require successful activation of all static ini
If they are provided in either a static or dynamic library to the application they must also be linked wrapped in the
flags described above.
+For linking the proxies and stubs on Windows notice the following information:
+# In case an error C4996 occurs disable this warning via the project settings
+# Following code must be added to the file containing the call CommonAPI::Runtime::load():
+ #define COMMONAPI_INTERNAL_COMPILATION
+ #include <CommonAPI/DBus/DBusRuntime.h>
+ After loading of the runtime (std::shared_ptr<CommonAPI::Runtime> runtime = CommonAPI::Runtime::load();) following code must be added:
+ // access the middlewareInfo in order to get a call to DBusRuntime. This forces the windows linker not to remove DBusRuntime from resulting binary
+ std::cout << "Middleware Name: " << CommonAPI::DBus::DBusRuntime::middlewareInfo_.middlewareName_ << std::endl;
+
=== Building and executing the Unit Tests
----
# export GTEST_CONFIG=/path/to/gtest-1.6.0/scripts/gtest-config
diff --git a/UnitTests.vcxproj b/UnitTests.vcxproj
index ff2528c..5c5ad0e 100644
--- a/UnitTests.vcxproj
+++ b/UnitTests.vcxproj
@@ -156,9 +156,7 @@
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
- <LibraryPath>$(DBUS_BUILD_DIR)\bin\Debug;$(GTEST)\msvc\gtest\Debug;..\ascgit017.CommonAPI\Debug;$(SolutionDir)\Debug;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86)</LibraryPath>
- <IncludePath>$(DBUS_DIR);$(DBUS_BUILD_DIR);$(ProjectDir);$(SolutionDir)\src\test;$(SolutionDir)\src;..\ascgit017.CommonAPI\src;$(GTEST)\include;$(VC_IncludePath);$(WindowsSDK_IncludePath)</IncludePath>
- <SourcePath>$(SourcePath)</SourcePath>
+ <TargetName>$(ProjectName)d</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>true</LinkIncremental>
@@ -168,7 +166,7 @@
<PrecompiledHeader>NotUsing</PrecompiledHeader>
<WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization>
- <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(DBUS_DIR);$(DBUS_BUILD_DIR);$(SolutionDir)\src;$(SolutionDir)\src\test;$(COMMONAPI_DIR)\src;$(GTEST)\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>ENABLE_ATTRIBUTE_EXTENSIONS;WIN32;COMMONAPI_INTERNAL_COMPILATION;_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<ShowIncludes>true</ShowIncludes>
@@ -177,8 +175,8 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
- <AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
- <AdditionalDependencies>CommonAPI-DBus.lib;gtestd.lib;gtest_maind.lib;dbus-1d.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <AdditionalLibraryDirectories>$(DBUS_BUILD_DIR)\bin\Debug;$(GTEST)\msvc\gtest-md\Debug;$(COMMONAPI_DIR)\Debug;$(SolutionDir)\Debug;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>CommonAPId.lib;CommonAPI-DBusd.lib;gtestd.lib;gtest_main-mdd.lib;dbus-1d.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -188,7 +186,7 @@
<Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
- <AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <AdditionalIncludeDirectories>$(DBUS_DIR);$(DBUS_BUILD_DIR);$(SolutionDir)\src;$(SolutionDir)\src\test;$(COMMONAPI_DIR)\src;$(GTEST)\include;$(VCInstallDir)UnitTest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
</ClCompile>
@@ -197,7 +195,8 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
- <AdditionalLibraryDirectories>$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(DBUS_BUILD_DIR)\bin\Release;$(GTEST)\msvc\gtest-md\Release;$(COMMONAPI_DIR)\Release;$(SolutionDir)\Release;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalDependencies>CommonAPI.lib;CommonAPI-DBus.lib;gtest.lib;gtest_main-md.lib;dbus-1.lib;Ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />