Branch 'buildsystem' - 3 commits - CMakeLists.txt

Christian Mollekopf mollekopf at kolabsys.com
Wed May 9 21:05:17 CEST 2012


 CMakeLists.txt |   43 +++++++++++++++++++++----------------------
 1 file changed, 21 insertions(+), 22 deletions(-)

New commits:
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)
 





More information about the commits mailing list