12 commits - autogen.sh CMakeLists.txt cmake/modules README src/CMakeLists.txt
Jeroen van Meeuwen
vanmeeuwen at kolabsys.com
Sat May 12 14:53:39 CEST 2012
CMakeLists.txt | 51 ++++++++++--------------
README | 17 +++++---
autogen.sh | 22 ++++++++--
cmake/modules/FindLibkolabxmlDependencies.cmake | 10 +++-
src/CMakeLists.txt | 6 +-
5 files changed, 64 insertions(+), 42 deletions(-)
New commits:
commit f10ffa4e863139e506d71c59340a3c6361863c97
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Sat May 12 13:21:49 2012 +0100
Update readme to reflect build system changes
diff --git a/README b/README
index ab66976..052b3d9 100644
--- a/README
+++ b/README
@@ -9,11 +9,17 @@ $make
Options can either be supplied on the commandline or edited in the cmake cache.
-To install to lib64 instead of lib:
-LIB_INSTALL_DIR_SUFFIX=64
+Library installation path:
-If your distro uses lib64 paths and some packages can not be found try:
-CMAKE_PREFIX_PATH=/usr/lib64
+LIB_INSTALL_DIR=/usr/lib
+
+Set the installation prefix:
+
+CMAKE_INSTALL_PREFIX=/usr
+
+Installation location for header files:
+
+INCLUDE_INSTALL_DIR=/usr/include/kolabxml
Building of bindings can be controlled using cmake configuration options:
PYTHON_BINDINGS
@@ -30,7 +36,8 @@ CSHARP_INSTALL_DIR
=== Example ===
Find libraries in lib64, install to /usr/lib64, build python and phpbindings:
-$cmake -DCMAKE_PREFIX_PATH=/usr/lib64 -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR_SUFFIX=64 -DPYTHON_BINDINGS=TRUE -DPYTHON_INSTALL_DIR=/usr/local/pythonbindings -DPHP_BINDINGS=TRUE ..
+
+$cmake -DCMAKE_INSTALL_PREFIX=/usr -DLIB_INSTALL_DIR=/usr/lib64 -DPYTHON_BINDINGS=TRUE -DPYTHON_INSTALL_DIR=/usr/lib64/python$x.$y/site-packages/ -DPHP_BINDINGS=TRUE ..
== Requirements ==
commit 6e3bbcfc13dde9a213e4be1eff661ef85d5496e2
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Sat May 12 13:10:47 2012 +0100
The build environment knows best where libraries are supposed to be put
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 69aa825..6f8435a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -74,9 +74,6 @@ endif()
#C++ is required from here on
enable_language(CXX)
-# set up install directories. INCLUDE_INSTALL_DIR and LIB_INSTALL_DIR must not be absolute paths
-set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install libraries to")
-set(LIB_INSTALL_DIR lib${LIB_INSTALL_DIR_SUFFIX} )
set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Libkolabxml )
configure_file(libkolabxml-version.h.cmake "${CMAKE_BINARY_DIR}/libkolabxml-version.h" @ONLY)
commit 5f0d0f40e5ebb0c3c2cb9c876c2167c07e9d8f33
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Sat May 12 13:10:22 2012 +0100
Update autogen.sh
diff --git a/autogen.sh b/autogen.sh
index ec0d997..0cc4857 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -3,6 +3,7 @@
dobuild=0
doprep=0
dotest=0
+doinstall=0
srcdir=$(pwd)
@@ -23,13 +24,19 @@ while [ $# -gt 0 ]; do
shift
;;
+ --install|-i)
+ doinstall=1
+ shift
+ ;;
+
esac
done
-if [ ${dobuild} -eq 0 -a ${doprep} -eq 0 -a ${dotest} -eq 0 ]; then
+if [ ${dobuild} -eq 0 -a ${doprep} -eq 0 -a ${dotest} -eq 0 -a ${doinstall} -eq 0 ]; then
dobuild=1
doprep=1
dotest=1
+ doinstall=1
fi
# Rebuilds the entire foo in one go. One shot, one kill.
@@ -39,8 +46,9 @@ cd build
if [ ${doprep} -eq 1 ]; then
cmake \
-DCMAKE_VERBOSE_MAKEFILE=ON \
- -DCMAKE_PREFIX_PATH=/usr/lib64 \
- -DLIB_INSTALL_DIR_SUFFIX=64 \
+ -DCMAKE_INSTALL_PREFIX=/usr \
+ -DINCLUDE_INSTALL_DIR=/usr/include/kolabxml \
+ -DLIB_INSTALL_DIR=/usr/lib64 \
-DPHP_BINDINGS=ON \
-DPYTHON_BINDINGS=ON \
..
@@ -66,9 +74,13 @@ if [ ${dotest} -eq 1 ]; then
fi
fi
+if [ ${doinstall} -eq 1 ]; then
+ make install DESTDIR=${TMPDIR:-/tmp}
+fi
+
cd ..
-git archive --prefix=libkolabxml-0.4.0/ HEAD | gzip -c > libkolabxml-0.4.0.tar.gz
+git archive --prefix=libkolabxml-0.5/ HEAD | gzip -c > libkolabxml-0.5.tar.gz
-cp libkolabxml-0.4.0.tar.gz `rpm --eval='%{_sourcedir}'`
+cp libkolabxml-0.5.tar.gz `rpm --eval='%{_sourcedir}'`
commit 6db457036e740802dc33611458c32654110e472a
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Wed May 9 21:57:05 2012 +0100
Use the include directory location specified by -DINCLUDE_INSTALL_DIR
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 2c64f34..ff2dd08 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -37,7 +37,7 @@ install( FILES
kolabnote.h
kolabcontainers.h
global_definitions.h
- DESTINATION ${INCLUDE_INSTALL_DIR}/kolab)
+ DESTINATION ${INCLUDE_INSTALL_DIR})
#-----------------------SWIG--------------------
# Building of the bindings can be controlled using the switches along the lines of: cmake -DPHP_BINDINGS=TRUE -DCSHARP_BINDINGS=FALSE ..
commit de87ba54328c42fbf576d284bfbd2159e7d084c1
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Wed May 9 21:56:53 2012 +0100
Do not set a static include directory at all
diff --git a/CMakeLists.txt b/CMakeLists.txt
index b9a59e2..69aa825 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -79,9 +79,6 @@ set(LIB_INSTALL_DIR_SUFFIX "" CACHE STRING "The directories where to install lib
set(LIB_INSTALL_DIR lib${LIB_INSTALL_DIR_SUFFIX} )
set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Libkolabxml )
-# Use a versioned install directory for the headers so multiple versions can be installed in parallel
-set(INCLUDE_INSTALL_DIR include )
-
configure_file(libkolabxml-version.h.cmake "${CMAKE_BINARY_DIR}/libkolabxml-version.h" @ONLY)
set(Boost_USE_MULTITHREADED ON)
commit 8dbf2509d43f20769591fc81575228a8e375fea7
Merge: 9a40bd8 78d2d9d
Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen at kolabsys.com>
Date: Wed May 9 21:35:44 2012 +0100
Merge branch 'buildsystem'
commit 78d2d9d78366bc2edf8ade7dea94192690f5195e
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Wed May 9 21:04:18 2012 +0200
xsdbin requires a certain schema order in order to work with xerces < 3.1.0, this patch fixes the order accordingly.
It has something to do with the inclusion of duplicates, if a second schema of the same namespace is imported, it's not entierly clear why there are duplicates though...
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 07194de..b9a59e2 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -109,14 +109,15 @@ file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/bindings)
set( SCHEMA_DIR ${CMAKE_SOURCE_DIR}/schemas )
# Generate bindings
-
+# WARNING: The inclusion order in SCHEMAS matters with xerces < 3.1.0. It seems without XMLUni::fgXercesHandleMultipleImports at least kolabformat-xcard.xsd MUST be before xCard.xsd,
+# otherwise the compiled schema will simply lack the definitions of kolabformat-xcard.xsd (this affects xsdbin only).
set( SCHEMAS
${SCHEMA_DIR}/ical/kolabformat-xcal.xsd
${SCHEMA_DIR}/ical/iCalendar-params.xsd
${SCHEMA_DIR}/ical/iCalendar-props.xsd
${SCHEMA_DIR}/ical/iCalendar-valtypes.xsd
- ${SCHEMA_DIR}/xCard.xsd
${SCHEMA_DIR}/kolabformat-xcard.xsd
+ ${SCHEMA_DIR}/xCard.xsd
${SCHEMA_DIR}/kolabformat.xsd
)
commit 2c3d682ddc3eac67962dc652a53e5e6239df5e43
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Wed May 9 21:01:48 2012 +0200
less duplication
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2e89d0a..07194de 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -144,28 +144,21 @@ add_custom_command(OUTPUT ${SCHEMA_SOURCEFILES}
VERBATIM
)
-# Compile Schemas
-
-if (XSDBIN_FOUND)
- add_custom_command(OUTPUT kolabformat-xcal-schema.cxx
- COMMAND ${XSDBIN} --verbose --array-name iCalendar_schema --output-dir ${CMAKE_BINARY_DIR} ${SCHEMAS}
- COMMENT "Compiling Kolab XSD schema"
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- DEPENDS ${SCHEMAS}
- VERBATIM
- )
-else (XSDBIN_FOUND)
+# Compile xsdbin if not found
+if (NOT XSDBIN_FOUND)
add_executable(xsdbin compiled/xsdbin.cxx)
target_link_libraries(xsdbin ${XERCES_C})
+ set(XSDBIN ${CMAKE_BINARY_DIR}/xsdbin)
+endif ()
- add_custom_command(OUTPUT kolabformat-xcal-schema.cxx
- COMMAND ${CMAKE_BINARY_DIR}/xsdbin --verbose --array-name iCalendar_schema --output-dir ${CMAKE_BINARY_DIR} ${SCHEMAS}
- COMMENT "Compiling Kolab XSD schema"
- WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
- DEPENDS ${SCHEMAS} xsdbin
- VERBATIM
- )
-endif (XSDBIN_FOUND)
+# Compile Schemas
+add_custom_command(OUTPUT kolabformat-xcal-schema.cxx
+ COMMAND ${XSDBIN} --verbose --array-name iCalendar_schema --output-dir ${CMAKE_BINARY_DIR} ${SCHEMAS}
+ COMMENT "Compiling Kolab XSD schema"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
+ DEPENDS ${SCHEMAS} ${XSDBIN}
+ VERBATIM
+ )
set( SCHEMA_SOURCEFILES ${SCHEMA_SOURCEFILES} ${CMAKE_BINARY_DIR}/kolabformat-xcal-schema.cxx)
commit cf2fb05be78c6b5f19be37d8b5a9bd65390ac707
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Wed May 9 21:01:02 2012 +0200
Make buildsystem work with cmake 2.6 also when building tests.
Otherwise it bails out due to the unknown language "NONE"
diff --git a/CMakeLists.txt b/CMakeLists.txt
index e29215a..2e89d0a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,4 +1,9 @@
-project(Libkolabxml NONE)
+# The special language NONE is not available in cmake 2.6
+if(${CMAKE_MAJOR_VERSION} EQUAL 2 AND ${CMAKE_MINOR_VERSION} GREATER 6)
+ project(Libkolabxml NONE)
+else()
+ project(Libkolabxml C)
+endif()
cmake_minimum_required(VERSION 2.6)
commit 2e966f6c7a965bc30b4e25201119b21aa851d56f
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Fri May 4 19:49:25 2012 +0200
Find xerces-c and xsdcxx which have been installed in non-standard locations.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 03980e6..e29215a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -174,6 +174,8 @@ include_directories(
compiled
${CMAKE_CURRENT_BINARY_DIR}
${Boost_INCLUDE_DIRS}
+ ${XSDCXX_INCLUDE_DIRS}
+ ${XERCES_C_INCLUDE_DIRS}
)
diff --git a/cmake/modules/FindLibkolabxmlDependencies.cmake b/cmake/modules/FindLibkolabxmlDependencies.cmake
index 5c16f6a..84c2de6 100644
--- a/cmake/modules/FindLibkolabxmlDependencies.cmake
+++ b/cmake/modules/FindLibkolabxmlDependencies.cmake
@@ -17,12 +17,18 @@ else()
endif()
find_program(XSDCXX xsdcxx /usr/bin/)
+if (XSDCXX)
+ find_path(XSDCXX_INCLUDE_DIRS NAMES xsd/cxx/version.hxx)
+endif()
find_package_handle_standard_args(XSDCXX DEFAULT_MSG
- XSDCXX)
+ XSDCXX XSDCXX_INCLUDE_DIRS)
find_library(XERCES_C NAMES xerces-c xerces-c_2)
+if (XERCES_C)
+ find_path(XERCES_C_INCLUDE_DIRS NAMES xercesc/framework/XMLGrammarPool.hpp)
+endif()
find_package_handle_standard_args(Xerces DEFAULT_MSG
- XERCES_C)
+ XERCES_C XERCES_C_INCLUDE_DIRS)
find_program(SWIG swig /usr/bin/)
if(SWIG)
commit 7cde00687cefa63e1623e0891e0d10517bd87b17
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Fri May 4 19:46:32 2012 +0200
Don't set -Werrors and -Wfatal-errors for releases.
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 0b65a5b..2c64f34 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -13,9 +13,11 @@ target_link_libraries(kolabxml ${XERCES_C} ${Boost_LIBRARIES} ${UUID})
if (${Boost_MAJOR_VERSION}.${Boost_MINOR_VERSION} VERSION_LESS 1.42)
# We can't be as strict on with older versions of boost it seems (not sure if this is the exact version number where it breaks)
# Since this is only for el5 compatibility we relax the rules (resulting in a couple of warning but a working build)
- set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wfatal-errors -Wconversion")
+ #for development add here -Werror -Wfatal-errors (but don't for releases)
+ set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wconversion")
else() #then normal case
- set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wconversion -Wl,--no-undefined")
+ #for development add here -Werror -Wfatal-errors (but don't for releases)
+ set_target_properties(kolabxml PROPERTIES COMPILE_FLAGS "-Wall -Wextra -Wconversion -Wl,--no-undefined")
endif()
set_target_properties(kolabxml PROPERTIES VERSION ${Libkolabxml_VERSION} SOVERSION ${Libkolabxml_VERSION_MAJOR})
commit 637fd7a8fdc783ef9d0de3c34c82c90228af3241
Author: Christian Mollekopf <mollekopf at kolabsys.com>
Date: Fri May 4 19:45:58 2012 +0200
Export the correct include directory for "kolab/include.h" includes.
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 53eaa8b..03980e6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -75,7 +75,7 @@ set(LIB_INSTALL_DIR lib${LIB_INSTALL_DIR_SUFFIX} )
set(CMAKECONFIG_INSTALL_DIR ${LIB_INSTALL_DIR}/cmake/Libkolabxml )
# Use a versioned install directory for the headers so multiple versions can be installed in parallel
-set(INCLUDE_INSTALL_DIR include/kolab )
+set(INCLUDE_INSTALL_DIR include )
configure_file(libkolabxml-version.h.cmake "${CMAKE_BINARY_DIR}/libkolabxml-version.h" @ONLY)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 4410575..0b65a5b 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -35,7 +35,7 @@ install( FILES
kolabnote.h
kolabcontainers.h
global_definitions.h
- DESTINATION ${INCLUDE_INSTALL_DIR})
+ DESTINATION ${INCLUDE_INSTALL_DIR}/kolab)
#-----------------------SWIG--------------------
# Building of the bindings can be controlled using the switches along the lines of: cmake -DPHP_BINDINGS=TRUE -DCSHARP_BINDINGS=FALSE ..
More information about the commits
mailing list