8 commits - cmake/modules libkolabxml/CMakeLists.txt libkolabxml/compiled libkolabxml/lib libkolabxml/tests

Christian Mollekopf mollekopf at kolabsys.com
Wed Mar 28 00:50:33 CEST 2012


 cmake/modules/FindKolabInternal.cmake     |   51 ++++++++++++++++++++++++++++++
 libkolabxml/CMakeLists.txt                |    4 +-
 libkolabxml/compiled/XMLParserWrapper.cpp |    1 
 libkolabxml/lib/CMakeLists.txt            |   17 ++++------
 libkolabxml/lib/base64.cpp                |    1 
 libkolabxml/lib/global_definitions.h      |    2 -
 libkolabxml/lib/incidence_p.h             |    1 
 libkolabxml/lib/kolabcontact.h            |    1 
 libkolabxml/lib/kolabcontainers.cpp       |   11 ++----
 libkolabxml/lib/kolabcontainers.h         |    9 ++---
 libkolabxml/lib/kolabconversions.h        |    1 
 libkolabxml/lib/kolabevent.cpp            |    1 
 libkolabxml/lib/kolabjournal.cpp          |    1 
 libkolabxml/lib/kolabnote.cpp             |    1 
 libkolabxml/lib/kolabtodo.cpp             |    1 
 libkolabxml/lib/php/CMakeLists.txt        |    2 -
 libkolabxml/lib/python/CMakeLists.txt     |    2 -
 libkolabxml/lib/shared_conversions.h      |    1 
 libkolabxml/lib/utils.cpp                 |    1 
 libkolabxml/lib/xcardconversions.h        |    1 
 libkolabxml/tests/CMakeLists.txt          |   27 +++++----------
 libkolabxml/tests/bindingstest.cpp        |    1 
 22 files changed, 83 insertions(+), 55 deletions(-)

New commits:
commit 104f10bdc47115024cfa667eae53ac9b2511f7ae
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Wed Mar 28 02:41:52 2012 +0200

    do not skip rpath, include boost-directories, find uuid library with different name

diff --git a/libkolabxml/CMakeLists.txt b/libkolabxml/CMakeLists.txt
index ae8b503..946c93a 100644
--- a/libkolabxml/CMakeLists.txt
+++ b/libkolabxml/CMakeLists.txt
@@ -13,14 +13,17 @@ if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND
     cmake_policy(SET CMP0017 NEW)
 endif()
 
-# Do not use RPATH
-set(CMAKE_SKIP_RPATH ON)
 include( ../cmake/modules/FindKolabInternal.cmake )
 
-find_package(Boost COMPONENTS thread REQUIRED)
+set(Boost_USE_MULTITHREADED ON)
+find_package(Boost REQUIRED COMPONENTS thread)
+if (Boost_FOUND)
+    message("Found boost in ${Boost_INCLUDE_DIRS}")
+    include_directories(${Boost_INCLUDE_DIRS})
+endif (Boost_FOUND)
 
 if (${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.42)
-    find_library(UUID NAMES uuid)
+    find_library(UUID NAMES ossp-uuid uuid)
     if(UUID)
         message("uuid found")
     else (UUID)


commit 5afd73a3aae0500388037b206e1a7d64c034dc6e
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Mar 27 04:16:50 2012 +0200

    added missing include

diff --git a/libkolabxml/lib/utils.cpp b/libkolabxml/lib/utils.cpp
index 0a17efa..fb5f10b 100644
--- a/libkolabxml/lib/utils.cpp
+++ b/libkolabxml/lib/utils.cpp
@@ -16,6 +16,7 @@
 */
 
 #include "utils.h"
+#include <iostream>
 #include <string>
 
 #include <boost/version.hpp>


commit 48b210113876a97ad88b9d456112c4142ed1eb5d
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Mar 27 04:16:41 2012 +0200

    Install PHP/Python wrappers into their correct locations

diff --git a/libkolabxml/lib/php/CMakeLists.txt b/libkolabxml/lib/php/CMakeLists.txt
index 2d95c36..7cfc5c7 100644
--- a/libkolabxml/lib/php/CMakeLists.txt
+++ b/libkolabxml/lib/php/CMakeLists.txt
@@ -28,9 +28,14 @@ SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
 
 configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
 
-install(TARGETS phpbindings LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
+if (KOLAB_PHP_INSTALL_DIR)
+    set(PHP_INSTALL_DIR ${KOLAB_PHP_INSTALL_DIR})
+else (KOLAB_PHP_INSTALL_DIR)
+    set(PHP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
+endif (KOLAB_PHP_INSTALL_DIR)
+
+install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
 
 install( FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
-  test.php
-  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
\ No newline at end of file
+  DESTINATION ${PHP_INSTALL_DIR})
\ No newline at end of file
diff --git a/libkolabxml/lib/python/CMakeLists.txt b/libkolabxml/lib/python/CMakeLists.txt
index 397405c..7f0cdd1 100644
--- a/libkolabxml/lib/python/CMakeLists.txt
+++ b/libkolabxml/lib/python/CMakeLists.txt
@@ -1,4 +1,4 @@
-#Generate Python wrapper
+# Generate Python wrapper
 include_directories(../)
 
 set(KOLAB_SWIG_PYTHON_SOURCE_FILE python_kolabformat_wrapper.cpp)
@@ -13,7 +13,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_PYTHON_SOURCE
 SET_SOURCE_FILES_PROPERTIES(${KOLAB_SWIG_PYTHON_SOURCE_FILE} PROPERTIES GENERATED 1)
 ADD_CUSTOM_TARGET(generate_python_bindings ALL DEPENDS ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
 
-#Compile Python Bindings
+# Compile Python Bindings
 find_package(PythonLibs)
 include_directories(${PYTHON_INCLUDE_DIRS})
 
@@ -26,9 +26,14 @@ SET_TARGET_PROPERTIES(pythonbindings PROPERTIES PREFIX "")
 
 configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
 
-install(TARGETS pythonbindings LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
+if (KOLAB_PYTHON_INSTALL_DIR)
+    set(PYTHON_INSTALL_DIR ${KOLAB_PYTHON_INSTALL_DIR})
+else (KOLAB_PYTHON_INSTALL_DIR)
+    set(PYTHON_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
+endif (KOLAB_PYTHON_INSTALL_DIR)
+
+install(TARGETS pythonbindings LIBRARY DESTINATION ${PYTHON_INSTALL_DIR})
 
 install( FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.py
-  test.py
-  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
\ No newline at end of file
+  DESTINATION ${PYTHON_INSTALL_DIR})
\ No newline at end of file


commit 77c69732acb5e7146a44a5a8ffa38d7e3c2c6253
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Mar 27 04:16:16 2012 +0200

    Fixed missing newlines

diff --git a/libkolabxml/compiled/XMLParserWrapper.cpp b/libkolabxml/compiled/XMLParserWrapper.cpp
index dffff8d..96e859c 100644
--- a/libkolabxml/compiled/XMLParserWrapper.cpp
+++ b/libkolabxml/compiled/XMLParserWrapper.cpp
@@ -292,4 +292,4 @@ xml_schema::dom::auto_ptr<xercesc::DOMDocument> XMLParserWrapper::parse(std::ist
     }
     eh.reset();
     return xml_schema::dom::auto_ptr<xercesc::DOMDocument>();
-}
\ No newline at end of file
+}
diff --git a/libkolabxml/lib/base64.cpp b/libkolabxml/lib/base64.cpp
index 071b05c..2a863d1 100644
--- a/libkolabxml/lib/base64.cpp
+++ b/libkolabxml/lib/base64.cpp
@@ -120,4 +120,4 @@ std::string base64_decode(std::string const& encoded_string) {
   }
 
   return ret;
-}
\ No newline at end of file
+}
diff --git a/libkolabxml/lib/incidence_p.h b/libkolabxml/lib/incidence_p.h
index 5f2dc12..8602feb 100644
--- a/libkolabxml/lib/incidence_p.h
+++ b/libkolabxml/lib/incidence_p.h
@@ -62,4 +62,4 @@ namespace Kolab {
     
 }
 
-#endif
\ No newline at end of file
+#endif
diff --git a/libkolabxml/lib/kolabevent.cpp b/libkolabxml/lib/kolabevent.cpp
index 07b4bb0..81cb077 100644
--- a/libkolabxml/lib/kolabevent.cpp
+++ b/libkolabxml/lib/kolabevent.cpp
@@ -335,4 +335,4 @@ std::vector< Alarm > Event::alarms() const
 
 
 
-}
\ No newline at end of file
+}
diff --git a/libkolabxml/lib/kolabjournal.cpp b/libkolabxml/lib/kolabjournal.cpp
index f13633b..ce37fbc 100644
--- a/libkolabxml/lib/kolabjournal.cpp
+++ b/libkolabxml/lib/kolabjournal.cpp
@@ -188,4 +188,4 @@ std::vector< CustomProperty > Journal::customProperties() const
 }
 
 
-}//Namespace
\ No newline at end of file
+}//Namespace
diff --git a/libkolabxml/lib/kolabtodo.cpp b/libkolabxml/lib/kolabtodo.cpp
index 97d2e03..ceefcf9 100644
--- a/libkolabxml/lib/kolabtodo.cpp
+++ b/libkolabxml/lib/kolabtodo.cpp
@@ -324,4 +324,4 @@ std::vector< Alarm > Todo::alarms() const
     return d->alarms;
 }
 
-}
\ No newline at end of file
+}
diff --git a/libkolabxml/lib/shared_conversions.h b/libkolabxml/lib/shared_conversions.h
index fd64ae5..8b42256 100644
--- a/libkolabxml/lib/shared_conversions.h
+++ b/libkolabxml/lib/shared_conversions.h
@@ -119,4 +119,4 @@ std::string fromContactReference(const Kolab::ContactReference &c, bool embeddNa
     } //Namespace
 } //Namespace
 
-#endif
\ No newline at end of file
+#endif
diff --git a/libkolabxml/lib/utils.cpp b/libkolabxml/lib/utils.cpp
index 8096f54..0a17efa 100644
--- a/libkolabxml/lib/utils.cpp
+++ b/libkolabxml/lib/utils.cpp
@@ -245,4 +245,4 @@ std::string fromMailto(const std::string &mailtoUri)
 
 } //Namespace
 
-} //Namespace
\ No newline at end of file
+} //Namespace


commit 2aed02d7b9e24f2f101acb451a7d0bcc6f386f36
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Mar 27 04:15:13 2012 +0200

    Bring the automakefiles back to the state the were.

diff --git a/Makefile.am b/Makefile.am
index d0c5114..71ff93f 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,6 +16,7 @@ EXTRA_DIST = \
 	INSTALL \
 	NEWS \
 	README \
+	cmake/modules/*.cmake \
 	$(PACKAGE).spec \
 	$(PACKAGE).spec.in
 
diff --git a/kolab-libs.spec.in b/kolab-libs.spec.in
index 58f5450..7e5d4c9 100644
--- a/kolab-libs.spec.in
+++ b/kolab-libs.spec.in
@@ -13,13 +13,13 @@ URL:            http://www.kolab.org
 Source0:        http://git.kolab.org/libkolabxml/snapshot/%{name}-%{version}.tar.gz
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
-# Does not build for RHEL 5, because of kdepimlibs-devel requirement
 %if 0%{?rhel} < 6 && 0%{?fedora} < 15
-BuildRequires:  boost141-devel >= 1.4.1
+BuildRequires:  boost141-devel
 %else
-BuildRequires:  boost-devel >= 1.4.1
+BuildRequires:  boost-devel
 %endif
 BuildRequires:  cmake >= 2.6
+BuildRequires:  e2fsprogs-devel
 BuildRequires:  gcc-c++
 %if 0%{?rhel} > 6 || 0%{?fedora} >= 16
 BuildRequires:  kdelibs-devel
@@ -32,6 +32,9 @@ BuildRequires:  php-devel >= 5.3
 BuildRequires:  python-devel
 BuildRequires:  qt-devel >= 3
 BuildRequires:  swig
+#%if 0%{?rhel} <= 6 || 0%{?fedora} < 15
+#BuildRequires:  uuid-devel
+#%endif
 BuildRequires:  xerces-c-devel
 BuildRequires:  xsd
 #Requires:       
@@ -72,27 +75,35 @@ bindings provided through libkolabxml.
 
 %build
 %configure
-%if 0%{?rhel} < 6 && 0%{?fedora} < 15
-export BOOST_INCLUDEDIR=/usr/include/boost141/
-%endif
 
 make %{?_smp_mflags}
 
-%install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT
-
-# Workaround for https://issues.kolab.org/643
-%ifnarch %{ix86}
-mv %{buildroot}/%{_exec_prefix}/lib %{buildroot}/%{_libdir}
+pushd libkolabxml
+rm -rf build
+mkdir -p build
+pushd build
+%{cmake} -Wno-fatal-errors -Wno-errors \
+    -DCMAKE_SKIP_RPATH=ON \
+%if 0%{?rhel} <= 6 && 0%{?fedora} < 15
+    -DBOOST_LIBRARYDIR=%{_libdir}/boost141 \
+    -DBOOST_INCLUDEDIR=%{_includedir}/boost141 \
+    -DBoost_ADDITIONAL_VERSIONS="1.41;1.41.0" \
 %endif
+    -DPYTHON_INCLUDE_DIRS=%{python_include} \
+    -DKOLAB_PYTHON_INSTALL_DIR=%{python_sitearch} \
+    -DKOLAB_PHP_INSTALL_DIR=%{php_extdir} \
+    ..
+make 
+popd
+popd
+
+%install
+rm -rf %{buildroot}
+make install DESTDIR=%{buildroot}
 
-# Workaround for https://issues.kolab.org/644
-mkdir -p %{buildroot}/%{php_extdir}/
-mv `find %{buildroot}/ -type d -name phpbindings`/*kolabformat* %{buildroot}/%{php_extdir}/.
-mkdir -p %{buildroot}/%{python_sitearch}/
-mv `find %{buildroot}/ -type d -name pythonbindings`/*kolabformat* %{buildroot}/%{python_sitearch}/.
-rm -rf %{buildroot}/home
+pushd libkolabxml/build
+make install DESTDIR=%{buildroot}
+popd
 
 #%check
 #export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/c++/build/lib
@@ -104,7 +115,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc c++/README DEVELOPMENT INSTALL
+%doc DEVELOPMENT INSTALL
 %{_libdir}/*.so.*
 
 %files devel
@@ -119,7 +130,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -n pykolab-format
 %defattr(-,root,root,-)
-%{python_sitearch}/pykolab
+%{python_sitelib}/pykolab
 %{python_sitearch}/kolabformat.py*
 %{python_sitearch}/_kolabformat.so
 
diff --git a/libkolabxml/Makefile.am b/libkolabxml/Makefile.am
index 13d0dae..d26ae0c 100644
--- a/libkolabxml/Makefile.am
+++ b/libkolabxml/Makefile.am
@@ -29,13 +29,4 @@ EXTRA_DIST = \
 	tests/testfiles/ \
 	$(wildcard tests/testfiles/*.xml)
 
-all:
-	@rm -rf build/
-	@mkdir -p build/
-	@cd build/; cmake \
-		-DCMAKE_INSTALL_PREFIX=$(prefix) \
-		..; make
-
-install:
-	make -C build/ install
 


commit 35159381a80588a821449b2054a8c4c15fe425f6
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Tue Mar 27 03:36:39 2012 +0200

    Revert "Fix typo"
    
    This reverts commit 61fbb2d4d532b1c59749b5f17b456228a7134ef8.
    
    Conflicts:
    
    	kolab-libs.spec.in

diff --git a/Makefile.am b/Makefile.am
index 71ff93f..d0c5114 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -16,7 +16,6 @@ EXTRA_DIST = \
 	INSTALL \
 	NEWS \
 	README \
-	cmake/modules/*.cmake \
 	$(PACKAGE).spec \
 	$(PACKAGE).spec.in
 
diff --git a/cmake/modules/FindKolabInternal.cmake b/cmake/modules/FindKolabInternal.cmake
new file mode 100644
index 0000000..fb9d6a5
--- /dev/null
+++ b/cmake/modules/FindKolabInternal.cmake
@@ -0,0 +1,51 @@
+
+# The install directory is defined by the CMAKE_INSTALL_PREFIX which defaults to /usr/local if not specified.
+# To install i.e. to /usr use "cmake -DCMAKE_INSTALL_PREFIX=/usr ."
+#
+# The library directory suffix (64/32) is detected automatically based on the available directories in CMAKE_INSTALL_PREFIX
+# The Result of this can be overridden by setting KOLAB_LIB_INSTALL_DIR "cmake -DKOLAB_LIB_INSTALL_DIR=/usr/lib64/ ."
+#
+# The runtime install is controlled by KOLAB_BIN_INSTALL_DIR
+# The header install is controlled by KOLAB_HEADER_INSTALL_DIR
+#
+# KOLAB_INSTALL_DIRECTORIES contains the determined install directories and should be used with install commands
+
+get_property(LIB64 GLOBAL PROPERTY FIND_LIBRARY_USE_LIB64_PATHS)
+
+if (${LIB64} STREQUAL "TRUE")
+    find_path(LIB32FOUND "${CMAKE_INSTALL_PREFIX}/lib32")
+    find_path(LIB64FOUND "${CMAKE_INSTALL_PREFIX}/lib64")
+    if (LIB64FOUND)
+        set(LIBSUFFIX 64)
+    else()
+        set(LIBSUFFIX "")
+    endif()
+else()
+    set(LIBSUFFIX "")
+endif()
+
+if(KOLAB_LIB_INSTALL_DIR)
+    message("KOLAB_LIB_INSTALL_DIR specified manually")
+else()
+    set(KOLAB_LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIBSUFFIX}")
+endif()
+message("KOLAB_LIB_INSTALL_DIR: ${KOLAB_LIB_INSTALL_DIR}")
+
+if(KOLAB_BIN_INSTALL_DIR)
+    message("KOLAB_BIN_INSTALL_DIR specified manually")
+else()
+    set(KOLAB_BIN_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/bin")
+endif()
+message("KOLAB_BIN_INSTALL_DIR: ${KOLAB_BIN_INSTALL_DIR}")
+
+set(KOLAB_INSTALL_DIRECTORIES  RUNTIME DESTINATION "${KOLAB_BIN_INSTALL_DIR}"
+                                  LIBRARY DESTINATION "${KOLAB_LIB_INSTALL_DIR}"
+                                  ARCHIVE DESTINATION "${KOLAB_LIB_INSTALL_DIR}" COMPONENT Devel )
+
+
+if(KOLAB_HEADER_INSTALL_DIR)
+    message("KOLAB_HEADER_INSTALL_DIR specified manually")
+else()
+    set(KOLAB_HEADER_INSTALL_DIR  "${CMAKE_INSTALL_PREFIX}/include/kolab")
+endif()
+message("KOLAB_HEADER_INSTALL_DIR: ${KOLAB_HEADER_INSTALL_DIR}")
diff --git a/kolab-libs.spec.in b/kolab-libs.spec.in
index 7e5d4c9..58f5450 100644
--- a/kolab-libs.spec.in
+++ b/kolab-libs.spec.in
@@ -13,13 +13,13 @@ URL:            http://www.kolab.org
 Source0:        http://git.kolab.org/libkolabxml/snapshot/%{name}-%{version}.tar.gz
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
+# Does not build for RHEL 5, because of kdepimlibs-devel requirement
 %if 0%{?rhel} < 6 && 0%{?fedora} < 15
-BuildRequires:  boost141-devel
+BuildRequires:  boost141-devel >= 1.4.1
 %else
-BuildRequires:  boost-devel
+BuildRequires:  boost-devel >= 1.4.1
 %endif
 BuildRequires:  cmake >= 2.6
-BuildRequires:  e2fsprogs-devel
 BuildRequires:  gcc-c++
 %if 0%{?rhel} > 6 || 0%{?fedora} >= 16
 BuildRequires:  kdelibs-devel
@@ -32,9 +32,6 @@ BuildRequires:  php-devel >= 5.3
 BuildRequires:  python-devel
 BuildRequires:  qt-devel >= 3
 BuildRequires:  swig
-#%if 0%{?rhel} <= 6 || 0%{?fedora} < 15
-#BuildRequires:  uuid-devel
-#%endif
 BuildRequires:  xerces-c-devel
 BuildRequires:  xsd
 #Requires:       
@@ -75,35 +72,27 @@ bindings provided through libkolabxml.
 
 %build
 %configure
+%if 0%{?rhel} < 6 && 0%{?fedora} < 15
+export BOOST_INCLUDEDIR=/usr/include/boost141/
+%endif
 
 make %{?_smp_mflags}
 
-pushd libkolabxml
-rm -rf build
-mkdir -p build
-pushd build
-%{cmake} -Wno-fatal-errors -Wno-errors \
-    -DCMAKE_SKIP_RPATH=ON \
-%if 0%{?rhel} <= 6 && 0%{?fedora} < 15
-    -DBOOST_LIBRARYDIR=%{_libdir}/boost141 \
-    -DBOOST_INCLUDEDIR=%{_includedir}/boost141 \
-    -DBoost_ADDITIONAL_VERSIONS="1.41;1.41.0" \
-%endif
-    -DPYTHON_INCLUDE_DIRS=%{python_include} \
-    -DKOLAB_PYTHON_INSTALL_DIR=%{python_sitearch} \
-    -DKOLAB_PHP_INSTALL_DIR=%{php_extdir} \
-    ..
-make 
-popd
-popd
-
 %install
-rm -rf %{buildroot}
-make install DESTDIR=%{buildroot}
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT
+
+# Workaround for https://issues.kolab.org/643
+%ifnarch %{ix86}
+mv %{buildroot}/%{_exec_prefix}/lib %{buildroot}/%{_libdir}
+%endif
 
-pushd libkolabxml/build
-make install DESTDIR=%{buildroot}
-popd
+# Workaround for https://issues.kolab.org/644
+mkdir -p %{buildroot}/%{php_extdir}/
+mv `find %{buildroot}/ -type d -name phpbindings`/*kolabformat* %{buildroot}/%{php_extdir}/.
+mkdir -p %{buildroot}/%{python_sitearch}/
+mv `find %{buildroot}/ -type d -name pythonbindings`/*kolabformat* %{buildroot}/%{python_sitearch}/.
+rm -rf %{buildroot}/home
 
 #%check
 #export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:%{_builddir}/%{name}-%{version}/c++/build/lib
@@ -115,7 +104,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc DEVELOPMENT INSTALL
+%doc c++/README DEVELOPMENT INSTALL
 %{_libdir}/*.so.*
 
 %files devel
@@ -130,7 +119,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files -n pykolab-format
 %defattr(-,root,root,-)
-%{python_sitelib}/pykolab
+%{python_sitearch}/pykolab
 %{python_sitearch}/kolabformat.py*
 %{python_sitearch}/_kolabformat.so
 
diff --git a/libkolabxml/CMakeLists.txt b/libkolabxml/CMakeLists.txt
index 7016972..ae8b503 100644
--- a/libkolabxml/CMakeLists.txt
+++ b/libkolabxml/CMakeLists.txt
@@ -13,15 +13,14 @@ if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 7 AND
     cmake_policy(SET CMP0017 NEW)
 endif()
 
-find_package(Boost REQUIRED COMPONENTS thread-mt)
+# Do not use RPATH
+set(CMAKE_SKIP_RPATH ON)
+include( ../cmake/modules/FindKolabInternal.cmake )
 
-if (Boost_FOUND)
-    message("Found boost in ${Boost_INCLUDE_DIRS}")
-    include_directories(${Boost_INCLUDE_DIRS})
-endif (Boost_FOUND)
+find_package(Boost COMPONENTS thread REQUIRED)
 
 if (${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.42)
-    find_library(UUID NAMES ossp-uuid uuid)
+    find_library(UUID NAMES uuid)
     if(UUID)
         message("uuid found")
     else (UUID)
diff --git a/libkolabxml/Makefile.am b/libkolabxml/Makefile.am
index d26ae0c..13d0dae 100644
--- a/libkolabxml/Makefile.am
+++ b/libkolabxml/Makefile.am
@@ -29,4 +29,13 @@ EXTRA_DIST = \
 	tests/testfiles/ \
 	$(wildcard tests/testfiles/*.xml)
 
+all:
+	@rm -rf build/
+	@mkdir -p build/
+	@cd build/; cmake \
+		-DCMAKE_INSTALL_PREFIX=$(prefix) \
+		..; make
+
+install:
+	make -C build/ install
 
diff --git a/libkolabxml/compiled/XMLParserWrapper.cpp b/libkolabxml/compiled/XMLParserWrapper.cpp
index f6ebdf1..dffff8d 100644
--- a/libkolabxml/compiled/XMLParserWrapper.cpp
+++ b/libkolabxml/compiled/XMLParserWrapper.cpp
@@ -292,5 +292,4 @@ xml_schema::dom::auto_ptr<xercesc::DOMDocument> XMLParserWrapper::parse(std::ist
     }
     eh.reset();
     return xml_schema::dom::auto_ptr<xercesc::DOMDocument>();
-}
-
+}
\ No newline at end of file
diff --git a/libkolabxml/lib/CMakeLists.txt b/libkolabxml/lib/CMakeLists.txt
index 3c9fa51..90f31f0 100644
--- a/libkolabxml/lib/CMakeLists.txt
+++ b/libkolabxml/lib/CMakeLists.txt
@@ -3,17 +3,16 @@ SET_SOURCE_FILES_PROPERTIES(${SCHEMA_SOURCEFILES} PROPERTIES GENERATED 1)
 
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC -Wp,-D_FORTIFY_SOURCE=2 -O2" ) #always generate shared libraries with -fPIC, -D_FORTIFY_SOURCE=2 enables some extra checking
 
-# Library with serialization/deserialization code and kolab-containers
+#Library with serialization/deserialization code and kolab-containers
 add_library(kolabxml SHARED kolabformat.cpp kolabcontainers.cpp kolabnote.cpp kolabevent.cpp kolabtodo.cpp kolabjournal.cpp kolabcontact.cpp utils.cpp base64.cpp ../compiled/XMLParserWrapper.cpp ../compiled/grammar-input-stream.cxx ${SCHEMA_SOURCEFILES})
 
 target_link_libraries(kolabxml ${XERCES_C} ${Boost_LIBRARIES} ${UUID})
 
-# For the core library we can be stricter when compiling. This doesn't work with the auto generated code though.
-#set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wl,--no-undefined")
-set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wl,--no-undefined")
+#For the core library we can be stricter when compiling. This doesn't work with the auto generated code though.
+set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wl,--no-undefined")
 set_target_properties(kolabxml PROPERTIES VERSION 3.0.0 SOVERSION 0)
 
-install(TARGETS kolabxml LIBRARY DESTINATION "${LIB_INSTALL_DIR}")
+install(TARGETS kolabxml ${KOLAB_INSTALL_DIRECTORIES})
 
 install( FILES
     kolabformat.h
@@ -24,7 +23,7 @@ install( FILES
     kolabnote.h
     kolabcontainers.h
     global_definitions.h
-    DESTINATION ${INCLUDE_INSTALL_DIR} COMPONENT Devel)
+    DESTINATION ${KOLAB_HEADER_INSTALL_DIR} COMPONENT Devel)
 
 #----- The following makes sure libkolabxml is found in the install directory for installed files and not in the build directory (for libraries which link to libkolabxml)
 
@@ -32,14 +31,14 @@ install( FILES
 SET(CMAKE_SKIP_BUILD_RPATH  FALSE)
 # when building, don't use the install RPATH already(but later on when installing)
 SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE) 
-SET(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
+SET(CMAKE_INSTALL_RPATH "${KOLAB_LIB_INSTALL_DIR}")
 # add the automatically determined parts of the RPATH
 # which point to directories outside the build tree to the install RPATH
 SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
 # the RPATH to be used when installing, but only if it's not a system directory
-LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${LIB_INSTALL_DIR}" isSystemDir)
+LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${KOLAB_LIB_INSTALL_DIR}" isSystemDir)
 IF("${isSystemDir}" STREQUAL "-1")
-   SET(CMAKE_INSTALL_RPATH "${LIB_INSTALL_DIR}")
+   SET(CMAKE_INSTALL_RPATH "${KOLAB_LIB_INSTALL_DIR}")
 ENDIF("${isSystemDir}" STREQUAL "-1")
 
 #-----------------------SWIG--------------------
diff --git a/libkolabxml/lib/base64.cpp b/libkolabxml/lib/base64.cpp
index 528707b..071b05c 100644
--- a/libkolabxml/lib/base64.cpp
+++ b/libkolabxml/lib/base64.cpp
@@ -120,5 +120,4 @@ std::string base64_decode(std::string const& encoded_string) {
   }
 
   return ret;
-}
-
+}
\ No newline at end of file
diff --git a/libkolabxml/lib/global_definitions.h b/libkolabxml/lib/global_definitions.h
index 778337a..2aa36e8 100644
--- a/libkolabxml/lib/global_definitions.h
+++ b/libkolabxml/lib/global_definitions.h
@@ -33,5 +33,5 @@ enum ErrorSeverity {
 };
 
 }
-#endif
 
+#endif
diff --git a/libkolabxml/lib/incidence_p.h b/libkolabxml/lib/incidence_p.h
index c31795d..5f2dc12 100644
--- a/libkolabxml/lib/incidence_p.h
+++ b/libkolabxml/lib/incidence_p.h
@@ -62,5 +62,4 @@ namespace Kolab {
     
 }
 
-#endif
-
+#endif
\ No newline at end of file
diff --git a/libkolabxml/lib/kolabcontact.h b/libkolabxml/lib/kolabcontact.h
index a838465..e4164dd 100644
--- a/libkolabxml/lib/kolabcontact.h
+++ b/libkolabxml/lib/kolabcontact.h
@@ -378,4 +378,3 @@ private:
 } //Namespace
 
 #endif // KOLABCONTACT_H
-
diff --git a/libkolabxml/lib/kolabcontainers.cpp b/libkolabxml/lib/kolabcontainers.cpp
index 0a20aaa..491f9d7 100644
--- a/libkolabxml/lib/kolabcontainers.cpp
+++ b/libkolabxml/lib/kolabcontainers.cpp
@@ -35,7 +35,7 @@ struct cDateTime::Private {
     int day;
     int hour;
     int minute;
-    double second;
+    int second;
     bool isUtc;
     std::string timezone;
 };
@@ -46,7 +46,7 @@ cDateTime::cDateTime()
 
 }
 
-cDateTime::cDateTime(int year, int month, int day, int hour, int minute, double second, bool isUtc)
+cDateTime::cDateTime(int year, int month, int day, int hour, int minute, int second, bool isUtc)
 : d(new cDateTime::Private())
 {
     d->year = year;
@@ -58,7 +58,7 @@ cDateTime::cDateTime(int year, int month, int day, int hour, int minute, double
     d->isUtc = isUtc;
 }
 
-cDateTime::cDateTime(const std::string& timezone, int year, int month, int day, int hour, int minute, double second)
+cDateTime::cDateTime(const std::string& timezone, int year, int month, int day, int hour, int minute, int second)
 : d(new cDateTime::Private())
 {
     d->year = year;
@@ -137,7 +137,7 @@ int cDateTime::minute() const
     return d->minute;
 }
 
-double cDateTime::second() const
+int cDateTime::second() const
 {
     return d->second;
 }
@@ -156,7 +156,7 @@ void cDateTime::setDate(int year, int month, int day)
     d->month = month;
     d->day = day;
 }
-void cDateTime::setTime(int hour, int minute, double second)
+void cDateTime::setTime(int hour, int minute, int second)
 {
     d->hour = hour;
     d->minute = minute;
@@ -727,4 +727,3 @@ Alarm::Type Alarm::type() const
 
 
 }//Namespace
-
diff --git a/libkolabxml/lib/kolabcontainers.h b/libkolabxml/lib/kolabcontainers.h
index 3376c06..47dc5fc 100644
--- a/libkolabxml/lib/kolabcontainers.h
+++ b/libkolabxml/lib/kolabcontainers.h
@@ -26,8 +26,8 @@ namespace Kolab {
 class cDateTime {
 public:
     cDateTime();
-    cDateTime(int year, int month, int day, int hour, int minute, double second, bool isUtc=true);
-    cDateTime(const std::string &timezone, int year, int month, int day, int hour, int minute, double second);
+    cDateTime(int year, int month, int day, int hour, int minute, int second, bool isUtc=true);
+    cDateTime(const std::string &timezone, int year, int month, int day, int hour, int minute, int second);
     cDateTime(int year, int month, int day);
     ~cDateTime();
     cDateTime(const cDateTime &);
@@ -42,10 +42,10 @@ public:
     
     bool isDateOnly() const;
     
-    void setTime(int hour, int minute, double second);
+    void setTime(int hour, int minute, int second);
     int hour() const;
     int minute() const;
-    double second() const;
+    int second() const;
     
     void setUTC(bool);
     bool isUTC() const;
@@ -398,4 +398,3 @@ class Configuration {
 }
 
 #endif
-
diff --git a/libkolabxml/lib/kolabconversions.h b/libkolabxml/lib/kolabconversions.h
index 5a01adc..4871acd 100644
--- a/libkolabxml/lib/kolabconversions.h
+++ b/libkolabxml/lib/kolabconversions.h
@@ -179,4 +179,3 @@ boost::shared_ptr<Kolab::Note> deserializeObject(const std::string& s, bool isUr
 } //Namespace
 
 #endif
-
diff --git a/libkolabxml/lib/kolabevent.cpp b/libkolabxml/lib/kolabevent.cpp
index aef772e..07b4bb0 100644
--- a/libkolabxml/lib/kolabevent.cpp
+++ b/libkolabxml/lib/kolabevent.cpp
@@ -335,5 +335,4 @@ std::vector< Alarm > Event::alarms() const
 
 
 
-}
-
+}
\ No newline at end of file
diff --git a/libkolabxml/lib/kolabjournal.cpp b/libkolabxml/lib/kolabjournal.cpp
index bfefd04..f13633b 100644
--- a/libkolabxml/lib/kolabjournal.cpp
+++ b/libkolabxml/lib/kolabjournal.cpp
@@ -188,5 +188,4 @@ std::vector< CustomProperty > Journal::customProperties() const
 }
 
 
-}//Namespace
-
+}//Namespace
\ No newline at end of file
diff --git a/libkolabxml/lib/kolabnote.cpp b/libkolabxml/lib/kolabnote.cpp
index d316b0d..c7931bb 100644
--- a/libkolabxml/lib/kolabnote.cpp
+++ b/libkolabxml/lib/kolabnote.cpp
@@ -183,4 +183,3 @@ std::vector< CustomProperty > Note::customProperties() const
 }
 
 } //Note
-
diff --git a/libkolabxml/lib/kolabtodo.cpp b/libkolabxml/lib/kolabtodo.cpp
index 9c53511..97d2e03 100644
--- a/libkolabxml/lib/kolabtodo.cpp
+++ b/libkolabxml/lib/kolabtodo.cpp
@@ -324,5 +324,4 @@ std::vector< Alarm > Todo::alarms() const
     return d->alarms;
 }
 
-}
-
+}
\ No newline at end of file
diff --git a/libkolabxml/lib/php/CMakeLists.txt b/libkolabxml/lib/php/CMakeLists.txt
index 2d0a78a..2d95c36 100644
--- a/libkolabxml/lib/php/CMakeLists.txt
+++ b/libkolabxml/lib/php/CMakeLists.txt
@@ -28,14 +28,9 @@ SET_TARGET_PROPERTIES(phpbindings PROPERTIES PREFIX "")
 
 configure_file(test.php ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
 
-if (KOLAB_PHP_INSTALL_DIR)
-    set(PHP_INSTALL_DIR ${KOLAB_PHP_INSTALL_DIR})
-else (KOLAB_PHP_INSTALL_DIR)
-    set(PHP_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
-endif (KOLAB_PHP_INSTALL_DIR)
-
-install(TARGETS phpbindings LIBRARY DESTINATION ${PHP_INSTALL_DIR})
+install(TARGETS phpbindings LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
 
 install( FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.php
-  DESTINATION ${PHP_INSTALL_DIR})
+  test.php
+  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/phpbindings)
\ No newline at end of file
diff --git a/libkolabxml/lib/python/CMakeLists.txt b/libkolabxml/lib/python/CMakeLists.txt
index 4f7c1f7..397405c 100644
--- a/libkolabxml/lib/python/CMakeLists.txt
+++ b/libkolabxml/lib/python/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Generate Python wrapper
+#Generate Python wrapper
 include_directories(../)
 
 set(KOLAB_SWIG_PYTHON_SOURCE_FILE python_kolabformat_wrapper.cpp)
@@ -13,7 +13,7 @@ add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${KOLAB_SWIG_PYTHON_SOURCE
 SET_SOURCE_FILES_PROPERTIES(${KOLAB_SWIG_PYTHON_SOURCE_FILE} PROPERTIES GENERATED 1)
 ADD_CUSTOM_TARGET(generate_python_bindings ALL DEPENDS ${KOLAB_SWIG_PYTHON_SOURCE_FILE})
 
-# Compile Python Bindings
+#Compile Python Bindings
 find_package(PythonLibs)
 include_directories(${PYTHON_INCLUDE_DIRS})
 
@@ -26,14 +26,9 @@ SET_TARGET_PROPERTIES(pythonbindings PROPERTIES PREFIX "")
 
 configure_file(test.py ${CMAKE_CURRENT_BINARY_DIR} COPYONLY)
 
-if (KOLAB_PYTHON_INSTALL_DIR)
-    set(PYTHON_INSTALL_DIR ${KOLAB_PYTHON_INSTALL_DIR})
-else (KOLAB_PYTHON_INSTALL_DIR)
-    set(PYTHON_INSTALL_DIR ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
-endif (KOLAB_PYTHON_INSTALL_DIR)
-
-install(TARGETS pythonbindings LIBRARY DESTINATION ${PYTHON_INSTALL_DIR})
+install(TARGETS pythonbindings LIBRARY DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
 
 install( FILES
   ${CMAKE_CURRENT_BINARY_DIR}/kolabformat.py
-  DESTINATION ${PYTHON_INSTALL_DIR})
+  test.py
+  DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/pythonbindings)
\ No newline at end of file
diff --git a/libkolabxml/lib/shared_conversions.h b/libkolabxml/lib/shared_conversions.h
index 92dfb92..fd64ae5 100644
--- a/libkolabxml/lib/shared_conversions.h
+++ b/libkolabxml/lib/shared_conversions.h
@@ -119,5 +119,4 @@ std::string fromContactReference(const Kolab::ContactReference &c, bool embeddNa
     } //Namespace
 } //Namespace
 
-#endif
-
+#endif
\ No newline at end of file
diff --git a/libkolabxml/lib/utils.cpp b/libkolabxml/lib/utils.cpp
index dcab70d..8096f54 100644
--- a/libkolabxml/lib/utils.cpp
+++ b/libkolabxml/lib/utils.cpp
@@ -16,7 +16,6 @@
 */
 
 #include "utils.h"
-#include <iostream>
 #include <string>
 
 #include <boost/version.hpp>
@@ -246,5 +245,4 @@ std::string fromMailto(const std::string &mailtoUri)
 
 } //Namespace
 
-} //Namespace
-
+} //Namespace
\ No newline at end of file
diff --git a/libkolabxml/lib/xcardconversions.h b/libkolabxml/lib/xcardconversions.h
index e051cd4..b3c1577 100644
--- a/libkolabxml/lib/xcardconversions.h
+++ b/libkolabxml/lib/xcardconversions.h
@@ -1090,4 +1090,3 @@ boost::shared_ptr<T> deserializeCard(const std::string& s, bool isUrl)
 } //Namespace
 
 #endif
-


commit 577c7b44c324a07e569ce599d97b58f6a1cb9bcc
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Mar 26 23:12:06 2012 +0200

    Remove kdeinclude leftover

diff --git a/libkolabxml/tests/bindingstest.cpp b/libkolabxml/tests/bindingstest.cpp
index 75eec5e..c3283dd 100644
--- a/libkolabxml/tests/bindingstest.cpp
+++ b/libkolabxml/tests/bindingstest.cpp
@@ -12,7 +12,6 @@
 #include <xercesc/dom/DOMException.hpp>
 #include <xercesc/dom/DOMImplementation.hpp>
 #include <lib/kolabformat.h>
-#include <kdebug.h>
 // #include <kolab/kolabkcalconversion.h>
 #include <iostream>
 #include <fstream>


commit 3753a404315da553edb99cb72d94965d3bb7bf3e
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date:   Mon Mar 26 23:11:03 2012 +0200

    Revert "Only build the tests if the required kdebug.h can be found"
    
    This reverts commit ae3c5d211379e4dcc0418f9c66227be42b181823.
    
    Conflicts:
    
    	libkolabxml/tests/CMakeLists.txt

diff --git a/libkolabxml/tests/CMakeLists.txt b/libkolabxml/tests/CMakeLists.txt
index dcb5597..ecaa0ae 100644
--- a/libkolabxml/tests/CMakeLists.txt
+++ b/libkolabxml/tests/CMakeLists.txt
@@ -1,26 +1,17 @@
 include_directories( ${CMAKE_CURRENT_SOURCE_DIR}/.. )
 include_directories(${CMAKE_CURRENT_BINARY_DIR})
 
-find_path(KDELIBS_INCLUDE_DIR kdebug.h PATH_SUFFIXES kde4)
-
 include_directories(${QT_INCLUDES} ${QT_INCLUDE_DIR} QtCore)
-
 set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wl,--no-undefined" ) 
-
 if (QT4_FOUND)
-    if (KDELIBS_INCLUDE_DIR)
-        include_directories(${KDELIBS_INCLUDE_DIR})
-        message("Buildings tests")
-        QT4_AUTOMOC(bindingstest.cpp)
-        add_executable(bindingstest bindingstest.cpp ${CMAKE_CURRENT_BINARY_DIR}/${BINDINGSTEST_MOC})
-        target_link_libraries(bindingstest ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} kolabxml ${XERCES_C})
+    message("Buildings tests")
+    QT4_AUTOMOC(bindingstest.cpp)
+    add_executable(bindingstest bindingstest.cpp ${CMAKE_CURRENT_BINARY_DIR}/${BINDINGSTEST_MOC})
+    target_link_libraries(bindingstest ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} kolabxml ${XERCES_C})
 
-        QT4_AUTOMOC(conversiontest.cpp)
-        add_executable(conversiontest conversiontest.cpp ${CMAKE_CURRENT_BINARY_DIR}/${CONVERSIONTEST_MOC})
-        target_link_libraries(conversiontest ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} kolabxml ${XERCES_C})
-    else (KDELIBS_INCLUDE_DIR)
-        message(WARNING "Could not build tests because kdelibs-devel is missing")
-    endif (KDELIBS_INCLUDE_DIR)
-else (QT4_FOUND)
+    QT4_AUTOMOC(conversiontest.cpp)
+    add_executable(conversiontest conversiontest.cpp ${CMAKE_CURRENT_BINARY_DIR}/${CONVERSIONTEST_MOC})
+    target_link_libraries(conversiontest ${QT_QTTEST_LIBRARY} ${QT_QTCORE_LIBRARY} kolabxml ${XERCES_C})
+else()
     message(WARNING "Could not build tests because qt is missing")
-endif (QT4_FOUND)
+endif()





More information about the commits mailing list